Documents

Get token usage for a set of documents

Changed on

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

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_cached_input_tokensinteger

Total cached 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, at the price in force on the day of each call.

total_duration_msinteger required

Total LLM call duration in milliseconds across all documents.

total_llm_callsinteger required

Total number of LLM calls.

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property to the response with the status