LLM API Cost Calculator

What does your AI agent actually cost?

Pick a model, set your agent's usage (including prompt caching), and see the per-token bill (live OpenRouter pricing) against Standard Compute's flat plan.

input
$5/1M
output
$25/1M
cached
$0.50/1M
Pricing from OpenRouter.
Requests / day150
Avg input tokens / request40k
Avg output tokens / request1k
Input served from cache50%
Claude Opus 4.8 · per-token
$630/mo
4,500 requests/mo · 50% cached
vs
Standard Compute · Economy
$39/mo
flat-rate · standard speed
fast
slow
$591/mo saved, 16× cheaper, flat-rate.

Every model at this usage

Monthly per-token cost (input/output + caching), cheapest first. Your selected model is highlighted.

ModelIn / Out /1MPer-token / movs Economy
DeepSeek V4.1 Flash · DeepSeek$0.04 / $0.63$7.81cheaper
DeepSeek V4 Flash · DeepSeek$0.09 / $0.18$11cheaper
Claude Haiku 5.5 · Anthropic$0.10 / $0.50$13cheaper
GPT-6 Luna · OpenAI$0.10 / $0.50$13cheaper
Qwen3 235B A22B · Alibaba (Qwen)$0.09 / $0.55$19cheaper
Llama 4 Maverick · Meta$0.19 / $0.65$25cheaper
GPT-5.6 Luna · OpenAI$0.20 / $1.20$26cheaper
Gemini 3.1 Flash Lite · Google$0.25 / $1.50$33cheaper
Codestral · Mistral$0.30 / $0.90$35cheaper
MiniMax M2.1 · MiniMax$0.30 / $1.20$36cheaper
GLM 5.3 · Z.AI$0.08 / $4.80$38cheaper
MiniMax M3 · MiniMax$0.30 / $1.20$39cheaper
DeepSeek V3.2 · DeepSeek$0.26 / $0.80$401.0×
GLM 5.2 · Z.AI$0.06 / $5.60$411.1×
Qwen3.7 Plus · Alibaba (Qwen)$0.32 / $1.28$411.1×
DeepSeek V4 Pro · DeepSeek$0.43 / $0.85$461.2×
Devstral 2 · Mistral$0.40 / $2$501.3×
Mistral Large 3 · Mistral$0.50 / $1.50$581.5×
GLM 4.6 · Z.AI$0.50 / $2$651.7×
GLM 4.7 · Z.AI$0.60 / $2.20$761.9×
Mistral Large 4 · Mistral$0.68 / $2.09$792.0×
DeepSeek R1 (0528) · DeepSeek$0.50 / $2.15$882.3×
Kimi K2.6 · Moonshot AI$0.65 / $3.41$902.3×
Gemini 3.8 Flash · Google$0.75 / $3.75$952.4×
Kimi K2.7 Code · Moonshot AI$0.67 / $3.35$952.4×
GPT-5.4 Mini · OpenAI$0.75 / $4.50$992.5×
Step 5 Preview · StepFun$1 / $2.70$1092.8×
Beam 1.0 · Reflection$1 / $3$1153.0×
Claude Haiku 4.5 · Anthropic$1 / $5$1263.2×
Grok 4.3 · xAI$1.25 / $2.50$1443.7×
Grok 4.20 · xAI$1.25 / $2.50$1443.7×
Muse Spark Open · Meta$1.25 / $4.25$1493.8×
Qwen3.7 Max · Alibaba (Qwen)$1.48 / $4.42$1834.7×
Gemini 3.5 Flash · Google$1.50 / $9$1975.1×
Claude Sonnet 5.5 · Anthropic$2 / $10$2436.2×
GPT-6.1 Sol · OpenAI$2 / $10$2436.2×
Gemini 4 Argon · Google$2 / $10$2436.2×
GPT-5.3-Codex · OpenAI$1.75 / $14$2496.4×
GPT-6 Sol · OpenAI$2 / $10$2526.5×
GPT-5.6 Sol · OpenAI$2 / $10$2526.5×
Grok 4.7 · xAI$2 / $6$2576.6×
GPT-5.6 Terra · OpenAI$2 / $12$2636.7×
Gemini 3.1 Pro · Google$2 / $12$2636.7×
GPT-5.4 · OpenAI$2.50 / $15$3298.4×
Claude Sonnet 4.6 · Anthropic$3 / $15$3789.7×
Claude Opus 5.5 · Anthropic$4 / $20$48612×
Muse Wonder · Meta$4 / $20$48612×
Claude Opus 4.8 · Anthropic$5 / $25$63016×
GPT-5.5 · OpenAI$5 / $30$65717×
Claude Fable 5.1 · Anthropic$10 / $50$1,19331×
Claude Fable 5 · Anthropic$10 / $50$1,26032×
GPT-6 Astra · OpenAI$10 / $50$1,26032×

