HaiAI123

Curated Global AI Tools Directory

Industry update
25
heat index
Flat

OpenAI and Anthropic count cached tokens in opposite ways

11/30/2026 — 11/30, 17:22·1 sources (all)·1 reports (all)

Key takeaways

  • A technical analysis compares how OpenAI and Anthropic report cached tokens for the same 2,048-token prompt with a cache hit. OpenAI returns…

Background & analysis

On November 30, 2026, a DEV Community post examined how OpenAI and Anthropic report cached tokens in their API usage objects, finding that the two companies take opposite approaches. The author sent the same 2,048-token prompt to both providers, with most of it served from the prompt cache, and compared the usage data returned. OpenAI reported prompt_tokens = 2048, with prompt_tokens_details.cached_tokens = 1792. Anthropic reported input_tokens = 256, with cache_read_input_tokens = 1792. Same prompt, same cache hit, yet the headline input figures differed by a factor of eight.

According to the post, neither provider is wrong. They simply record cached tokens in different places: OpenAI counts cached tokens inside prompt_tokens, while Anthropic lists cache reads separately and lets input_tokens reflect only the uncached portion. To help developers reconcile the two, the author provided a small function that converts both usage formats into a single structure, and also listed the most common billing and usage-tracking mistakes. As of that report, the matter remained a developer-level explanation of the differing conventions and a conversion method; the material contains no official response from either company.

AI-generated from 1 reports · updated 5 days ago

updream
24-hour heatHeat index 25
Just charted — trend is building up
24 hours agonow

Reports on this story headlines open the original

Nov 30
  1. Send the same 2,048-token prompt with the same cache hit to both providers and the headline input counts differ 8x: OpenAI reports prompt_tokens = 2048 with 1792 cached, Anthropic reports input_tokens = 256 with 1792 cache reads. The post shows where each vendor records cached tokens, offers a small function that normalizes both, and lists the billing and usage-tracking mistakes that follow from reading a single field.

    DEV Community · AIAI score 64

Other stories people are talking about

How is heat calculated?About the method

Heat counts how many independent sources covered a story in the last 48 hours: one source counts once no matter how many posts it published, decaying with a 24-hour half-life. What ranks first is what many people are talking about.

This page aggregates public feeds. Headlines and summaries are machine-organized and remain the property of the original authors; verify important facts at the source. If you believe a headline or summary infringes your rights, email the contact address in the footer with the page URL and basis of your claim, and we will remove or replace it after review.

Surge
Discussion rising fast
New
First report within 6 hours
Rising
Still gathering discussion

Back to AI industry updates →