How are credits spent for async jobs?

How are credits spent for async jobs?

Every time you run a job, the system takes the 1st page of the document and returns the credit spent in the credits parameter that you see in the output. If the job/check is successful it consumes credits for the job/check call + credits for the remaining pages.

For example:

  1. You have an input: PDF with 10 pages
  2. You call pdf/edit/add to add text on 3 pages with async: true.
  3. This call takes 21 credits (1st page) (1 out of 3)
  4. After 10 seconds you run job/check. It returns a success status.
  5. Your credit spent will show 44 credits.
  • job/check = 2 credits
  • pdf/edit/add = 21 credits /page * 2 pages (for 2 remaining pages) (3 out of 3)
  1. If job/check returns failed, aborted or invalid status, the job stops and the system returns used credits back to your account.
  2. All further job/check calls or job/check with working status will consume few credits per call just for job/check.

Why job/check call also consumes credits? The job/check call takes a very small number of credits by design to prevent users from running job/check at a very high rate.

If you are processing large documents that can take 1-2 minutes to process, we recommend putting larger delays before the next job/check call. For example, if you run OCR for a scanned document: created an async job, make a delay for 60-100 seconds, and run job/check call.

You can always explore the total number of credits spent per async job at the API logs page at https://app.pdf.co/account/logs/api

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.