Statistics on the interaction request's token usage.

Properties

cached_tokens_by_modality?: CachedTokensByModality[]

A breakdown of cached token usage by modality.

input_tokens_by_modality?: InputTokensByModality[]

A breakdown of input token usage by modality.

output_tokens_by_modality?: OutputTokensByModality[]

A breakdown of output token usage by modality.

tool_use_tokens_by_modality?: ToolUseTokensByModality[]

A breakdown of tool-use token usage by modality.

total_cached_tokens?: number

Number of tokens in the cached part of the prompt (the cached content).

total_input_tokens?: number

Number of tokens in the prompt (context).

total_output_tokens?: number

Total number of tokens across all the generated responses.

total_reasoning_tokens?: number

Number of tokens of thoughts for thinking models.

total_tokens?: number

Total token count for the interaction request (prompt + responses + other internal tokens).

total_tool_use_tokens?: number

Number of tokens present in tool-use prompt(s).