Read Claude usage fields, price a cache miss and run a controlled two-request check before changing your prompts or your API provider.
A CheapAI support report showed about 86,000 cache-write tokens followed by zero cache reads twelve seconds later. That observation leaves several possible causes. The useful first step is to reconstruct the bill and run a repeatable pair of requests.
Read the three input counters
In native Anthropic Messages usage, input_tokens measures ordinary input, cache_creation_input_tokens measures writes and cache_read_input_tokens measures reads. Values of 1,000, 4,000 and 80,000 add up to 85,000 input tokens. Multiply each bucket by its own rate and add output separately. In an OpenAI-compatible response, cached tokens may already be included in prompt_tokens.
Hold the prefix constant
Use a long public document that meets your model’s minimum cacheable length. Place cache_control at the end of the stable block. Send two requests close together with the same key, model, system message and tool definitions. Change only the short question after the block. Look for a write on the first call and reads on the second. Two documents of identical length can still have different prefixes.
If reads are still zero
Compare tool order, system instructions, timestamps and cache breakpoint placement. Move changing data after the stable text and check the cache lifetime. If the prefix matches, record both request IDs, UTC timestamps and usage fields. Support can use these to check routing and charges. Your repository contents are unnecessary for that initial check.
API pricing · Setup guide · Anthropic
- Codex Auto Review pricing: what does one pull request cost?
Estimate small, medium and large reviews at current CheapAI rates. Include the follow-up pass and compare the bill with findings your team can reproduce.
- Claude Fable API pricing for a 100k-token document
Price an initial Fable response and five follow-up questions. Separate uncached input, cache reads and output and check the exact model version.
- Opus vs Sonnet for coding: when does the higher price pay off?
Compare cost per accepted patch, include failed runs and calculate a break-even point before choosing a Claude model for your repository.
- Codex 401 with a custom API key: check the host before buying credits
Diagnose invalid_api_key with the request URL, a catalog check and three provider settings. Keep the key out of terminal output and support tickets.
- Do Russian prompts cost more than English? Measure your own API tokens
Run a paired Claude token-count test, keep the code and tools fixed, then convert the difference to dollars before changing your team’s working language.
- An AI stream ended after HTTP 200. Did the response finish?
Inspect the final stream event, distinguish an output limit from a disconnect, and decide whether retrying a tool call could duplicate work.
- What can a pelican SVG tell you about a coding model?
Evaluate rendering, instruction following and animation separately. Then compare the result with a reproducible patch in your own repository.
- How much does a Codex coding task cost through the API?
Estimate the cost of one bug fix and a batch of twenty using live API rates. Compare models by the cost of a passing patch, including retries.
- How to check Gemini input token counts on long requests
Compare countTokens with usageMetadata on the same Gemini payload. Isolate chat history, tools, cached input and multilingual text before disputing a bill.