What is AI API pricing?
Most AI language model APIs charge a fee per token processed. Tokens are the unit providers use to measure text — roughly one token per three or four characters of English, or about three-quarters of an average word. A sentence of ten words might contain 13–16 tokens. Instead of a flat monthly subscription, you pay for exactly what your application uses — measured token by token.
Input tokens versus output tokens
When you send a request to an AI API, you are charged for two categories. Input tokens cover everything you send to the model — your system prompt, user message, conversation history, injected documents, and any other context. Output tokens are the characters the model writes in reply. These are billed at separate rates, and output is almost always more expensive.
Example: If you send a 500-token system prompt and 100-token user message (600 input tokens) and the model replies with 300 tokens, you pay for 600 input tokens and 300 output tokens — at their respective rates.
Why output tokens often cost more
Generating text requires significantly more computation than reading it. A model can process your input prompt in parallel, but it generates output sequentially — one token at a time. This asymmetry in computation is reflected in pricing: on most frontier models, output costs between 2× and 5× more per token than input. Use the AI API Cost Calculator to enter your expected input-to-output ratio and see the impact on your monthly bill.
Context windows
Every model has a context window — the maximum number of tokens it can process in a single request, including both input and output. Larger context windows allow you to send longer documents, maintain longer multi-turn conversations, or work with entire codebases. Context window size is a key factor when choosing a model for document analysis, legal review, or multi-step agentic tasks. Compare context windows across providers →
Cached input pricing
Some providers offer a discounted rate for cached input tokens. If your application sends the same system prompt or reference document with every request, cached pricing can meaningfully reduce costs at scale. Cache availability and discount levels vary by provider and model — check the Pricing Sources page for the latest details.
Request volume and monthly totals
The per-token cost of frontier AI is small in isolation — often fractions of a cent per request. Costs accumulate at scale. An application processing 10,000 user queries per day, each with 500 input tokens and 200 output tokens, would consume 5 million input tokens and 2 million output tokens daily — hundreds of millions per month. Use the Token Estimator to estimate token counts from real text, then feed those numbers into the cost calculator.
Batch processing discounts
Several providers offer batch APIs for workloads that can tolerate asynchronous processing — typically with latency measured in hours rather than milliseconds. Batch APIs often carry a 50% discount on standard rates. If your use case involves processing large datasets, running evaluations, or generating content offline, batch mode can significantly reduce your costs.
A cost-estimation workflow: prototype to monthly budget
A reliable estimate is a process, not a lucky guess. Work through these steps in order rather than jumping straight to a per-token rate:
- Prototype with real prompts. Build one working request using representative system prompts, context, and expected output — not a toy example.
- Measure actual tokens. Record the real input and output token counts your prototype produces. Estimates from character counts drift; measured counts do not.
- Multiply by current rates. Apply the model's input and output rates separately to get a per-request cost.
- Scale to volume. Multiply by your expected monthly request count to get a monthly figure.
- Apply discounts and add-ons. Factor in cached input, batch pricing, and any tool or retrieval costs your app also incurs.
- Turn it into a range. Produce a low, expected, and high figure rather than a single number — traffic and prompt sizes vary.
Do steps 2–6 in the tools: use the Token Estimator to size prompts from real text, then the AI API Cost Calculator to scale those numbers to a monthly budget.
Three worked planning scenarios
The figures below are clearly labelled illustrative assumptions, not provider quotes or benchmarks. They exist to show the shape of each workload — where the token volume lives and which lever matters most. Plug your own numbers into the calculator for a real range.
1. Customer support assistant
Assumptions: 50,000 conversations/month, ~1,000 input tokens each (system prompt + short history + retrieved help articles), ~200 output tokens each.
Shape: ~50M input and ~10M output tokens/month. Input dominates, and the static system prompt repeats every request — so cached input and trimming retrieved context are the biggest levers.
2. Internal document Q&A
Assumptions: 8,000 questions/month, ~4,000 input tokens each (question + retrieved passages), ~350 output tokens each.
Shape: ~32M input and ~2.8M output tokens/month. Retrieved context is the swing factor — returning fewer, more relevant chunks cuts cost more than changing models does.
3. Large-scale document summarization
Assumptions: 100,000 documents/month, ~5,000 input tokens each, ~500 output tokens each, processed offline overnight.
Shape: ~500M input and ~50M output tokens/month. Because it runs asynchronously, this is an ideal batch mode candidate, and a smaller model may clear the quality bar for summaries.
The cost impact of prompt growth and conversation history
In multi-turn chat, the full conversation is usually resent on every turn so the model has context. That means input tokens grow with each exchange: turn 10 can carry ten turns' worth of history, not one. A conversation that starts cheap can become several times more expensive per turn by the end. The same effect hits agents, where later steps carry the accumulated history of earlier ones. Common ways to contain it:
- Summarise or truncate older turns instead of resending the entire transcript.
- Keep system prompts lean, and use cached input for the parts that never change.
- Set a sensible history window so cost per turn stays roughly flat.
When batching, caching, model routing, and output limits reduce cost
These are the levers that reliably move a bill. Each fits a different situation:
- Batching — when work tolerates asynchronous results (evals, offline generation, bulk processing). Often discounted versus real-time calls.
- Caching — when the same prompt prefix (system prompt, reference doc) repeats across many requests.
- Model routing — when requests vary in difficulty: send easy ones to a cheap model, escalate hard ones to a stronger model.
- Output limits — always worth setting: capping response length controls the pricier output side and prevents runaway generations.
Build a monthly budget range, not one precise number
A single "$X per month" figure implies a precision AI workloads rarely have. Prompt sizes, output lengths, and traffic all vary, so plan a range instead:
- Low case: lean prompts, disciplined output limits, caching working well, traffic at the quieter end.
- Expected case: your measured averages at typical volume.
- High case: longer prompts and outputs, growing history, and a traffic spike happening together.
Set alerts against the expected case and make sure the high case is survivable. Then revisit the range as real usage data arrives.
Common planning errors and how to avoid them
- Estimating input only. Output is usually the pricier side — always model both, separately.
- Ignoring conversation growth. Multi-turn history compounds input cost; a single-turn estimate understates chat and agent workloads.
- Guessing tokens from word counts. Tokenisation varies by language, code, and formatting — measure with real text.
- Comparing per-token rates alone. A cheaper model that writes more, or needs retries, can cost more per completed task.
- Assuming a single exact figure. Plan a range and set alerts; treat estimates as planning starting points, not billing guarantees.
Why provider pricing changes
AI pricing has fallen dramatically since 2023 as models become more efficient and competition intensifies. Providers periodically reduce prices — sometimes by 50% or more — when they launch a new model generation or face competitive pressure. AIUtilityVerse tracks pricing from official sources and updates when changes are announced.
Why estimates may differ from your invoice
Estimates here use standard pay-as-you-go rates from official provider pricing pages. Your actual invoice may differ due to: enterprise or committed-use discounts, regional pricing variations, taxes and platform fees, rate-limit reservation charges, and minor differences in token counting between tokenizer implementations. Treat these figures as a planning starting point, not a billing guarantee. Read the full methodology for a complete explanation of how we source and calculate pricing.
What to do next
Turn this workflow into a real number: estimate token sizes from your own text, scale to a monthly budget, and compare models before you commit. Related guides can help you choose between providers.
Ready to estimate your costs?