LLM API cost calculator
Cost = (input tokens / 1,000,000) × the standard input rate + (output tokens / 1,000,000) × the standard output rate. Cached input, cache writes, batch, flex, fast, and long-context multipliers are ignored. The note under the result quotes the exception the provider printed. Gemini has no row: its pricing page did not yield a clean per-model dollar table. Cohere, Amazon Bedrock, and Azure OpenAI have no row because a per-million price was not copied from their docs in this pass.
Worked example, using the formula above and not the form: 1,000,000 input tokens and 100,000 output tokens of gpt-6-luna cost $0.15.
Rates used
| Provider | Model | Input / 1M | Output / 1M | Context as printed | Source |
|---|---|---|---|---|---|
| OpenAI | gpt-6-luna | $0.1 | $0.5 | 1,050,000 tokens | Official page |
| OpenAI | gpt-6.1-sol | $2 | $10 | 1,050,000 tokens | Official page |
| Anthropic | claude-opus-5-5 | $4 | $20 | 1M tokens | Official page |
| Anthropic | claude-sonnet-5-5 | $2 | $10 | 1M tokens | Official page |
| Anthropic | claude-haiku-5-5 (prompt up to 100,000 tokens) | $0.1 | $0.5 | 1M tokens | Official page |
| Anthropic | claude-haiku-5-5 (prompt over 100,000 tokens) | $0.5 | $2.5 | 1M tokens | Official page |
| Groq | openai/gpt-oss-120b | $0.15 | $0.6 | 131,072 tokens | Official page |
| Groq | openai/gpt-oss-20b | $0.075 | $0.3 | 131,072 tokens | Official page |
| Cerebras | gpt-oss-120b | $0.35 | $0.75 | 65k tokens (free tier), 131k tokens (paid) | Official page |
| Cerebras | qwen-3.8-27b | $0.99 | $1.49 | 65,536 tokens on Free Trial; 131,072 on paid tiers | Official page |
| Mistral | mistral-small-2603 | $0.15 | $0.6 | 256k | Official page |
| Mistral | codestral-2508 | $0.3 | $0.9 | 128k | Official page |
| Together | zai-org/GLM-5.3-Flash | $0.15 | $0.5 | 1M | Official page |
| Together | moonshotai/Kimi-K3 | $3 | $15 | 1M | Official page |
| DeepInfra | DeepSeek-V4-Flash-0731 | $0.06 | $0.18 | 1024k | Official page |
| DeepInfra | phi-4 | $0.07 | $0.14 | 16k | Official page |
| Cloudflare Workers AI | @cf/meta/llama-3.2-1b-instruct | $0.027 | $0.201 | 60,000 tokens | Official page |
| Cloudflare Workers AI | @cf/deepseek-ai/deepseek-v4.1-flash-1017 | $0.3 | $1.2 | 1,048,576 tokens | Official page |
Related: context windows, free LLM API limits, LLM APIs category list, coding-model prices.
Sources
Last checked 2026-10-22.
- OpenAI: gpt-6-luna
- OpenAI: gpt-6.1-sol
- Anthropic: claude-opus-5-5
- Anthropic: claude-sonnet-5-5
- Anthropic: claude-haiku-5-5 (prompt up to 100,000 tokens)
- Anthropic: claude-haiku-5-5 (prompt over 100,000 tokens)
- Groq: openai/gpt-oss-120b
- Groq: openai/gpt-oss-20b
- Cerebras: gpt-oss-120b
- Cerebras: qwen-3.8-27b
- Mistral: mistral-small-2603
- Mistral: codestral-2508
- Together: zai-org/GLM-5.3-Flash
- Together: moonshotai/Kimi-K3
- DeepInfra: DeepSeek-V4-Flash-0731
- DeepInfra: phi-4
- Cloudflare Workers AI: @cf/meta/llama-3.2-1b-instruct
- Cloudflare Workers AI: @cf/deepseek-ai/deepseek-v4.1-flash-1017