LLM API Token Cost Calculator
What does one call to an LLM API actually cost — and what does that mean once a pipeline runs it thousands of times a day? Enter your input/output token counts and per-million-token prices to get the cost per call, per day, per month and per year, with every step shown.
- Free with a free account
- Runs on our server in milliseconds
- Your input is not stored or logged
Create a free account to use the calculator
Members use every tool on AIDataLegends for free. It takes a name, an email and a password, and you come straight back here.
Not ready yet? The worked example below shows exactly what the tool produces.
Worked example
A call with 3,000 input tokens (2,000 of them served from a prompt cache at $0.30/1M) and 600 output tokens, at $3/1M input and $15/1M output, running 500 times a day every day. The calculator's answer:
What this means
- This is the per-call shape multiplied up — it won't match a real bill if calls vary in size (a long document one day, a short query the next). Run it again with your typical and your worst-case token counts to see the range.
The breakdown
Input cost/call = input tokens ÷ 1,000,000 × input price = 0.0090
Output cost/call = output tokens ÷ 1,000,000 × output price = 0.0090
Cached cost/call = cached tokens ÷ 1,000,000 × cached price = 0.0006
Cost/call = 0.0186
Cost/month = cost/call × calls/day × days/month = 279.00
Starting points, not an invoice: per-token prices change often and vary by model and provider. Use your own current rates for an exact number.
Why input, output and cache are priced separately
Model providers meter usage in tokens — rough chunks of text, usually 3-4 characters each in English — and almost always quote prices per million tokens, with three distinct rates where a prompt cache is on offer:
- Input tokens — everything newly sent to the model: the prompt, system instructions, tool definitions, and any document or conversation context not served from a cache.
- Output tokens — the tokens the model generates in its response. These are priced higher than input, often 3-5× or more, because generating each token costs more compute than reading one.
- Cached input tokens — the portion of input that matches a previous call closely enough to be read from a cache (a repeated system prompt, tool schema, or document) instead of fully reprocessed. Several providers price this at a fraction — often around 10% — of the normal input rate.
Keeping the three separate is why this calculator asks for each independently rather than one blended "token price": a pipeline that's mostly output-heavy and one that's mostly input-heavy can have wildly different costs at the same total token count.
Where to find your numbers
- Token counts — your provider's own tokenizer or token-counting endpoint gives an exact figure for a given prompt; most chat UIs and API responses also report token usage per call after the fact.
- Prices — each provider's pricing page, always quoted per model and almost always per million tokens for both input and output, with cache pricing (if offered) listed alongside.
Nothing here is looked up automatically and nothing is cached by this tool: every number comes from what you type in, so the answer stays correct even after a provider changes its prices.
The levers that actually move this number
- Output length. Because output is priced highest, capping max tokens, asking for more concise responses, or stopping a stream early once you have what you need usually saves more than any input-side change.
- Prompt caching. A large, repeated system prompt, tool schema or document context is close to free on every call after the first if your provider's cache applies — worth checking before assuming a large context is expensive on every call.
- Batch processing. For workloads that don't need a live response, several providers' batch APIs run at roughly half the synchronous price in exchange for asynchronous (minutes-to-hours) turnaround.
- Model choice. A smaller or older model in the same family is often an order of magnitude cheaper per token; the right call is whichever model is the cheapest one that reliably gets the task right, not the newest.
Limitations and assumptions
- This models one fixed call shape multiplied up by volume. A real pipeline's calls vary in size — run it again with your typical and your worst-case token counts to see the range, rather than trusting a single average.
- Reasoning/thinking tokens some models generate internally before answering are usually billed as output tokens — include them in the output count if your provider meters them that way.
- Prices change often and vary by model, provider and sometimes region — this tool has no pricing data of its own, only the arithmetic on what you provide.
Frequently asked questions
Why is output priced higher than input?
What counts as a token?
Is prompt caching the same as semantic caching?
Why does my pipeline's real bill not match this?
Why do I need an account?
Keep going
- ArticleGPT-6.1 Sol on Amazon Bedrock: Near-Astra performance at a fraction of the cost
- ArticleGrok 4.7 on Amazon Bedrock: Routing, reasoning effort, and cost with OpenAI-compatible APIs
- ToolSpark File Size & Partition Planner
- ToolJSON to PostgreSQL DDL Generator
- ToolSQL Data Quality Check Generator
- ToolDatabricks Cluster Cost Calculator
- ToolCron & Airflow Schedule Builder
- ToolSnowflake Credit Cost Calculator
- All toolsBrowse the free tools for data engineers