Public OpenRouter per-token pricing (input + output, with your cache-hit rate applied where the model supports prompt caching). Standard Compute is flat-rate within fair use; suggested plan scales with workload.

Stop watching the meter

Point any OpenAI-compatible agent at Standard Compute and the bill stops scaling with usage. One flat price, smart routing to a cost-efficient frontier model per request.

Get a free API key →See how it connects →

How LLM API pricing works

Every major LLM API (OpenAI, Anthropic (Claude), Google (Gemini), xAI (Grok)) bills per token. You pay for input tokens (your prompt, context, files) plus output tokens (what the model generates), each priced per million. Output usually costs 3–5× more than input. Many models also offer prompt caching, where repeated context is billed at a fraction of the input price.

That model punishes AI agents: they resend large context every step and fire background requests, so a single always-on agent can burn millions of tokens a day. This calculator estimates that monthly per-token bill across 30+ frontier models (live OpenRouter pricing, caching included) and compares it to a flat-rate plan where cost stops scaling with usage.

LLM API cost: FAQ

How do you calculate LLM API cost?

LLM API cost = (input tokens ÷ 1,000,000 × input price) + (output tokens ÷ 1,000,000 × output price), multiplied by your number of requests. Input (prompt) tokens and output (completion) tokens are usually priced differently, and output is typically 3–5× more expensive per token. This calculator does the math across 30+ models using live OpenRouter pricing.

How much does the OpenAI / Claude / Gemini API cost?

Per-token API pricing varies widely by model, from cents per million tokens for small open models to $15+ per million output tokens for frontier models like GPT-6 Astra and Claude Opus. Pick any model above to see its exact per-token cost at your usage, or compare several side by side.

Why are AI agents so expensive to run?

Agents are input-token heavy: they resend large context (files, history, tool results) on every step, and background heartbeats, retries, and parallel tool calls multiply the request count. A single always-on agent can push millions of tokens a day, so per-token bills scale fast, which is why flat-rate pricing changes the economics for agent workloads.

What's the difference between input and output tokens?

Input (prompt) tokens are what you send to the model: your prompt, context, files, and message history. Output (completion) tokens are what the model generates back. Output tokens usually cost several times more than input tokens, so a chatty agent with long responses can be pricier than the request count suggests.

Is there an unlimited or flat-rate LLM API?

Not truly unlimited: every LLM API meters something. Flat-rate ones exist, though. Standard Compute is an OpenAI-compatible API at a flat monthly price (from $19). It auto-routes each request to a cost-efficient model and runs at full speed until the plan's monthly budget is used, then stops, with no overage charges. That's what the comparison above shows.

Does prompt caching reduce LLM API costs?

Yes, a lot, for agents. Many models bill repeated input (system prompt, context, files you resend every step) at a discounted cache-read rate, often around 10% of the normal input price. Since agents resend large context constantly, a high cache-hit rate can cut the input portion of the bill dramatically. This calculator lets you set your cache-hit rate and applies the model's cache-read price where the model supports it.

How many tokens does an AI agent use?

It depends on context size and how often it runs, but agent inputs commonly range from ~10,000 tokens up to 1,000,000+ per request for large-context or codebase-aware agents, with outputs from a few hundred to a few thousand tokens. Set your real numbers on the sliders above to estimate the bill.