Cloudflare reports 68% lower AI code-review costs after caching and model changes
The internal review system's reported average cost fell to $0.77, but the comparison uses its most expensive weeks and does not establish unchanged defect detection.
By Benchdict AI DeskPublished Oct 20, 2026Updated Oct 22, 20264 min read

Cloudflare said on October 19 that it cut average inference costs for its internal AI code reviewer by 68%, from $2.43 to $0.77 per review, through code optimization and changes to models and reasoning effort.
Key facts
- Comparison baseline
- $2.43 average across the two most expensive pre-optimization weeks
- Optimized configuration
- $0.77 per review, assuming high effort for code-quality review
- Savings attribution
- Cloudflare attributes about 40% to reviewer-code optimization
- Quality limitation
- Finding counts and subsequent author edits do not establish defect-detection accuracy
A better cache-hit rate did not mean a smaller bill
Prompt caching reuses repeated context at a discounted token price, which is why a rising cache-hit rate would normally cut cost. Cloudflare's account describes a cost increase after it moved all reviewers to Anthropic models at the start of August. Its system uses a coordinator and specialist reviewers, rather than one monolithic reviewer. Even as the cache-hit rate rose, token consumption per review more than tripled, the company says.
Before optimization, Cloudflare attributed 43% of spending to cache writes, 34% to cache reads and 23% to output tokens. That breakdown makes the headline result more than a prompt-caching story: repeatedly consuming discounted context still contributed substantially to the bill.
OpenCode is the open-source coding agent that Cloudflare's reviewer runs on. The company identified a cache breakpoint in OpenCode v1 that bundled shared instructions with repository-specific environment information, preventing reuse across repositories. On September 16, it split the prompt into separately cacheable blocks. Reuse also required removing repository-specific content ahead of the shared prefix and keeping tool descriptions stable.
Code-quality, security and performance reviewers then shared an initial cached prefix. Cloudflare's implementation waits until the cache-writing response begins streaming before other reviewers attempt reuse, a requirement also described in Anthropic's documentation.

Code changes and model choices addressed different costs
Cloudflare attributes about 40% of savings to reviewer-code changes and the remainder to model and effort choices, while cautioning that its release-by-release attribution is not a statistically sound controlled experiment.
| Measure | Before | After |
|---|---|---|
| Average review cost | $2.43 in the two most expensive weeks | $0.77 with high-effort code-quality review |
| Internal standards reviewer calls | 15.9 per run | 9.6 per run |
| Internal standards reviewer cost | $1.12 per run | $0.72 per run |
All figures are Cloudflare's. The average-cost comparison is against a peak-period baseline, not a typical historical month.
In an initial Sonnet 5 versus Sonnet 5.5 comparison, Cloudflare reported per-run cost reductions of 62% for code-quality review, 58% for performance review and 47% for security review. These are internal comparisons, not independent measurements or a benchmark against competing providers.
The pricing explanation needs qualification. Cloudflare attributes those savings entirely to reduced token use at identical token prices. Anthropic's documentation, however, lists model-specific cache discounts. It specifies a five-minute cache-write multiplier of 1.25 times base input pricing and a cache-hit multiplier of 0.05 for Sonnet 5.5 and Opus 5.5. Which rates applied during the experiment is unconfirmed.
Who is affected—and what the savings do not show
For engineers receiving reviews, fewer model calls reduced waiting, according to Cloudflare. The company also stopped unnecessary selected specialist reviews on full-tier re-reviews and added status polling to stop canceled jobs.
For small teams operating similar systems, the relevant distinction is between repeated context, unnecessary execution and model-specific consumption—not simply caching versus routing. Anthropic documents a default five-minute cache lifetime refreshed on use, making request timing relevant alongside prefix stability and token volume.
Quality remains the unresolved trade-off. Cloudflare reports fewer serious findings, but the share followed by author edits rose from 34% to 59%, while findings leading to edits per 1,000 reviews stayed approximately unchanged. Its measure checks whether referenced lines changed on the next push; it does not establish whether real defects were missed.
Not yet confirmed
- The 68% savings claim has no independent corroboration in the available reporting; outside accounts describe the earlier review system.
- Preservation of real-defect and vulnerability detection is unconfirmed. The available primary-source excerpt ends during the quality discussion.
- Sample sizes, confidence intervals and long-term stability of the model and effort comparisons are not established.
- Historical or negotiated provider prices during the experiments are unavailable, leaving the cached-input pricing discrepancy unresolved.
- The exact reconciliation of Cloudflare's savings-attribution amounts is unexplained.
- Optimization-period review volume, total monthly savings and infrastructure-inclusive operating costs are not established.
What to watch
- A fuller quality assessment using labeled defects, false negatives or downstream defect rates.
- Clarification of the cache prices applied during the model comparisons.
- Longer-running cost and quality results beyond the initial comparison windows.
Sources
- Cutting our inference bill by 68% by being obsessive about optimizationCloudflare Blog, Oct 19, 2026.
- Prompt cachingClaude Platform Docs, Oct 20, 2026.
- OpenCodeOpenCode, Oct 22, 2026.
Benchdict AI Desk, AI-assisted reporting desk. Stories follow our editorial standards; corrections are logged above and on the corrections page.