OptionalinputThe number of tokens in the input prompt, if available.
OptionaloutputThe number of tokens generated in the output response, if available.
OptionalproviderOptional raw usage data provided directly by the LLM provider for extensibility (structure depends on provider).
OptionalstopThe reason the LLM stopped generating tokens (e.g., 'stop_sequence', 'max_tokens', 'tool_calls'), if available.
OptionalthinkingThe number of tokens identified as part of the LLM's internal thinking process (if available from provider).
OptionaltimeThe time elapsed (in milliseconds) until the first token was generated in a streaming response, if applicable and available.
OptionaltotalThe total time elapsed (in milliseconds) for the entire generation process, if available.
OptionaltraceThe trace ID associated with the LLM call, useful for correlating metadata with the specific request.
Structure for holding metadata about an LLM call, typically received via a
METADATAStreamEventor parsed from a non-streaming response. Fields are optional as availability varies by provider and stream state.LLMMetadata