A confirmed bug in OpenAI’s Codex CLI is silently inflating AWS Bedrock bills by as much as 10x for developers running agentic coding sessions. The issue — reported on August 9 in GitHub issue #37674 and now viral on Hacker News — shows that Codex’s native Bedrock provider generates massive cache-write token charges on every request without triggering corresponding cache reads. One developer documented $1,182 in charges over just four days on a workload budgeted at roughly $100. No fix has shipped from OpenAI or AWS as of August 21.
The AWS Bedrock Codex Cache Bug Explained #
AWS Bedrock’s explicit prompt caching for GPT-5.6 Sol is designed on a write-once, read-many model: the first request pays a 1.25x premium to store a snapshot of the model’s internal state, and every subsequent request retrieves that snapshot at a 90% discount. For agentic coding workloads — where system prompts and tool definitions repeat across every turn — this should deliver dramatic savings.
However, the Codex CLI’s native Bedrock provider does not serialize the required prompt_cache_options
or prompt_cache_breakpoint
parameters in its requests. Without those fields, Bedrock’s implicit caching fires on every call, creating cache-write charges — but because the cache keys are never properly structured, zero cache reads ever return. The result: developers pay the write premium on every single request, indefinitely, with no reads to amortize it.
The Math That Works Against You #
Here is the counterintuitive part. Cache writes cost 1.25x the standard input token rate. Cache reads cost only 10% of standard. For caching to break even, approximately 20% of tokens flowing through the cache need to come back as reads. When reads are zero — as in the bug scenario — the effective rate is strictly higher than if caching had never been involved at all.
The reporter’s four-day sample tells the story precisely: 3,656 requests generated 171.94 million cache-write tokens, racking up $1,182 in cache-write charges alone — about 85% of total model spend. Cache reads: near zero. The feature designed to cut costs was adding a 25% surcharge to every token. AWS’s own documentation for explicit caching landed July 30, but the Codex CLI never picked up the Bedrock-specific parameters it requires.
The same pattern has been confirmed beyond Codex. LibreChat PR #13468 fixes “Bedrock Cache Tokens Inflating Completion Count,” and OpenCode filed a matching report. This is a structural mismatch between OpenAI’s standard API and Bedrock’s different caching interface — not a quirk isolated to one tool.
Related:[Claude API Mid-Conversation Tool Changes: Fix the Cache Bug]— a similar story of API caching behavior causing unexpected developer costs.
Who Is Affected by the Codex Bedrock Billing Bug #
The bug affects developers using Codex CLI with the --provider bedrock
flag and the GPT-5.6 Sol model. Developers accessing Codex through OpenAI’s direct API are not affected. GPT-5.6 Sol went GA on Bedrock on July 9, 2026 — meaning some teams may have accumulated inflated charges for over six weeks before this surfaced publicly on Hacker News.
To check: open your AWS billing console and drill into Bedrock service costs. Look for line items showing high cache-write token counts against near-zero cache-read tokens. The Bedrock response usage object returns per-request cache metrics in the cache_write_tokens
and cache_read_tokens
fields — if the former consistently dwarfs the latter, the bug is active on your account.
What to Do Right Now #
There is no official patch yet. OpenAI has not responded to the GitHub issue as of this writing; AWS has not issued a statement. The options are limited but manageable. Switching Codex to the direct OpenAI API eliminates the Bedrock caching layer entirely — you lose consolidated AWS billing, but you stop paying the write premium immediately. If you need Bedrock for compliance or enterprise discount reasons, set an AWS Budgets alert for Bedrock spend so runaway costs trigger a notification before they compound.
A third option is to keep using Bedrock Codex with active monitoring: log the per-request cache metrics and alert if your cache-read-to-write ratio drops below a meaningful threshold. What you should not do is assume the default configuration is handling caching correctly. The bug is live, the billing impact is real, and the fix timeline from OpenAI is unknown.
Key Takeaways #
- Codex CLI’s native AWS Bedrock provider has a confirmed bug: it generates cache-write charges without corresponding cache reads, turning a cost-saving feature into a billing trap that makes sessions more expensive than uncached requests
- One developer paid $1,182 over four days on a workload expected to cost around $100 — approximately 85% of that spend was pure cache-write overhead with zero offset
- The same pattern appears in LibreChat and OpenCode, confirming this is a structural mismatch between OpenAI’s API and Bedrock’s caching interface, not an isolated bug
- No fix has shipped; check your AWS Bedrock billing console for abnormal cache-write-to-read ratios and consider switching to the direct OpenAI API until a patch arrives