Usage

Get LLM usage and estimated cost

Changed on

Aggregate LLM token usage and estimated cost over a range of UTC days, broken down by model, by task step, and by what the spend was for.

get/api/v0/usage

Request

Query parameters

startstring date nullable

Only count usage on or after this UTC day.

endstring date nullable

Only count usage strictly before this UTC day.

owner_kind'document' | 'agent_run' | 'question' | 'knowledge_base' | 'knowledge_graph' | 'schematic' | 'experiment' | 'unattributed'

What a block of LLM spend is attributable to.

Restrict to one kind of spend. Unattributed calls are booked with no user, so 'unattributed' matches none of the caller's spend.

Response

Successful Response

total_input_tokensinteger required

Total input tokens.

total_cached_input_tokensinteger

Total tokens served from the prompt cache.

total_output_tokensinteger required

Total output tokens.

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 ms.

total_llm_callsinteger required

Total number of LLM calls.

Changes