Working out the cost of one request
Providers quote prices per million tokens, with separate prices for input and output. Suppose a model charges $3 per million input tokens and $15 per million output tokens, and each request sends a 2,000-token prompt and gets a 500-token reply:
input: 2,000 ÷ 1,000,000 × $3 = $0.006
output: 500 ÷ 1,000,000 × $15 = $0.0075
total per request = $0.0135
10,000 requests a month ≈ $135
The calculator runs the same sum for every model at once, so you can see how much the choice of model changes the bill.
What makes a bill bigger than expected
- Chat history: each new message sends the whole conversation again, so a long chat costs more per turn the longer it runs.
- Reasoning tokens: models that think before they answer bill that hidden thinking as output tokens, often several times the length of the visible reply.
- Long context: some models charge a higher rate once a prompt passes a certain size, such as 200,000 tokens.
- Images and files: pictures and PDFs are turned into tokens too, and a full page can cost more than a page of plain text.
Ways to cut API costs
Use the smallest model that passes your tests, since small models often cost a tenth of the top ones or less. Keep the system prompt and fixed documents at the start of the prompt so caching can apply to them. Set a maximum output length, and ask for short answers when you don’t need long ones. For work that can wait, such as tagging a backlog of documents, the batch APIs of OpenAI, Anthropic and Google take a day or less and cost about half the normal price.
Checking the price before you ship
Prices here come from each provider’s pricing page, and the date they were last checked is shown with the table. Providers cut prices often and add new models every few months, so check the official page before signing a budget. Paste a real prompt from your app rather than a short test, because an estimate built on a ten-word question can be off by a factor of a hundred.