Skip to main content
TokenAtlas

What is AI API Cost?

If you've never seen an OpenAI invoice, start here.

Tokens, not words

AI APIs bill per token, not per word. 1 token ā‰ˆ 0.75 English words. A 300-word email is ~400 tokens. Code and non-English languages tokenize less efficiently — sometimes 2–3Ɨ more tokens per character.

Input vs output

Every request has an input cost (what you send) and an output cost (what the model generates). Output is almost always 3–5Ɨ more expensive per token than input.

Per-model rates

Cheaper models exist for simple tasks. Gemini Flash is ~30Ɨ cheaper than GPT-4o per token. Choosing the right model is the highest-leverage cost decision.

Hidden costs

System prompts re-billed each call. Retries on errors. Tool-call overhead. Streaming has no cost effect but matters for UX. None of these show up in marketing pricing pages.

A minimal worked example

Say you send a 300-word question (about 400 tokens) and get back a 200-word answer (about 270 tokens) on GPT-4o mini ($0.15/$0.60 per 1M). Input cost: 400/1,000,000 * $0.15 = $0.00006. Output cost: 270/1,000,000 * $0.60 = $0.000162. One call costs about $0.00022 — but at 500,000 calls a month that's roughly $110, which is why per-call intuition breaks down at scale.

How to model this as a scenario with your own volumes

Instead of guessing, define three numbers: average input tokens per request, average output tokens per request, and requests per month. Multiply each by the relevant per-1M rate for a candidate model, then repeat for two or three alternative models to see the spread. This is exactly the calculation a token-volume calculator like TokenAtlas runs — you supply the volumes, it applies the published rates.

Decision checklist for a first estimate

— Do you know your average prompt length in tokens, not words? — Have you separated input and output token counts, since they price differently? — Have you picked a realistic monthly call volume, including retries? — Have you compared at least two model tiers before committing?

What this explanation deliberately leaves out

This is a conceptual overview, not a billing reconciliation. It does not cover provider-specific discount programs, enterprise contracts, or how to pull real usage data from a live account — for that you need the provider's own dashboard or invoice. What's here is enough to build a first-pass cost model from stated or assumed token volumes.

Frequently asked questions

How do I know my token count?
Use the provider tokenizer or TokenAtlas's live counter — paste text and see tokens instantly.
Are there free tiers?
Google offers a generous Gemini free tier; OpenAI and Anthropic offer trial credits.
Can I cap my spend?
Yes — every provider supports monthly budget caps. Always set one.

Related