Input tokens
Everything you send counts: the prompt, system instructions, conversation history, attached documents and tool definitions. Each request is billed for its own input, so a long system prompt is paid for again on every call.
Estimate and compare AI API costs based on tokens, usage, and model pricing.
Most language-model APIs charge for the tokens you send and the tokens the model writes back. Here is what goes into the estimate above.
Everything you send counts: the prompt, system instructions, conversation history, attached documents and tool definitions. Each request is billed for its own input, so a long system prompt is paid for again on every call.
The reply is billed separately and is usually priced several times higher than input. It can't be known in advance, so enter the length you expect. With reasoning models, the “thinking” the model does is typically billed as output too, so include it in your estimate.
The context window is the most a model can handle in one request: input and output share it. If input plus the expected reply is larger than the window, the request is invalid, so the calculator shows no cost instead of a misleading number.
Cost per request = input tokens × input price + output tokens × output price (prices are quoted per million tokens). Multiply by how many requests you expect per day or month to plan a budget; the usage calculator does this for each model you selected.
Larger and more capable models cost more to run, and providers price speed, context length and features differently. Tokenizers also differ: the same text can produce more tokens on one model than another, which changes the bill even at the same price per token. Price alone says nothing about which model is right for your task.
Related tools: LLM Token Counter, Context Window Checker and JSON Formatter.
Before a feature ships, someone has to answer what it will cost to run at real traffic. Give the calculator a prompt or a token count, say how long the reply will be, and pick the models to price against each other. It shows the cost of one request for each, then scales that by your requests per day or month. Cached input and Batch API rates apply wherever the catalog has a published price for the model.
Example input
Input tokens: 2,500 · Output tokens: 500 · Models compared: GPT-4o, Claude 3.5 Sonnet, Gemini 1.5 Flash