AI Engineering
LLM Cost Calculator
Estimate and benchmark token expenses across major AI model providers. Calculate cost per request, monthly bill projections, and prompt caching discounts in real time.
PRESET WORKLOADS
| Model | Provider | Pricing / 1M | Cost / 1k Req | Total / Month | Cache Savings |
|---|---|---|---|---|---|
| Llama 3.1 8B 128k ctx · Edge devices, micro-classification, real-time autocomplete | Meta / Groq | $0.05 in / $0.08 out | $0.050 | $15.00 | - |
| DeepSeek-V3 NEW 64k ctx · Cost-sensitive high volume, open agent architectures | DeepSeek | $0.14 in / $0.28 out | $0.124 | $37.13 | -$9.07 |
| Gemini 2.0 Flash NEW 1M ctx · Real-time agents, massive document retrieval, audio/video | $0.10 in / $0.40 out | $0.142 | $42.60 | -$5.40 | |
| Gemini 2.0 Flash Thinking NEW 1M ctx · Fast math, iterative code debugging, low-latency reasoning | $0.10 in / $0.40 out | $0.142 | $42.60 | -$5.40 | |
| Qwen 2.5 Coder 32B NEW 128k ctx · Local code completion, git hooks, coding subagents | Meta / Groq | $0.20 in / $0.20 out | $0.170 | $51.00 | - |
| GPT-4o mini 128k ctx · High volume classification, lightweight chatbots, summarization | OpenAI | $0.15 in / $0.60 out | $0.222 | $66.60 | -$5.40 |
| Llama 3.3 70B 128k ctx · Self-hosted stack, fast open-weights production | Meta / Groq | $0.59 in / $0.79 out | $0.551 | $165.45 | - |
| DeepSeek-R1 NEW 64k ctx · Deep reasoning, math proofs, autonomous problem solving | DeepSeek | $0.55 in / $2.19 out | $0.779 | $233.73 | -$29.52 |
| Claude 3.5 Haiku 200k ctx · Fast code review, customer automation, low-latency agents | Anthropic | $0.80 in / $4.00 out | $1.31 | $392.16 | -$51.84 |
| o3-mini NEW 200k ctx · STEM coding, competitive math, fast reasoning | OpenAI | $1.10 in / $4.40 out | $1.63 | $488.40 | -$39.60 |
| Gemini 2.5 Pro NEW 2M ctx · Whole-repository code analysis, multi-hour video understanding | $1.25 in / $5.00 out | $1.78 | $532.50 | -$67.50 | |
| Gemini 1.5 Pro 2M ctx · Large file processing, long documents | $1.25 in / $5.00 out | $1.78 | $532.50 | -$67.50 | |
| Llama 3.1 405B 128k ctx · Synthetic data generation, distillation, complex evaluation | Meta / Groq | $2.40 in / $2.40 out | $2.04 | $612.00 | - |
| GPT-4o 128k ctx · Complex reasoning, multimodal vision, general production | OpenAI | $2.50 in / $10.00 out | $3.70 | $1,110.00 | -$90.00 |
| Claude 3.7 Sonnet NEW 200k ctx · Autonomous coding agents, fullstack architecture, complex reasoning | Anthropic | $3.00 in / $15.00 out | $4.90 | $1,470.60 | -$194.40 |
| Claude 3.5 Sonnet 200k ctx · AI engineering, fullstack coding agents, document synthesis | Anthropic | $3.00 in / $15.00 out | $4.90 | $1,470.60 | -$194.40 |
| o1 200k ctx · Math, hard logic, algorithmic problem solving | OpenAI | $15.00 in / $60.00 out | $22.20 | $6,660.00 | -$540.00 |
| GPT-4.5 Preview NEW 128k ctx · Deep research, executive writing, creative synthesis | OpenAI | $75.00 in / $150.00 out | $73.50 | $22,050.00 | -$2,700.00 |
LLM Pricing Economics
AI engineering costs are dominated by two asymmetries in modern frontier architectures:
1. Input vs Output Token Asymmetry
Generating an output token is typically 3x to 5x more expensive than processing an input token. Autoregressive transformer inference must generate tokens sequentially step-by-step (memory bandwidth bound), whereas prompt tokens are processed in parallel (compute bound).
2. The Leverage of Prompt Caching
Providers like Anthropic, OpenAI, and DeepSeek offer up to 90% cost reduction on cached prompt tokens. For agentic loops, code assistants, and document RAG systems where system prompts, API schemas, and document chunks repeat across turns, structured prompt caching dramatically cuts inference bills.
Cost Optimization Checklist
- Sub-model routing: Route simple classifications to sub-models (GPT-4o mini, Claude 3.5 Haiku, Gemini 2.0 Flash) and reserve reasoning models (o1, Sonnet) for final code generation.
- Anchor static prompts: Place static tools, schemas, and system prompt text at the prefix of messages to maximize KV-cache reuse.
- Batch API: Utilize non-realtime batch inference endpoints for background evaluation to secure standard 50% discounts.