TL;DR: at a realistic production request size of ~4,700 input and ~390 output tokens, one AI API call costs anywhere from $0.0004 to $0.035 across the standard model tiers — a 90× spread driven purely by model choice, rising to $0.21 on a pro tier.
- Output tokens cost 5–8× input tokens almost everywhere, so response length moves your bill more than prompt length.
- "Chinese model" does not mean "cheap". Kimi K3 lists at $3 / $15 per million — the same per-call cost as Claude Sonnet 5 at standard pricing.
- Prices move in both directions. Since this article first ran, Google halved Gemini 3.6 Flash and DeepSeek roughly tripled V4 Flash — the change log below tracks both.
- If you resell AI as credits, charge from actual token usage. A flat price per request always undercharges your largest requests.
/ The unit
What does a single AI API call actually cost?
Multiply your input tokens by the model's input rate, your output tokens by its output rate, and add them. That is the whole formula — every provider on this page bills per million tokens in exactly that shape:
cost = (input_tokens × input_rate + output_tokens × output_rate) / 1,000,000
Worked through on Gemini 3.6 Flash, which lists at $0.75 per million input and $3.75 per million output on its promotional rate, for a call of 4,700 input and 390 output tokens:
- input — 4,700 × $0.75 ÷ 1,000,000 = $0.00353
- output — 390 × $3.75 ÷ 1,000,000 = $0.00146
- total — $0.00499, the $0.0050 you will see in the table below
Ten thousand of those calls is $49.88. A million is $4,988. That is the entire economics of an AI feature, and it is worth doing this arithmetic once by hand before trusting any dashboard. If you would rather drag a slider than reach for a calculator, every figure on this page is live in the LLM API cost calculator.
What makes the number hard to predict is not the arithmetic, it is knowing your real token size. Measured request sizes are almost always different from the ones people assume when they estimate. Every figure on this page uses one fixed reference call — 4,700 input tokens and 390 output tokens — which is typical of a planning or tool-calling request: a substantial system prompt plus tool schemas going in, a short structured decision coming back. Scale the results linearly for your own workload, and expect real traffic to run 1.5–2× larger than a thin test sample.
That asymmetry — a fat prompt and a thin response — matters, because it is the opposite of a chat workload. If your calls generate long prose answers instead, the output-rate column below dominates and the ranking changes.
/ The majors
How much do the major providers charge per million tokens?
Here are the current published rates for the standard (non-batch, non-cached) tiers at each of the three largest Western providers, with the per-call cost worked out at the reference size above. Premium and pro tiers are a separate table further down. All rates verified against provider documentation on 21 August 2026.¹
| Provider | Model | Input / 1M | Output / 1M | Per call |
|---|---|---|---|---|
| OpenAI | gpt-5-nano | $0.05 | $0.40 | $0.0004 |
| OpenAI | gpt-5.6-luna | $0.20 | $1.20 | $0.0014 |
| OpenAI | gpt-5.4-nano | $0.20 | $1.25 | $0.0014 |
| OpenAI | gpt-5-mini | $0.25 | $2.00 | $0.0020 |
| OpenAI | gpt-5.4-mini | $0.75 | $4.50 | $0.0053 |
| OpenAI | gpt-5 / gpt-5.1 | $1.25 | $10.00 | $0.0098 |
| OpenAI | gpt-5.2 | $1.75 | $14.00 | $0.0137 |
| OpenAI | gpt-5.6-terra | $2.00 | $12.00 | $0.0141 |
| OpenAI | gpt-5.4 | $2.50 | $15.00 | $0.0176 |
| OpenAI | gpt-5.6-sol | $4.00 | $20.00 | $0.0266 |
| OpenAI | gpt-5.5 | $5.00 | $30.00 | $0.0352 |
Gemini 3.1 Flash-Lite | $0.25 | $1.50 | $0.0018 | |
Gemini 3.5 Flash-Lite | $0.30 | $2.50 | $0.0024 | |
Gemini 3.6 / 3.7 / 3.8 Flash (promo) | $0.75 | $3.75 | $0.0050 | |
Gemini 3.6 / 3.7 / 3.8 Flash (from 1 Jan 2027) | $1.50 | $7.50 | $0.0100 | |
Gemini 3.5 Flash | $1.50 | $9.00 | $0.0106 | |
Gemini 3.1 Pro (preview) | $2.00 | $12.00 | $0.0141 | |
| Anthropic | Claude Haiku 4.5 | $1.00 | $5.00 | $0.0067 |
| Anthropic | Claude Sonnet 5 | $2.00 | $10.00 | $0.0133 |
| Anthropic | Claude Opus 5 | $5.00 | $25.00 | $0.0333 |
Three things stand out. First, the budget tier is genuinely cheap: gpt-5-nano at $0.0004 per call is 13× cheaper than Gemini 3.6 Flash and 85× cheaper than Opus 5, for a task that may not need frontier reasoning at all. Second, the "flash" and "mini" labels are not a reliable guide to price. Gemini 3.5 Flash costs $0.0106 per call — more than Claude Haiku 4.5 at $0.0067, and 5× more than gpt-5-mini, despite all three sitting in the same nominal tier.
Third, and least intuitive: a higher generation number does not mean a higher price. gpt-5.6-luna costs $0.0014 per call, roughly a tenth of the older gpt-5.2 at $0.0137 — while gpt-5.4-mini at $0.0053 costs 2.7× its gpt-5-mini predecessor. Within a single vendor's line-up the suffix is a product-positioning label, not a rung on a price ladder. The only reliable ordering is the one you compute yourself.
Note the moving targets in that table. Anthropic's published pricing billed Claude Sonnet 5's $2 / $10 as introductory through 31 August 2026, with $3 / $15 to follow — then cancelled the increase on 1 September and made $2 / $10 the standard rate, so that row is no longer a trap. Google's Gemini pricing still is: 3.6, 3.7 and the new 3.8 Flash hold $0.75 / $3.75 only through 31 December 2026 and double to $1.50 / $7.50 on 1 January 2027. OpenAI has joined in, calling gpt-5.6-sol's $4 / $20 promotional "at least through November 21, 2026" with no successor rate published. Budget against an intro rate and your per-call cost rises on a date you did not choose.
/ Premium tiers
What about the premium and pro models?
They exist, and they are priced in a different league. The table above deliberately covers the standard tiers — the models you would realistically put behind a per-request product feature. Each provider also publishes a premium line above them:
| Provider | Model | Input / 1M | Output / 1M | Per call |
|---|---|---|---|---|
| Anthropic | Claude Fable 5 / Fable 5.1 | $10.00 | $50.00 | $0.0665 |
| Anthropic | Claude Mythos 5 / Mythos 5.1 (limited availability) | $10.00 | $50.00 | $0.0665 |
| OpenAI | gpt-6-astra | $10.00 | $50.00 | $0.0665 |
| OpenAI | gpt-5-pro | $15.00 | $120.00 | $0.1173 |
| OpenAI | gpt-5.2-pro | $21.00 | $168.00 | $0.1642 |
| OpenAI | gpt-5.4-pro / gpt-5.5-pro | $30.00 | $180.00 | $0.2112 |
Read those per-call figures against the standard table and the gap is stark: $0.2112 ÷ $0.0004 means gpt-5.5-pro costs 540× what gpt-5-nano costs for the same request, and $0.2112 ÷ $0.0050 puts it at 42× Gemini 3.6 Flash. Ten thousand calls: $4 on nano, $50 on Flash, $2,112 on pro. Anthropic's Fable line — Fable 5 and the newer Fable 5.1 — and OpenAI's new gpt-6-astra all sit lower, at $0.0665: double Opus 5 and about twice the top of the standard table.
Nothing here says these models are overpriced; a task that genuinely needs them is a task the cheap tiers will fail at, and one correct answer beats twenty wrong ones. But they are a poor fit for a metered, per-request feature — at $0.21 a call, a thousand requests is $211, which reprices your product rather than your infrastructure. Reserve them for low-volume, high-stakes steps and route the routine work elsewhere.
/ Chinese models
Are Chinese models the cheap option — and where does Kimi K3 land?
Some are dramatically cheaper. Kimi K3 is not one of them. The assumption that a Chinese lab automatically means budget pricing breaks down as soon as you read the published rate cards side by side:
| Provider | Model | Input / 1M | Cached input | Output / 1M | Per call |
|---|---|---|---|---|---|
| Moonshot | Kimi K3 | $3.00 | $0.30 | $15.00 | $0.0200 |
| Moonshot | Kimi K2.6 | $0.95 | $0.16 | $4.00 | $0.0060 |
| DeepSeek | deepseek-flash (was V4 Flash) | $0.30 | $0.006 | $1.20 | $0.0019 |
| DeepSeek | deepseek-v4-pro | $1.32 | $0.044 | $3.96 | $0.0077 |
| Z.ai | GLM-4.7-FlashX | $0.07 | $0.01 | $0.40 | $0.0005 |
| Z.ai | GLM-5.3-Flash | $0.15 | $0.03 | $0.50 | $0.0009 |
| Z.ai | GLM-4.7 | $0.60 | $0.11 | $2.20 | $0.0037 |
| Z.ai | GLM-5.2 / GLM-5.3 | $1.40 | $0.26 | $4.40 | $0.0083 |
Moonshot prices Kimi K3 at $3.00 per million input tokens on a cache miss, $0.30 on a cache hit, and $15.00 per million output tokens, across a 1,048,576-token context window. At the reference call size that is (4,700 × $3 + 390 × $15) ÷ 1,000,000 = $0.01995 — half as much again as Claude Sonnet 5 at $0.0133, and four times Gemini 3.6 Flash at its promotional rate. Against deepseek-flash's $0.00188, that is 10.6× the cost of the same call: 10,000 requests is $200 on K3 and $18.78 on DeepSeek. Moonshot's own budget option, Kimi K2.6 at $0.95 / $4.00, lands at $0.0060. K3 is positioned as a frontier model and priced like one.
Kimi K3 costs half as much again as Claude Sonnet 5 per call. GLM-5.3-Flash costs 22× less than K3. "Chinese model" is not a pricing tier. — per-call arithmetic at 4,700 in / 390 out
At the other end, DeepSeek has repriced again: V4 Flash is now listed as deepseek-flash at $0.30 input / $1.20 output at its peak rate, which works out to $0.0019 per call — down from the $0.0026 it charged in August, though still above the $0.0008 of July. DeepSeek is also the one provider here that prices by the clock: those are peak rates, charged 01:00–04:00 and 06:00–10:00 UTC on weekdays; every other hour, weekends included, bills at half. Its cache-hit input rate of $0.006 per million is the most aggressive discount on this page, 50× below its own cache-miss rate. Z.ai's GLM line now spans the budget range on its own, from GLM-4.7-FlashX at $0.07 / $0.40 and the new GLM-5.3-Flash at $0.15 / $0.50 up to GLM-5.3 at $1.40 / $4.40, with GLM-4.7-Flash listed at no cost at all.
The practical lesson is that provider nationality tells you nothing about price. Read the rate card, compute your own per-call number, and rank by that.
/ Output weight
Why does output pricing dominate the bill?
Because every provider charges several times more for tokens the model writes than for tokens you send. The ratio is remarkably consistent:
- 6–8× — OpenAI: 8× across
gpt-5,gpt-5.1andgpt-5.2, and 5–6× on the newergpt-5.4andgpt-5.6models. - 5× — Anthropic across Haiku, Sonnet and Opus, Google's Gemini 3.6 and 3.7 Flash, and Moonshot's Kimi K3.
- 3–4× — DeepSeek: 3× on V4 Pro, 4× on the renamed deepseek-flash.
- 3.1–3.3× — Z.ai's GLM-5.2, GLM-5.3 and GLM-5.3-Flash, the flattest ratios of the group.
Run the reference call through that lens. Output is 390 of 5,090 total tokens — 7.7% of the volume. But on Gemini 3.6 Flash it is $0.00146 of a $0.00499 bill, or 29% of the money. Those 390 tokens cost nearly four times what their share of the token count suggests. Double the response to 780 tokens and the call goes to $0.00645, up 29%; double the prompt to 9,400 tokens instead and it goes to $0.00851, up 71% — but you had to add 4,700 tokens to do it, twelve times as many as the output change. Trimming a verbose system prompt feels productive; capping max_output_tokens and asking for terse structured output usually saves more.
Reasoning models complicate this further, because reasoning tokens are billed as output. A model that always thinks before answering can spend more on the invisible trace than on the visible reply — the same behaviour that makes reasoning models good at planning tasks is what makes their bills volatile. If you route a planning step to a reasoning model, measure the output-token distribution, not just the mean.
/ Caching
How much does prompt caching change the math?
Substantially, if your prompt has a large stable prefix. Cached input is billed at a fraction of the normal input rate, so a long system prompt and tool schema block — exactly the shape of an agent request — can be reused across calls almost for free.
| Provider | Cache-hit input rate | Relative to base input |
|---|---|---|
OpenAI (gpt-5-nano – gpt-6-astra) | $0.005 – $1.00 / 1M | 0.1× |
| Google (Gemini 3.x) | $0.025 – $0.20 / 1M | 0.1× |
| Anthropic | $0.10 – $1.00 / 1M | 0.1× (0.025× on Fable 5.1 and Mythos 5.1) |
| Moonshot (Kimi K2.6 / K3) | $0.16 – $0.30 / 1M | 0.1–0.17× |
| Z.ai (GLM line) | $0.01 – $0.26 / 1M | 0.15–0.2× |
| DeepSeek | $0.006 – $0.044 / 1M | 0.02–0.03× |
Anthropic also charges a write premium — 1.25× base input for a five-minute cache, 2× for a one-hour cache — which means caching pays for itself after a single read on the short TTL, or two reads on the long one. Work it through on Sonnet 5 ($2 in / $10 out, cache hits at $0.20), assuming 4,000 of the 4,700 input tokens are a cacheable prefix:
- cached input — 4,000 × $0.20 ÷ 1,000,000 = $0.0008
- fresh input — 700 × $2.00 ÷ 1,000,000 = $0.0014
- output — 390 × $10.00 ÷ 1,000,000 = $0.0039
- total — $0.0061, against $0.0133 uncached
That is a 54% cut with no quality trade-off — better than dropping from Sonnet 5 to Haiku 4.5 ($0.0067), and you keep the stronger model.
Batch APIs are the other lever: Anthropic and OpenAI both discount asynchronous batch processing by 50%, and Google does the same. If the work is not interactive — nightly enrichment, bulk classification, backfills — half your bill is available for the cost of queueing the job. That is a natural fit for any system that already runs work through a background job queue.
/ Reselling
What goes wrong when you resell AI calls as flat-price credits?
You lose money on exactly the requests that cost you the most. A flat "one request = N credits" price is a fixed charge over a variable cost, so it overcharges small calls and undercharges large ones — and large calls are precisely what heavy users make.
Work the numbers on a hypothetical plan: a $249/year tier with a 5,000-credit monthly pool, charging 7 credits per request. That pool buys 8,571 requests a year. At $0.010 per call the provider bill is $86; at a realistic build size of $0.015 it is $129. Comfortable. Now scale the same structure up to a $649/year tier with a 30,000-credit pool: 51,429 requests a year, costing $514 to $771. The margin has narrowed from 65% to somewhere between 21% and a loss, without anything changing except the size of the pool.
The leak is not the pool size, it is that the charge does not move with the request. A user whose prompts are three times larger than average pays exactly the same as one whose prompts are tiny.
| Concern | Flat price per request | Charge from actual tokens |
|---|---|---|
| Large requests | Undercharged — the loss tail | Cost proportionally more credits |
| Small requests | Overcharged — feels unfair | Cost less, down to a floor |
| Margin per credit | Varies with request size | Constant regardless of mix |
| Model swap | Requires re-pricing every tier | Only the $/credit backing changes |
| Failed provider call | Pre-charged, needs a refund path | Charged after success — nothing to refund |
Seeing it run beats reading about it. The live preview boots a throwaway WordPress with Webhook Actions already installed and demo deliveries sitting in the log — no signup, nothing left on your machine afterwards.
/ Token-linked credits
How do you make credits track actual cost?
Compute the charge from the token counts the provider returns, using a weight that mirrors that model's own output-to-input price ratio. Two constants per tier are enough:
PHP — token-linked credit charge
// Weight output tokens by the model's own output/input price ratio. // Gemini 3.6 Flash: $0.75 in / $3.75 out -> weight 5. $weighted = $usage['input_tokens'] + 5 * $usage['output_tokens']; // 1 credit = 1,000 weighted tokens, minimum 1 credit per call. $credits = max( 1, (int) ceil( $weighted / 1000 ) ); // Reference call: 4700 + 5 * 390 = 6650 weighted -> 7 credits.
The weight is the whole trick. When output_weight equals the provider's output/input price ratio, one credit maps to a fixed dollar amount of provider cost for any input/output mix. On Gemini 3.6 Flash at weight 5 and 1,000 weighted tokens per credit, one credit is always about $0.00075 of API spend — whether the call was a fat prompt with a one-word answer or a short prompt with a long essay.
Two details make this safe in production. Charge after the provider call, not before: a failed request then costs the user nothing and there is no refund path to build. And gate on balance before the call rather than trying to predict the charge — check that the remaining pool is above zero, let the request through, then settle the real cost. The maximum you can overshoot is bounded by your own input and output caps, so a hard max_output_tokens is what keeps the tail finite.
A model with a different ratio just needs a different weight. Swapping to a provider whose output costs 8× input means weight 8; swapping to DeepSeek V4 Pro means weight 3, to deepseek-flash weight 4. The cost calculator works the credit charge out for any model and token size, so you can see what one credit is actually backing before you publish a price. Because credits are charged from real usage, changing models changes what a credit costs you, not whether the pricing structure still holds.
/ In production
What should you actually measure?
Per-call token counts, from day one. Almost every cost surprise traces back to a team that estimated token size instead of logging it. Concretely:
- Log
input_tokensandoutput_tokenson every call, alongside the model name. Without the model name, a later price change makes the history unreadable. - Watch the distribution, not the mean. The 95th-percentile request is what determines your worst case; a mean hides the reasoning traces that ran ten times longer than usual.
- Bound the tail explicitly. Cap input length and set
max_output_tokens. Those two limits are the only hard ceiling on what one call can cost you. - Model the 100%-utilisation case. If every customer consumed every credit they paid for, would each tier still be profitable? Typical usage is far below that, but the ceiling is what a single heavy account can reach.
- Re-check rate cards quarterly. Introductory pricing expires, new tiers land below old ones, and a model you chose on price six months ago may no longer be the cheap option.
/ Price changes
What has actually changed since this article ran?
Enough to matter, in six weeks. This is the log of every rate movement we have re-verified against provider documentation since first publishing on 29 July 2026 — recorded on the day we caught it, not the day the provider changed it. The percentage is the move in the cost of the reference call, not in the headline rate.
| Provider | Model | Was | Now | Per-call change |
|---|---|---|---|---|
| Anthropic | Claude Sonnet 5 | $3.00 / $15.00 | $2.00 / $10.00 | -33% |
| Anthropic | Claude Fable 5.1 | — | $10.00 / $50.00 | new |
| Anthropic | Claude Mythos 5.1 | — | $10.00 / $50.00 | new |
| OpenAI | gpt-6-astra | — | $10.00 / $50.00 | new |
Gemini 3.8 Flash | — | $0.75 / $3.75 | new | |
| DeepSeek | deepseek-flash (was deepseek-v4-flash) | $0.44 / $1.32 | $0.30 / $1.20 | -27% |
| Z.ai | GLM-5.3-Flash | — | $0.15 / $0.50 | new |
| Moonshot | Kimi K2.6 | — | $0.95 / $4.00 | new |
| OpenAI | gpt-5.6-luna | $1.00 / $6.00 | $0.20 / $1.20 | -80% |
| OpenAI | gpt-5.6-terra | $2.50 / $15.00 | $2.00 / $12.00 | -20% |
| OpenAI | gpt-5.6-sol | $5.00 / $30.00 | $4.00 / $20.00 | -24% |
Gemini 3.6 Flash | $1.50 / $7.50 | $0.75 / $3.75 | -50% | |
Gemini 3.7 Flash | — | $0.75 / $3.75 | new | |
| DeepSeek | deepseek-v4-flash | $0.14 / $0.28 | $0.44 / $1.32 | +237% |
| DeepSeek | deepseek-v4-pro | $0.435 / $0.87 | $1.32 / $3.96 | +225% |
| Z.ai | GLM-5.3 | — | $1.40 / $4.40 | new |
Three of those deserve reading twice. Anthropic cancelled the Sonnet 5 increase: the $2 / $10 rate billed as introductory through 31 August is now the standard price, and the $3 / $15 successor this article budgeted against never arrived — the first entry in the log where a published schedule moved the price down relative to plan. DeepSeek keeps moving: after tripling V4 Flash into peak and off-peak tiers in August, it renamed the model deepseek-flash and cut it to $0.30 / $1.20 in September. Anyone who picked it in July at $0.0008 a call, watched it hit $0.0026, and is now at $0.0019 has had three different bills for the same code. And Google halved Gemini 3.6 Flash in August, then launched 3.7 and 3.8 Flash at the same rate — all promotional through 31 December 2026 and doubling on 1 January 2027 — while newly publishing a flat cache-read rate for every Gemini model, which is why the calculator's cache slider now works there too. Smaller moves: gpt-6-astra and Claude Fable 5.1 arrived at the $10 / $50 tier, GLM-5.3-Flash arrived at $0.15 / $0.50, and GLM-5-Turbo dropped off Z.ai's rate card and off the calculator with it.
That is the practical argument for logging the model name alongside token counts, as item 1 above says. A price change is invisible in your own telemetry unless you can join spend to model and date. If you want an automated tripwire rather than a calendar reminder, the open datasets at simonw/llm-prices and pydantic/genai-prices both carry dated historical rates you can diff on a schedule — then confirm any hit against the provider's own page before you act on it.
None of this requires a sophisticated billing system. It requires that the number you charge and the number you are charged come from the same measurement. Once those are linked, model selection becomes a quality decision with a known cost consequence — which is the position you want to be in before you wire an AI step into an agent architecture that runs on live traffic.