Alex Getmanearly AI signals

Analysis · API pricing · 4 min read

AI API pricing: calculate the cost of a finished task

A worked budget for 10,000 requests, with cache and retry arithmetic you can reuse.

Alex GetmanPublished 31 Oct 2026

API cost calculator

Compare up to three text models on the same workload. Rates come from the current catalogue; results are estimates in USD.

Models to compare
ModelTotal, USDPer primary request, USDInput / output / cache, USD per 1M tokens
Claude Sonnet 4.6Anthropic · Rate checked 13.50000.0135003 / 15 / 0.3
Beam 1.0 501B A23BArtificial Analysis · Rate checked 1.40000.0014000.4 / 1.2 / 0.04
Claude Fable 5Anthropic · Rate checked 45.00000.04500010 / 50 / 1

Cost = requests × (1 + additional / 100) × [input × (1 − cache / 100) × input rate + input × cache / 100 × cache rate + output × output rate] / 1,000,000.

Additional requests use the same average token counts and cache share. Cache means reading an existing cache. Known input-length tiers apply to the whole prompt, including cached tokens. Taxes, cache writes and storage, tools, images, audio and batch discounts are excluded. A price comparison does not measure model quality; this is a scenario, not a benchmark.

A model's price per million tokens is the start of a budget. The useful comparison is the cost of finishing your task: input, output, cache writes and reads, extra calls, and retries. This page gives a reproducible calculation, with a dated provider example and a worksheet you can reuse.

Start with the workload

Write down the same workload for every candidate: requests per day, input tokens per request, output tokens per request, and the fraction of answers you accept. Count the system instructions, conversation history and tool results that you send again. A long conversation can make a small question expensive.

Use token counts from your actual requests. A word count is an approximation, and the approximation changes with language, code and the tokenizer. Keep an ordinary case and a large case: a budget based only on an average hides the expensive tail.

The calculation

For ordinary text requests without caching:

Cost = (input tokens × input price + output tokens × output price) ÷ 1,000,000.

Multiply this by the number of calls, including intermediate agent calls. For a monthly estimate, calculate the total tokens for the month rather than rounding each tiny request to cents.

Claude Sonnet 4.6's provider page lists $3 per million input tokens and $15 per million output tokens, checked on 31 October 2026. These are the direct API rates used below, not a chat subscription price.

Illustrative workloadInput / callOutput / callCost / call10,000 calls
Short reply2,0001,000$0.021$210
Document question20,0002,000$0.090$900
Large context200,0008,000$0.720$7,200

For the middle row: 20,000 × $3 / 1M = $0.06 of input; 2,000 × $15 / 1M = $0.03 of output. The $900 total is arithmetic for the stated workload, not a measurement of a real application's bill. Extra services, taxes and negotiated terms are outside it.

Separate cache hits from writes

A repeated prefix is useful only when the provider reports a cache hit. Anthropic's caching documentation describes prefix matching, expiry, and separate writes and reads. Its pricing table lists Sonnet 4.6 cache reads at $0.30/1M tokens and five-minute writes at $3.75/1M, checked on the same date.

Suppose 18,000 of the middle row's 20,000 input tokens are an eligible cached prefix. A warm hit costs 18,000 × $0.30 / 1M + 2,000 × $3 / 1M + 2,000 × $15 / 1M = $0.0414. Ten thousand such hits cost $414. A request that creates that five-minute cache instead costs $0.1035. Include misses, new writes and expiry before estimating a saving.

Compare completed results

Keep quality and cost in the same worksheet. For illustration, a $0.09 attempt with a 90% acceptance rate costs $0.10 per accepted result; a $0.06 attempt at 50% acceptance costs $0.12. This assumes independent retries with the same cost until success. Both rates are invented examples, not model benchmarks.

For a real comparison, run the same set of tasks, record every call and count accepted results using the same criteria. Report total spend divided by accepted results, alongside latency and failures. A model's name or a leaderboard position does not supply those measurements for your workflow.

Check the offer before choosing

Match the exact model version, provider and billing unit. Verify the rate for your context length and region, and any cache, batch or tool charges. Image, audio and video pricing can use different units; this text-token worksheet cannot compare them without conversion.

For coding tools, start with the Codex setup and usage guide, Claude Code setup and billing guide or Cursor plans and usage guide. The Codex, Claude Code and Cursor comparison adds subscription costs and human review time to the task budget; this API worksheet covers the token-billed part.

The live price table and model catalogue show facts observed by Signal Forge. Each model page links to its evidence. A missing price means it is unestablished in this catalogue, never zero. Use the Sonnet 4.6 card to compare this dated example with current observations, and the Claude timeline for related changes.

For another API workload, the Gemini 3.8 Flash guide gives acceptance checks and explains how to match a model to a provider offer. Record the provider and API identifier before comparing bills from different services.

To update this worksheet, replace the two rates, measured token totals, cache mix and acceptance counts. Keep the date and provider beside the numbers so another person can reproduce the comparison.