LLM Cost Explorer

Monthly LLM API cost per model for your workload, with prompt-caching and batch savings.

tokens
tokens
More options
Model prices (USD per 1M tokens)
Model prices (USD per 1M tokens)
#ModelInputOutputCache readCache writeContext window
1
2
3
4

e.g. openai/gpt-4o-mini – one per line. Empty in paste mode = all pasted models.

%

Share of input tokens that repeat across requests (system prompt, tools, documents).

%
%
%
USD

Try an example: ·

More about this tool

Part of Agentlab AI infrastructure & agent explorers

How it works

Calculates what an LLM workload costs per request and per month on each model – requests per day, input and output tokens, the share of the prompt that can be cached, cache hit rate and batch discounts – using live prices from OpenRouter's public models API, a pasted copy of it, or prices you enter. Shows caching and batch savings, the cheapest models that fit your context and budget, and a cost comparison chart.

  • Per request: input cost = uncached tokens × input price + cacheable tokens × (hit rate × cache-read price + (1 − hit rate) × cache-write price); output cost = output tokens × output price. Prices are per 1M tokens.
  • If a model has no cache-read price, caching is not modelled for it (all input at the normal input price). If no cache-write price is listed, misses are charged at the normal input price.
  • Batch: the batch share of requests gets the batch discount on the whole request (as with typical 50 % batch APIs).
  • Monthly = per request × requests/day × days per month (default 30.4). Context check: input + output tokens must fit the context window when it is known.
  • OpenRouter prices come from GET https://openrouter.ai/api/v1/models (pricing.prompt, completion, input_cache_read, input_cache_write in USD per token).

Use this tool in an app

These free programs for your browser have this tool built in, next to everything else the task needs.

  • Agentlab AI-agent & LLM workbench

    Test an AI agent before release: permissions, traces, costs, citations and output checks.

    Open Agentlab

Related tools

How to use the LLM Cost Explorer

Estimate what an LLM workload costs per request and per month on each model, including prompt caching, batch discounts and context limits.

What it is for

LLM price lists are per million tokens, but you think in requests: "5,000 support chats a day, a long system prompt, short answers". Turning one into the other by hand gets messy once you add prompt caching, batch APIs and models whose context window is too small for your prompt.

This explorer does the arithmetic for a whole list of models at once. Describe the workload (requests per day, input and output tokens, how much of the prompt repeats, cache hit rate, batch share) and pick a price source: prices you type in, live prices from OpenRouter's public models API, or a pasted copy of that API response. You get per-request, per-1,000 and monthly cost, the savings from caching and batching, and the cheapest model that fits both your context and your budget.

It is an estimate, not an invoice. Reasoning tokens, image or audio fees, web-search fees and taxes are not included, and different tokenizers can count the same text 10–30 % differently.

Worked example

The first built-in example is a support bot: 5,000 requests per day, 12,000 input tokens and 400 output tokens each, 75 % of the prompt cacheable (system prompt and documents), a 90 % cache hit rate and a $2,000 monthly budget. Three example models are entered by hand:

Worked example
ModelMonthlyWithout cachingFits contextIn budget
Small (0.10/0.40, 8k context)$206.72$206.72noyes
Mid (0.40/1.60, cache read 0.10)$457.52$826.88yesyes
Large (3/15, cache read 0.30, write 3.75)$3,162.36$6,384.00yesno

Summary: cheapest option meeting your constraints: Mid model at $458/month ($3.01 per 1,000 requests), saving $369/month through caching.

The small model is cheapest on paper, but 12,400 tokens per request don't fit its 8,000-token window, so it is ruled out. The large model would cost over $6,000 without caching, and caching halves that, but it is still above budget. Over 152,000 requests a month (5,000 × 30.4 days), the mid model's $0.00301 per request comes out at $457.52.

How to read the result

  • Cheapest within constraints — the answer to "what should I use?". The plain cheapest may break your context or budget.
  • Per 1,000 requests — the easiest number for comparing with your own pricing or margins.
  • Caching and batch savings — how much each lever saves per model. A model with no cache-read price shows 0 caching savings and gets a warning, because caching is not modelled for it.
  • Warnings and assumptions — read these. They spell out request volume, the caching split and what is excluded.

Tips and common mistakes

  • Be honest about "cacheable". Only an identical prefix repeated across requests counts: system prompt, tool definitions, static documents. User messages almost never do.
  • Cache writes can cost more than normal input (3.75 vs 3 in the example). With a low hit rate, caching can make a model more expensive.
  • Output tokens are often 4–5× the price of input. Trimming verbose answers can save more than switching models.
  • Reasoning models bill thinking tokens as output. Add an estimate to the output tokens, or your figure will be far too low.

FAQ

Where do the live prices come from?

From OpenRouter's public GET /api/v1/models endpoint: prompt, completion, cache-read and cache-write prices per token, converted to per 1M tokens.

How is the batch discount applied?

The share of requests you mark as batch gets the discount on the whole request, input and output, the way typical 50 % batch APIs work.

Why is a model marked as not fitting?

Its known context window is smaller than input plus output tokens per request. If the window is unknown, the model is not ruled out.

Can I get a quote that doesn't change tomorrow?

Yes. Live prices change, so save the OpenRouter models response and use paste mode. A month defaults to 30.4 days, which you can change.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://llmcostexplorer.usefulweb.site/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://llmcostexplorer.usefulweb.site/mcp · tool name llm_cost_explorer
Example request
curl -s -X POST https://llmcostexplorer.usefulweb.site/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"priceSource":"manual","prices":[{"model":"Large model (example)","inputPerM":3,"outputPerM":15,"cacheReadPerM":0.3,"cacheWritePerM":3.75,"contextTokens":200000},{"model":"Mid model (example)","inputPerM":0.4,"outputPerM":1.6,"cacheReadPerM":0.1,"contextTokens":1000000},{"model":"Small model (example)","inputPerM":0.1,"outputPerM":0.4,"contextTokens":8000}],"requestsPerDay":5000,"inputTokens":12000,"outputTokens":400,"cacheablePct":75,"cacheHitRate":90,"budget":2000}'
Feedback · ideas & bug reports welcome