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.
Ask Codex to fix a failing test and the session may look like a single job. Reading the file, applying a patch and inspecting the test output can each start another model call. The price of a million tokens only becomes useful once you know what went into the whole job.
Price a three-turn patch
Suppose the first turn uses 6,000 input and 600 output tokens. After a file read, the second uses 9,000 and 900. The test output makes the last turn 12,000 in and 500 out. Total usage is 27,000 input and 2,000 output tokens. At rates quoted per million, the cost in dollars is 0.027 × the input rate + 0.002 × the output rate, assuming uncached input.
For example, at hypothetical rates of $1 per million input and $5 per million output, one patch costs $0.037 and twenty cost $0.74.
Twenty patches with this profile use 540,000 input and 40,000 output tokens. The figures below apply the current catalog rates to that example. Your agent may take more or fewer turns.
Compare two models on your own repository
Pick a bug with a reproducible failing test. Start each model from the same revision in a fresh session. Record the total charge through the first passing test, the number of calls and whether the patch passes review. A second or third attempt can erase the savings from a lower output rate.
Turn the experiment into a monthly budget
Separate quick edits, debugging sessions and larger changes. Multiply the average cost of a completed job in each group by its monthly volume. Include abandoned runs. If usage breaks out cached input, price that portion at the cache-read rate. Reasoning tokens already included in output count once.
API pricing · Setup guide · OpenAI Codex
- 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.
- Claude wrote the prompt cache. Why did the next request read zero?
Read Claude usage fields, price a cache miss and run a controlled two-request check before changing your prompts or your API provider.
- 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.