Documents

Get token usage for a set of documents

Get token usage / cost tracking aggregated over an explicit list of documents (e.g. the documents of a single batch upload).

post/api/v0/documents/token-usage

Request body

document_idsstring[] required

Public IDs of the documents to aggregate token usage for.

Response

Successful Response

total_input_tokensinteger required

Total input tokens across all documents.

total_output_tokensinteger required

Total output tokens across all documents.

total_estimated_cost_usdnumber required

Total estimated cost in USD (calculated live from current pricing).

total_duration_msinteger required

Total LLM call duration in milliseconds across all documents.

total_llm_callsinteger required

Total number of LLM calls.

Changes

No recorded changes to this endpoint across all 1 revision of this API.