Usage
Token usage statistics for a single chat or FIM request.
For streamed responses the statistics ride on the last content chunk — the one whose single choice carries no new content and a non-null finish_reason — instead of a separate usage-only chunk; see ChatCompletionChunk.usage and StreamOptions.
Constructors
Properties
Number of tokens in the generated completion.
Breakdown of how completionTokens was spent — in particular the tokens spent on reasoning in thinking mode.
Number of prompt tokens served from the context cache, or null when caching does not apply.
Number of prompt tokens not served from the context cache, or null when caching does not apply.
Number of tokens in the prompt, equal to promptCacheHitTokens + promptCacheMissTokens.
Breakdown of promptTokens under the OpenAI-compatible prompt_tokens_details key. The current API reference leaves it out, but live responses still carry it alongside promptCacheHitTokens / promptCacheMissTokens, so it is kept and stays nullable.
Total tokens billed for the request (prompt + completion).