LLM Prompt Cost Calculator
Enter your prompt and completion token counts to compare API costs across the major LLM providers. Useful for budgeting AI features, comparing models, and optimizing your token usage. All calculations run in your browser using approximate 2024 public pricing.
Token Inputs
≈ 1 token per 4 chars (English)
Tokens generated by the model
Cost Comparison
| Model | Input $/1M | Output $/1M | Per Call | Monthly (×calls) |
|---|
Pricing Reference (Approx. 2024)
| Model | Provider | Input / 1M tokens | Output / 1M tokens |
|---|---|---|---|
| GPT-4o | OpenAI | $5.00 | $15.00 |
| GPT-3.5-turbo | OpenAI | $0.50 | $1.50 |
| Claude 3.5 Sonnet | Anthropic | $3.00 | $15.00 |
| Gemini 1.5 Pro | $3.50 | $10.50 | |
| Llama 3 70B (Groq) | Groq | $0.59 | $0.79 |
Prices are approximate and subject to change. Verify on provider pricing pages before budgeting.
Frequently Asked Questions
How are LLM API costs calculated?▼
LLM providers charge separately for input tokens (your prompt) and output tokens (the model's response). Prices are listed per 1 million tokens (1M tokens). For example, GPT-4o costs $5 per 1M input tokens and $15 per 1M output tokens. To calculate a single call's cost: (input_tokens / 1,000,000 × input_price) + (output_tokens / 1,000,000 × output_price).
Which model is the most cost-effective for my use case?▼
It depends on the task. For high-volume, simple tasks (classification, summaries) use GPT-3.5-turbo or Llama 3 on Groq — both are very cheap. For complex reasoning or long context, GPT-4o or Claude 3.5 Sonnet offer the best quality-to-cost ratio. Gemini 1.5 Pro is excellent for very long documents due to its 1M token context window. Always benchmark quality vs. cost for your specific use case.
What is the difference between input and output token pricing?▼
Input tokens are tokens in your prompt (system message + user messages). Output tokens are tokens the model generates in its response. Output tokens typically cost 3-5x more than input tokens because generating text is computationally more expensive than reading it. This means keeping your prompts concise and limiting max_tokens for the response are key levers for cost control.
Are these prices current and accurate?▼
This calculator uses approximate 2024 pricing from public documentation. AI pricing changes frequently — providers regularly drop prices as competition increases. Always verify current pricing on the official provider's pricing page before making budget decisions. OpenAI: platform.openai.com/pricing, Anthropic: anthropic.com/pricing, Google: cloud.google.com/vertex-ai/pricing, Groq: console.groq.com.
Related Products
on GumroadAI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →AI Developer Prompts Pack
55 battle-tested prompt templates for the workflows developers actually use: code review, debugging, architecture, documentation, and testing. Stop writing prompts from scratch.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
LLM Cost Calculator
Compare monthly API costs across GPT-4o, Claude Sonnet, Gemini Pro, and 12+ models. Enter daily requests and token counts for instant cost estimates.
Open free tool →
AI Prompt Cost Calculator
Calculate daily and monthly API costs for GPT-4o, Claude 3.5, Gemini 1.5, and more. Enter token counts, model, and request volume to get instant cost projections.
Open free tool →
Token Counter & Cost Estimator
Count tokens and estimate monthly API costs for GPT-4o, Claude 3.5, Gemini 1.5, and Llama. Paste your prompt, set output length and volume for production budgeting.
Open free tool →
More Free Tools
Related Articles
OpenAI Agents SDK vs Claude API vs Gemini: Building Production AI Agents 2026
Complete comparison of OpenAI Agents SDK, Claude API, and Gemini for production AI agents in 2026. Multi-agent workflows, tool use, streaming, cost, tracing, and when to use each.
Prompt Engineering Techniques 2026: Chain-of-Thought, RAG, and Advanced Patterns
Advanced prompt engineering guide for 2026: Chain-of-Thought, Tree-of-Thought, RAG integration, few-shot learning, prompt chaining, and evaluation techniques.
Vercel AI SDK: Complete Guide to Streaming, Tool Calling & Multi-Provider in 2026
Master the Vercel AI SDK in 2026. Streaming text and objects, tool calling, multi-provider support (OpenAI, Claude, Gemini), agents, and production patterns. TypeScript-first guide.
Claude API Complete Guide for Developers 2026: Models, Pricing & Best Practices
Complete guide to the Claude API in 2026. Covers model lineup, TypeScript and Python integration, system prompts, tool use, vision, prompt caching, extended thinking, batch processing, and production patterns.
Gemini 2.5 Pro API Guide for Developers 2026: Integration, Pricing & Use Cases
Complete guide to using the Gemini 2.5 Pro API in 2026. Covers model lineup, Python and Node.js integration, multimodal inputs, extended thinking, streaming, long context, function calling, token counting, pricing, and common errors.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →