How much does an AI API actually cost?

Last updated August 25, 2026

AI APIs are metered by the token. The published rate is easy to find and tells you surprisingly little about what you will actually pay, because the thing that drives a bill is not the price per token but how many times the same text gets sent.

How the meter works

Providers quote prices per million tokens, split into input and output.

Input is everything you send: the system prompt, the conversation history, any files or tool results included in the request. Output is everything the model generates in reply.

Output is priced higher, generally four to five times higher, for a mechanical reason. Input can be processed across the whole prompt in parallel. Output has to be produced serially, one token at a time, each one conditioned on the ones before it, which ties up the hardware for longer per token.

The 2026 spread inside a single provider is wider than the spread between providers. Anthropic’s Fable 5 sat at $50 per million output tokens, while Claude Opus 5, released July 25, 2026, delivered results within 0.5 percent of it on FrontierBench at $25, half the price and the same as the older Opus 4.8. Ramp spend data cited in August put Fable 5 at just 11 percent of business spend on Anthropic models, which is what a two-to-one price gap does when the capability gap is small.

Why the sticker price mispredicts the bill

Three multipliers sit between the rate card and the invoice.

History resending. In a conversation the accumulated history is sent again with every turn. In an agent loop it is worse: at each step the harness resends the full transcript including all previous tool calls and their results, so the model can decide what to do next. One 2026 analysis found this effectively billed a single task about fifteen times. Cost therefore grows with the square of a task’s length, not with its length.

Reasoning tokens. Models that think before answering generate tokens you never see and are billed for at output rates. The same model at maximum effort settings can cost several times what it costs at default settings, while scoring a few points higher. Any benchmark comparison that does not state the effort setting is also not stating the price.

Retries and tool calls. Failed tool calls, malformed outputs and retries all bill. In real agent runs these are a large share of the total, which is why prompt-shortening produces less saving than expected. One technique tested against 86 real agentic coding tasks measured only 8.5 percent savings, because the run was dominated by tool calls and resent history rather than by the wording of the instruction.

What real work costs

The published numbers from 2026 span four orders of magnitude, and the spread is instructive.

At the low end, an AI agent site served 12.55 million requests over two weeks for $5.66, because the work per request was trivial. An AI persona ran on TikTok for a week for about $100.

In the middle sits ordinary agentic coding. One benchmark measured Claude Opus 5 at $2.34 per completed task at the top of its accuracy index. That is the number to reason from for day-to-day development work.

At the high end, a single prompt asking for a 3D racing game consumed $423 in tokens, and Amazon reportedly burned $1.8 million on one Claude project. Neither is anomalous. Both are what happens when an open-ended task runs long and the history keeps growing.

The lesson is that per-task cost, not per-token price, is the number worth measuring. Two providers within 20 percent of each other on the rate card can differ several-fold on a real workload depending on how verbose they are and how many steps they take.

Prices move faster than budgets

2026 offered a clean demonstration that this is not a market you can plan a year around.

OpenAI cut GPT-5.6 Luna prices by 80 percent on July 31, then cut Sol API and credit pricing by more than 20 percent on August 24, explicitly for a three-month window. DeepSeek went the other way: after V4-Flash improved Terminal Bench 2.1 scores from 61.8 to 82.7 at unchanged prices on July 31, the company shipped V4 Pro on August 14 and raised API prices up to twelvefold, introducing peak-hour billing.

Two structural pressures sit underneath. Downward, competition and efficiency gains, including open-weight models that can be self-hosted and remove the per-token bill entirely at the cost of running the hardware. Upward, the physical inputs: memory prices rose sharply through 2026, and power and data center capacity are the binding constraint on serving.

For anyone budgeting, the durable advice is to measure cost per completed task on your own workload, re-measure after every model change, and treat a promotional rate with an end date as exactly that.

Quick answers

How is AI API pricing calculated?

By the token, with input and output priced separately and quoted per million tokens. Output costs substantially more than input, typically four to five times. A request is billed for everything sent, which in a conversation means the whole history each time, plus everything generated in reply.

Why is output more expensive than input?

Input can be processed in parallel across the whole prompt, while output has to be generated one token at a time, each conditioned on the last. That serial generation occupies the hardware for longer per token, and the pricing reflects it.

What does a real task cost?

Far more than a single exchange suggests. One 2026 benchmark measured Claude Opus 5 at $2.34 per completed coding task at leading accuracy. A single prompt that produced a playable 3D racing game consumed $423 in tokens. An AI persona run on TikTok for a week cost about $100. Amazon reportedly burned $1.8 million on one Claude project.

Are AI API prices going up or down?

Both, and fast. In 2026 OpenAI cut GPT-5.6 Luna prices by 80 percent on July 31 and Sol pricing by over 20 percent on August 24 for a three-month window, while DeepSeek shipped V4 Pro on August 14 and raised API prices up to twelvefold with peak-hour billing. Any price quoted in an article should be rechecked against the provider's page before you budget on it.