units — the processing units that job consumed. Usage
endpoints roll those up for a time range.
- Python
- TypeScript
- cURL
GET /v1/usage/overview is the dashboard rollup. The SDK does not wrap that route yet — call it over HTTP.
Units are not the same as wall-clock seconds. A 96-page parse reports 96 units even if wait_seconds returned in one request. A failed or cancelled job may still report units for work that ran before it stopped, and its credits bill exactly those units when it had already delivered results (a progressive classify or extract publishes its labels or values before it finishes). A job that failed or was cancelled before delivering anything is not charged: its credits are 0.
Final credits
Every job also reportscredits, the amount it is billed, already priced by the credit schedule
named in credit_schedule_version. Don’t multiply it by a per-tool rate. A job that fails, or that you
cancel before it completes, is not charged for work it did not deliver: its credits are 0. Results already
delivered before the cancel or failure are billed: a progressive classify or extract that published labels
or values bills those units, at the price a success would have paid. A cancelled job also returns no
results (result_state: "cancelled"; see Cancellation). It is null and
usage_final is false while the job is queued or running and until its usage is settled. Once
usage_final is true, credits never changes, even after the payload expires or the job is
deleted. GET /v1/usage sums credits over jobs whose usage is final and counts the rest in
unfinalized_jobs.
Credit schedule 3
One credit is one parsed page. A spreadsheet counts one page-equivalent per 500 non-empty cells in each sheet, and audio one per started minute. Each tool that reads a document pays a parse part and its own part:parse_mode: "high" adds OCR correction, so it doubles the parse part only: a high-effort parse is 2
credits a page, a split or classify 3, an extract 4. Ground takes no parse_mode.
What a job was charged for
Onceusage_final is true, a job’s usage lists what its credits were charged for, one line per
part. Before waivers, each line’s credits is quantity × credits_per_unit × multiplier; a waived
line has 0 credits. The lines add up to
the job’s credits. A 2-page extract sent with parse_mode: "high":
Reused parses
Asplit or extract whose source is one of your succeeded parse jobs
({"type": "parse_result", "job_id": ...}) at low effort does not pay for the parse again when it reads the stored text. Its parse line stays in
usage at 0 credits, with a waiver explaining the reused work:
part: "job", reason: "repeat_of_job"). Cache misses, changed settings, expired artifacts, and another tenant’s work do not qualify. A spreadsheet parse_result that reads the original workbook again is still charged for parsing.
The waiver’s source_job_id is always null. Billing history outlives source-job visibility, so it records the discount reason without publishing another job’s ID.
The job.usage_finalized webhook carries the same usage. It is null on jobs finalized before usage breakdowns were introduced.
Jobs finalized under schedule 2 keep their credits: split was 1 credit a page, and high effort doubled
the whole job.
See Usage for the field list.
Dollar component prices
When the deployment has an approved dollar price sheet, a finished perception job also returnscost. It lists Parse and the requested operation separately, with
quantities, USD unit prices and totals. Dollar amounts are decimal strings to keep
small charges exact. They are calculated from component quantities, independently
of credits.
Each line’s execution is its price tier: fresh for the normal price, or reused
for verified reuse of your tenant’s earlier work. Reuse has a lower, nonzero unit
price. reuse_reason distinguishes reused parsing from a reused complete result.
These fields do not report provider prompt-token caching. Another tenant’s cached
work does not qualify for your reuse price.
The price-sheet version is saved when the job is accepted. Once usage is final,
the same dollar amounts appear in job reads, job lists and the usage webhook, even
after rates change or the result is deleted. A job accepted without a price sheet,
an older job, or work with unknown component quantities returns cost: null rather
than inventing a zero price. Before finalization cost is also null.
cost is a price breakdown, not proof that Drex debited its wallet. This additive
response does not change existing credit settlement. Dollar settlement requires
approved rates and coordinated adoption by the billing consumer.