Summary
GPT-5.6 (Sol/Terra/Luna) bills prompt-cache writes at 1.25x the uncached input rate. Mux's cost pipeline cannot attribute this premium yet: cache-written tokens are costed at the base input rate, so costs are slightly underreported on cache-miss/first-write requests. Found by Codex review on #3702.
Verified facts (July 9, 2026)
- The Responses API reports cache writes: a live
gpt-5.6-sol call with prompt_cache_key returned usage.input_tokens_details.cache_write_tokens: 3207 on first call and cached_tokens: 3207 on the second.
@ai-sdk/openai does not surface it: convertOpenAIResponsesUsage hardcodes cacheWrite: undefined and the usage Zod schema only parses cached_tokens, stripping cache_write_tokens. Verified on installed 3.0.62 and latest 3.0.83 — a version bump does not help.
- Mux's
createDisplayUsage() only sets cacheCreateTokens from providerMetadata.anthropic.cacheCreationInputTokens; there is no OpenAI-side source.
Impact
Bounded underreport: 0.25 × input rate on cache-written tokens, once per prefix (e.g. Sol at $5/M input → $1.25/M premium on first-write tokens). Subsequent cache hits are costed correctly via cached_tokens.
Options
- Wait for upstream:
@ai-sdk/openai maps cache_write_tokens → inputTokens.cacheWrite (the provider-usage shape already has the slot). Then read it generically in createDisplayUsage alongside the Anthropic path. Preferred; consider filing/watching an upstream issue.
- Mux-side workaround: extract usage from raw Responses bodies (JSON + SSE
response.completed) in the OpenAI fetch wrapper and side-channel it into usage aggregation. Invasive/fragile; only if upstream stalls.
The cache_creation_input_token_cost metadata for GPT-5.6 in models-extra.ts is already correct, so pricing lights up automatically once cache-write tokens reach createDisplayUsage.
Generated with mux • Model: anthropic:claude-fable-5 • Thinking: high • Cost: $37.87
Summary
GPT-5.6 (Sol/Terra/Luna) bills prompt-cache writes at 1.25x the uncached input rate. Mux's cost pipeline cannot attribute this premium yet: cache-written tokens are costed at the base input rate, so costs are slightly underreported on cache-miss/first-write requests. Found by Codex review on #3702.
Verified facts (July 9, 2026)
gpt-5.6-solcall withprompt_cache_keyreturnedusage.input_tokens_details.cache_write_tokens: 3207on first call andcached_tokens: 3207on the second.@ai-sdk/openaidoes not surface it:convertOpenAIResponsesUsagehardcodescacheWrite: undefinedand the usage Zod schema only parsescached_tokens, strippingcache_write_tokens. Verified on installed 3.0.62 and latest 3.0.83 — a version bump does not help.createDisplayUsage()only setscacheCreateTokensfromproviderMetadata.anthropic.cacheCreationInputTokens; there is no OpenAI-side source.Impact
Bounded underreport: 0.25 × input rate on cache-written tokens, once per prefix (e.g. Sol at $5/M input → $1.25/M premium on first-write tokens). Subsequent cache hits are costed correctly via
cached_tokens.Options
@ai-sdk/openaimapscache_write_tokens→inputTokens.cacheWrite(the provider-usage shape already has the slot). Then read it generically increateDisplayUsagealongside the Anthropic path. Preferred; consider filing/watching an upstream issue.response.completed) in the OpenAI fetch wrapper and side-channel it into usage aggregation. Invasive/fragile; only if upstream stalls.The
cache_creation_input_token_costmetadata for GPT-5.6 inmodels-extra.tsis already correct, so pricing lights up automatically once cache-write tokens reachcreateDisplayUsage.Generated with
mux• Model:anthropic:claude-fable-5• Thinking:high• Cost:$37.87