Skip to content

LLM API Cost Calculator

Per-call cost, monthly projection, every major model on one screen.

Buğra SözeriAI
Published
Reviewed by Convertitive AI Desk

Pricing across the major hosted LLMs spans two orders of magnitude — GPT-4o costs roughly 17× more per output token than Gemini 1.5 Flash, and Claude Opus is another 7× above that. Picking the right model is half budget question, half capability question. Paste a prompt (or type a token count if you already have one from our token counter), pick a workload shape, and the calculator shows per-call cost, a monthly projection, and a side-by-side comparison across every model in the table.

Heuristic token estimate (~4 chars/token for prose). Drop a real prompt — system message + user turn + any tool defs — for the closest cost reading.

Input tokens
42
Output tokens
42
Per call
$0.000756
Per month
$22.68

Claude 3.5 Sonnet — $3.00 / 1M input, $15.00 / 1M output · context 200k. Output ratio 1×. Monthly = per-call × calls/day × 30.

Compare all models

ModelProviderPer callPer month
Gemini 1.5 FlashGoogle<$0.0001$0.4725
Gemini 2.0 FlashGoogle<$0.0001$0.6300
GPT-4o miniOpenAI<$0.0001$0.9450
Llama 3.3 70B (Together / Fireworks)Meta<$0.0001$2.22
GPT-3.5 TurboOpenAI<$0.0001$2.52
Claude 3.5 HaikuAnthropic$0.000202$6.05
Gemini 1.5 ProGoogle$0.000263$7.88
Llama 3.1 405B (Together / Fireworks)Meta$0.000294$8.82
GPT-4oOpenAI$0.000525$15.75
o1-miniOpenAI$0.00063$18.90
Claude Sonnet 4Anthropic$0.000756$22.68
Claude 3.5 SonnetAnthropic$0.000756$22.68
GPT-4 TurboOpenAI$0.00168$50.40
o1 (reasoning)OpenAI$0.00315$94.50
Claude Opus 4Anthropic$0.00378$113.40

Pricing as of . Discounts (batch API, prompt caching, enterprise contracts) and fine-tuning surcharges are not applied — check the vendor’s live pricing page before committing to spend.

How to use

  1. Choose an input mode

    Paste the full prompt (system message + user turn + tool definitions) for a heuristic token count, or switch to 'Specify tokens' if you already know the count from tiktoken or Anthropic's count_tokens endpoint.

  2. Pick a workload preset

    The output:input ratio drives a lot of the cost — output tokens are 3–5× more expensive than input on most vendors. Chat ≈ 1×, classification ≈ 0.05×, code generation 3×, summarization 0.2×.

  3. Set calls per day

    Per-call cost × calls/day × 30 = monthly projection. Use the comparison table to see which model lands within budget at your traffic level.

  4. Copy the comparison

    Hit 'Copy as Markdown table' to drop the side-by-side cost matrix into a doc, ticket, or Slack message.

Frequently asked questions

Why don't my token counts match exactly?
Each model family uses a different tokenizer. OpenAI's newer models use o200k_base; GPT-4 Turbo and 3.5 use cl100k_base; Anthropic ships its own SentencePiece-derived tokenizer; Google uses SentencePiece; Llama uses a tiktoken-compatible variant. The 'Paste text' mode uses a 4-chars-per-token heuristic that lands within ±10% of any of these for English text but can drift further for code or non-Latin scripts. For an exact figure, use 'Specify tokens' with the count from each vendor's own tokenizer.
Why is the output rate higher than the input rate?
Output tokens are generated sequentially and each one requires a full forward pass through the model — they cost more compute than input tokens, which can be batched. Vendors pass that on: most price output at 3–5× the input rate. That's why the output:input ratio matters so much for total spend.
Does this include batch API discounts?
No. OpenAI, Anthropic, and Google all offer batch endpoints at roughly 50% off list price for non-realtime workloads. If you can tolerate 24-hour turnaround, halve the figures shown here. Prompt caching (also 50–90% off the cached portion) is similarly excluded — model the cached portion separately.
What about fine-tuning costs?
Not included. Fine-tuning has a one-time training cost (per million training tokens) plus an inference surcharge that varies by vendor — OpenAI fine-tuned GPT-4o currently runs at roughly 1.5× the base rate. This calculator only covers base-model inference.
How current are these prices?
The pricing table is tagged 'as of 2026-05-30' and reflects each vendor's public list price for direct API access on that date. Enterprise contracts, committed-spend discounts, and regional pricing variants are not modeled. Always confirm against the live vendor page before committing to spend.
Are Llama prices accurate?
Llama is open-weight, so there's no single 'official' price — costs depend on the host (Together, Fireworks, Groq, AWS Bedrock, self-hosted). The figures here reflect typical public-list rates from Together and Fireworks. Self-hosting on your own GPUs can be cheaper at high volume; serverless hosts charge a premium for the convenience.

About

How token pricing works

Every hosted LLM bills per token, split between input (your prompt + conversation history + tool definitions) and output (what the model generates). Prices are quoted per million tokens, so the math is (tokens ÷ 1,000,000) × per-million-rate. Modern context windows mean the entire conversation is re-priced on every turn — a 50-message chat re-bills the full transcript each round, which is why long sessions get expensive fast.

Cost-optimization checklist

1) Right-size the model — most production traffic does not need a frontier model. 2) Cache the system prompt — every major vendor now offers it; the savings compound on every request. 3) Cap output length explicitly with max_tokens. 4) Batch non-realtime work via the batch API for ~50% off. 5) Compress conversation history aggressively (summarize older turns). 6) Pre-classify with a small/cheap model and route only ambiguous cases to a larger one.

Related tools and reading

Estimate the raw token count with our token counter, look up the underlying concepts in the glossary (GPT token, LLM, context window), and read the long-form guide on how token pricing actually works for a deeper dive on batch APIs, caching economics, and tokenizer drift across providers.

Sources & references

Authoritative references behind the math, constants, and tables on this page. Verified by Buğra Sözeri on the dates shown and re-checked at every deploy.

Related