Cloudflare has added cache-read and cache-write token rates to AI Gateway’s custom cost accounting, a small changelog item with large billing consequences for teams that resell, route or reconcile model usage across providers.

The September 9 update means developers can now pass per_cache_read_token and per_cache_write_token values in the cf-aig-custom-cost header. When either cache-specific rate is present, Cloudflare says AI Gateway activates cache-token pricing and accounts for provider differences so the same cache usage is not counted twice.

That sounds narrow. It is not. Cache pricing has become one of the harder parts of unified AI API billing, especially as providers use different names, units and billing rules for reused context. Treating every cached token as a normal input token may be simple, but it can be wrong enough to erase reseller margin or mislead customers about which workloads are actually expensive.

What changed

AI Gateway already allowed custom cost data to be attached to requests, giving teams a way to represent negotiated rates or internal price books instead of relying only on public provider pricing. The new change extends that mechanism to cache-specific token categories.

In practice, a gateway operator can now tell Cloudflare not only what an input or output token costs, but what a cache read or cache write costs. That distinction matters because providers increasingly price prompt caching as its own economic layer. A cache write may cost more than a cache read. A cache read may be dramatically cheaper than fresh input. Some providers may expose cache creation and cache retrieval differently in usage records.

Cloudflare’s note that it handles provider differences to avoid double-counting is also important. Cache fields are not always cleanly separated from input-token totals. If a billing system naively adds cache tokens on top of provider-reported input usage, it can overcharge customers or inflate internal cost. If it ignores cache fields, it can understate the cost of long-context applications that frequently create cache entries.

Why cache accounting now matters

Prompt caching used to be an optimization detail. For many production workloads, it is now part of the price architecture.

Long system prompts, retrieval-augmented context, coding-agent repositories, legal document packs and support knowledge bases all benefit from reusing context. The more repeated context a system sends, the more cache pricing changes the real unit economics. Two requests with similar token counts can have very different costs if one is writing a cache entry and another is reading from it.

That makes cache visibility a finance issue, not just an engineering issue. A team running internal agents may need to know whether a new workflow is expensive because it generates too many fresh prompts, misses the cache, or writes large cache blocks too often. A reseller may need to show customers why one application’s billed usage is lower than expected even though its apparent prompt size is large. A gateway vendor may need to preserve cache fields in logs, analytics and ledger records so month-end reconciliation matches provider invoices.

This is also where AI API cost analytics becomes more demanding. Aggregate request cost is no longer enough. Teams need to see input, output, cache write and cache read behavior separately, then connect those categories to API keys, customers, models and routes.

Who is affected

The immediate audience is Cloudflare AI Gateway users who rely on custom costs rather than default public pricing. That includes enterprises with negotiated model rates, platforms that mark up provider usage for customers, and teams that use Cloudflare as a shared control plane across multiple model providers.

Resellers are especially exposed. If a reseller charges customers using a simplified token model while paying providers under cache-aware pricing, the difference can quietly accumulate. Undercharging cache writes or overcharging cache reads may not show up in a single request, but it can matter across agent sessions, batch processing or high-volume retrieval workloads.

Developers building OpenAI-compatible gateway layers are affected even when they do not use Cloudflare directly. The change reflects a broader direction in the market: provider billing surfaces are becoming more granular, while customers still expect a clean invoice and predictable usage reports. Products such as Model Gate need to treat cache token fields as first-class ledger data if they want accurate customer-scoped reporting, usage limits and margin analysis across multiple providers.

Practical consequences

Gateway teams should review how their request logs, cost calculators and invoices represent cache activity. If cache reads and writes are flattened into ordinary prompt tokens, analytics may look simpler than the underlying bill. If provider usage records contain cache fields that are dropped during ingestion, later reconciliation will be difficult.

Pricing engines also need to support more than one rate per direction. The old input-versus-output split is no longer enough for advanced model accounting. A credible model ledger now needs room for fresh input tokens, output tokens, cache writes, cache reads and possibly provider-specific variants of those categories.

Customer-facing dashboards should expose these distinctions carefully. Most users do not want to read raw provider telemetry, but they do need to understand why costs change when an application starts reusing context more effectively. The best interface may be a cost breakdown that shows cache savings and cache creation costs without forcing customers to learn every provider’s terminology.

There are also operational implications for alerts and limits. A customer budget limit based only on total tokens may fail to catch a workload that writes expensive cache entries. A margin alert based only on request count may miss a provider pricing mismatch. For teams selling access through per-customer keys, cache-aware accounting should be tied back to the same customer, project or application identifiers used for spend controls.

What remains open

The changelog establishes support for cache-read and cache-write custom rates, but it does not settle every implementation question for gateway operators. Teams still need to test how their specific providers report cache usage, how Cloudflare’s calculated costs appear in logs and exports, and how existing invoices should be compared with the new custom-cost fields.

The larger direction is clear, though. AI gateway billing is moving from a simple token meter toward a detailed usage ledger. Cache pricing is now part of that ledger. Teams that preserve the detail will have cleaner reconciliation and better customer analytics. Teams that collapse it away may not notice the problem until their provider bill and customer invoice stop telling the same story.