Skip to main content

API bug: Claude missing usage.completion_tokens_details.reasoning_tokens

Please include usage.completion_tokens_details.reasoning_tokens for Claude models.

1. usage.completion_tokens_details.reasoning_tokens is present for OpenAI models:

$ curl https://api.venice.ai/api/v1/chat/completions -H "Authorization: Bearer $VENICE_API_KEY" --json '{"stream": true, "stream_options": {"include_usage": true}, "model": "openai-gpt-6-luna", "messages": [{"role": "user", "content": "think about what you could tell me about quadratic equations in 10 words"}]}'

data: {"id":"...","object":"chat.completion.chunk","created":1793718943,"model":"openai-gpt-6-luna","choices":[{"index":0,"delta":{"reasoning_content":"Counting words for math format\n\nI"},"finish_reason":null}]}

...

data: {"id":"...","object":"chat.completion.chunk","created":1793718945,"model":"openai-gpt-6-luna","choices":[],"usage":{"prompt_tokens":1524,"completion_tokens":142,"total_tokens":1666,"prompt_tokens_details":{"cached_tokens":1503,"cache_creation_input_tokens":18},"cache_read_input_tokens":1503,"cache_creation_input_tokens":18,"completion_tokens_details":{"reasoning_tokens":114}},"cost":{"usd":0,"diem":0.00008858}}

data: [DONE]
  1. But absent for Anthropic models:

$ curl https://api.venice.ai/api/v1/chat/completions -H "Authorization: Bearer $VENICE_API_KEY" --json '{"stream": true, "stream_options": {"include_usage": true}, "model": "claude-haiku-5-5", "messages": [{"role": "user", "content": "think about what you could tell me about quadratic equations in 10 words"}]}'

data: {"id":"...","object":"chat.completion.chunk","created":1793718787,"model":"claude-haiku-5-5","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}]}

: processing

data: {"id":"...","object":"chat.completion.chunk","created":1793718788,"model":"claude-haiku-5-5","choices":[{"index":0,"delta":{"reasoning_content":"I'm working out","reasoning_details":[{"type":"reasoning.text","format":"anthropic-claude-v1","index":0,"text":"I'm working out"}],"content":""}
,"finish_reason":null}]}

data: {"id":"...","object":"chat.completion.chunk","created":1793718789,"model":"claude-haiku-5-5","choices":[],"usage":{"prompt_tokens":2450,"completion_tokens":279,"total_tokens":2729,"prompt_tokens_details":{"cached_tokens":2424},"cache_read_input_tokens":2424},"cost":{"usd":0,"diem":0.00016634}}

data: [DONE]

Log in to comment and vote

No comments yet

Be the first to share your thoughts.