Price per million tokens
In shortPrice per million tokens is the usual way AI APIs state their rates: what you pay for each million tokens sent in or generated.
In plain words
Providers charge by the token. Because single tokens are tiny, price lists name the rate for one million tokens. Anthropic's pricing page and Google's Gemini pricing page both use this unit. Input and output have their own rates. Input is what you send: your prompt, the history and any documents. Output is what the model writes.
To get the cost of a call, count the tokens, divide by one million, and multiply by the matching rate.
This page gives no numbers on purpose, because prices change often and differ by model. For current rates, see AI API prices. To try your own volumes, use the cost calculator.
Why it matters
Several things change the final bill:
- Model choice: Large models cost more per token than small ones. Pick the smallest model that does the job. See choose a model.
- Output tokens: The model's thinking tokens are billed as output tokens, which matters for reasoning models.
- Cached input: Repeated, cached prompt starts are billed at a lower rate. See prompt caching.
- Batch use: The batch API is cheaper for jobs that can wait.
- History: In a chat, each turn resends the earlier turns as input, so long conversations cost more per message. This relates to the context window.
- Extras: Tools, images and web search may carry separate charges. Read the provider's page.
Example
Your job has 3 million input tokens and 0.5 million output tokens. The cost is 3 times the input rate plus 0.5 times the output rate, both read from the price table. If you move half the job to a batch, that half costs less, but results arrive later. The token estimator helps you guess the token counts before you start.
Common misconceptions
- "One price covers input and output." They are separate rates, and output is usually priced differently from input.
- "Words are what you pay for." You pay for tokens. A word is often more than one.
- "A cheap model is always cheaper overall." A weak model may need more retries or longer prompts. Test on your real task.
Questions and answers
What does "per million tokens" mean?
The price for one million tokens of text. You divide your token count by one million and multiply by the rate to get the cost.
Why do input and output tokens cost different amounts?
Providers set separate rates for what you send and what the model generates. The price table of each provider lists both.
How can I lower my AI API bill?
Use a smaller model where it works, keep prompts short, cache repeated prompt starts, use the batch API for jobs that can wait, and set a spending limit.
Read next
- Token
A token is a small chunk of text, often a word piece, that an AI model reads, writes and bills.
- AI API prices compared: cost per 1 million tokens
A table of AI API list prices per 1 million tokens, with source and check date for every row.
- AI cost calculator: estimate API cost per call and month
A free calculator that turns token counts and list prices into a cost per call and per month.
- Batch API
A batch API takes many AI requests at once, processes them later and returns the results at a lower price than live calls.
- Prompt caching
Prompt caching lets an AI provider reuse the already processed start of your prompt, so repeated parts are cheaper and faster.