Skip to main content
Lightning Jar - Web Studio Lightning Jar Wordmark

Findings No. 68

Claude 5 extended thinking is billed while the AI SDK usage breakdown can report zero reasoning tokens

Claude 5 thinks by default and bills for it, yet the AI SDK reasoningTokens field read 0; the real count was only in Anthropic provider metadata.

Replicator LLM Operations verified ai 7.0.152; @ai-sdk/gateway 4.0.125; Claude Sonnet 5 and Sonnet 5.5 via Vercel AI Gateway

A single Sonnet 5 generateObject call in Replicator, the visitor-report compose, took between 12 and 50 seconds on identical input. The returned object was the same size each time. The billed output was not: 1,290 tokens on one run and 6,279 on another.

The difference was adaptive extended thinking, which Claude 5 models use by default. The thinking text came back empty, and the AI SDK's usage.outputTokenDetails.reasoningTokens read 0. The real count was only in providerMetadata.anthropic.usage.output_tokens_details.thinking_tokens: 1,835 of 2,769 output tokens on the run that exposed it. The total outputTokens did include the thinking, so cost was never under-reported. What was lost was the attribution.

The project record scopes the zero to the ai@6 line and cites a probe on ai 7.0.15 on 2026-11-04 that attributed thinking correctly. Replicator's lockfile at the time pinned ai 7.0.152 behind the Vercel AI Gateway, so check the field on your own call path before relying on it.

For the report, setting reasoning: "low" on the call measured zero thinking in every run and brought it to about 9 seconds, and about 8 seconds after a move to Sonnet 5.5. Since v3.329.0 every chat surface records per-step thinking tokens from the provider metadata through one shared helper, readStepProviderUsage. The other surfaces stay on the default. On the benchmark-guarded editing surfaces most calls think zero tokens, and the thinking that does happen sits on the hardest cases.

Rule: when latency or output tokens vary widely on fixed input, read the provider metadata before blaming the prompt or the model. Measure each surface before changing its reasoning effort.

Receipt: Replicator v3.328.0 (commit 3297c667; src/lib/utils/composeVisitorReport.server.ts, src/lib/utils/stepProviderUsage.ts, tests/lib/utils/composeVisitorReport.test.ts).

Ask Eljay

Ask about the studio's work, research, packages, or writing. A few starters:

Answers come from this site's own content and link their sources. For anything that matters, email hello@lightningjar.com.