Thinking token/Reasoning token is not exporting in the traces

Hi team,

We are not able to see the thinking tokens/Reasoning tokens in the traces. Please do let us know, how can we get this information.


There’s no setting for it the field just doesn’t exist yet. CompletionUsage in llm.py
(agents/livekit-agents/livekit/agents/llm/llm.py at main · livekit/agents · GitHub) only carries prompt / completion / cached / total, and trace_ types.py (agents/livekit-agents/livekit/agents/telemetry/trace_types.py at main · livekit/agents · GitHub) only defines gen_ai.usage. attributes for those. reasoning_tokens returns zero hits anywhere in the repo, so the span has nothing to emit.

You’re not losing the count though both OpenAI and Anthropic report reasoning/thinking tokens as part of output, so they’re already inside your completion_tokens. To break them out you’d have to read the raw provider usage yourself and set your own span attribute. Worth opening a feature request I couldn’t find one already filed.

This will not work with Gemini since it is emitting seperately

Not the answer you were looking for I’m afraid, but I see this GH issue includes adding thought summaries to OTEL but was closed automatically as not planned: