Skip to content
AI suite

LLM API Cost Calculator

Enter a prompt and the expected output length in tokens to estimate the API cost of Claude, GPT and Gemini models, sorted from cheapest. Input tokens are worked out from the text you paste for each model family (exact for GPT, approximate for Claude and Gemini), and the single output-token value you enter is applied to every model. Prices are the input and output rates per million tokens, refreshed from a public model-pricing catalog every time the site is rebuilt, with the date they were fetched shown. Cache discounts, batch discounts, long-context surcharges and tool fees are not included, and the currency is US dollars. Check each provider's pricing page for the amount you will actually be billed. Everything runs in your browser and your text is never sent anywhere; only the price list was fetched ahead of time at build.

Characters: 0Words: 0Lines: 0

Applied to every model equally — there is no generated text to tokenize per model, so this is a single estimate you control.

Discount rates differ by vendor, so enter the figures from your contract or the official pricing page.

Cost comparison

    Enter some text or an expected output length to see the chart.

    Cheapest at the top. Bars are scaled to the most expensive model; the figures are the same as in the table below.

    Cost by model

    ModelInput tokensOutput tokens$ / 1M in · outEst. costMonthly cost
    Claude Fable 5.200$8 · $40$0.00—
    Claude Opus 5.500$4 · $20$0.00—
    Claude Sonnet 5.500$2 · $10$0.00—
    Claude Haiku 5.500$0.1 · $0.5$0.00—
    Claude Opus 4.800$5 · $25$0.00—
    Claude Sonnet 4.500$3 · $15$0.00—
    Claude Haiku 4.500$1 · $5$0.00—
    GPT-6 Astra00$10 · $50$0.00—
    GPT-6.1 Sol00$2 · $10$0.00—
    GPT-6.1 Terra00$1 · $5$0.00—
    GPT-6 Luna00$0.1 · $0.5$0.00—
    GPT-5.500$5 · $30$0.00—
    GPT-500$1.25 · $10$0.00—
    GPT-4.100$2 · $8$0.00—
    GPT-4o00$2.5 · $10$0.00—
    GPT-4 Turbo00$10 · $30$0.00—
    GPT-3.5 Turbo00$0.5 · $1.5$0.00—
    Gemini 4 Argon00$2 · $10$0.00—
    Gemini 4 Carbon00$2 · $10$0.00—
    Gemini 4 Hydrogen00$1.5 · $7.5$0.00—
    Gemini 3.8 Flash00$0.825 · $4.125$0.00—
    Gemini 3 Pro00$2 · $12$0.00—
    Gemini 2.5 Flash00$0.3 · $2.5$0.00—

    Pricing data updated: 2026-11-16· Source: OpenRouter public model catalog (reference pricing, not official vendor pricing).

    Costs are estimates for rough comparison only — not for billing. Claude and Gemini token counts are heuristic estimates (±10–20%), and per-model chat-API overhead (message structure, system prompt, tool definitions) is not included. Always check the vendor's own pricing page before making a purchasing decision.

    Cost of a conversation

    A chat resends the system prompt and the whole history every turn, so input grows with each turn and the total grows roughly with the square of the turns. Cache and batch settings above apply to the resent history.

    TurnInput tokensCost
    Guide

    How to use & features

    • Paste a prompt or document into the text area and each model's input token count updates automatically.
    • "Expected output tokens" is a single number applied to every model, since there is no generated text to tokenize per model.
    • The table automatically sorts by total cost, cheapest first, and marks the cheapest model with a badge.
    • The $/1M column shows the per-million-token input and output price for each model, useful when choosing a model.
    FAQ

    FAQ

    • How up to date is the pricing data?

      It is refreshed automatically from a public model-pricing catalog (OpenRouter) every time this site is rebuilt. The page shows the "pricing data fetched" date so you can see exactly how fresh it is. If a refresh fails, the previously committed price is kept, so a price is never blank.
    • Does this match the official API pricing exactly?

      No, treat it as a reference. It relies on a third-party aggregator (OpenRouter) that publishes per-model prices, which can differ from a vendor's own announcement in timing or detail (batch discounts, prompt caching rates, long-context surcharges, etc.). Always check the vendor's official pricing page before making a purchasing or billing decision.
    • Why can't output tokens be counted from real text?

      The output hasn't been generated yet, so there is nothing to tokenize. Instead you enter an "expected output tokens" number, and that single value is applied to every model in the comparison. Adjust it up or down if you expect a shorter or longer response.
    • Why are the Claude and Gemini input token counts approximate?

      Same reason as the LLM Token Counter tool: Anthropic and Google do not publish their tokenizers, so those counts are estimated from the exact GPT count and the character mix, and can deviate from the real API count by roughly ±10–20%.
    • Is my prompt sent anywhere?

      No. Prompt analysis and cost calculation run entirely in your browser. The only network request involved is the price-list fetch, which happens once at build time — not while you are using the tool.
    Use cases

    Common use cases

    • Comparing model costs before choosing one

      See how the same prompt costs across Claude, GPT, and Gemini models side by side, and pick the one that fits your budget and requirements.
    • Estimating system-prompt costs

      Get a rough monthly cost estimate for a long system prompt or the context inserted by a RAG pipeline.
    • Understanding the cost gap between flagship and lightweight models

      See the concrete dollar difference between a flagship model (like an Opus-tier model) and a lightweight one (like a Haiku-tier model) for the same input/output volume.
    • Drafting a cost estimate for stakeholders

      Use it as a quick starting point when putting together a cost projection for adding an AI feature to a product.
    Notes

    Notes & limitations

    • Do not use this for billing

      The prices shown are reference values from a third-party aggregator and may differ from your actual invoice. Always check the vendor's official pricing page before making a formal estimate or purchasing decision.
    • The output token count is a hypothetical value

      The output cost is calculated from the "expected output tokens" you enter, applied equally to every model — not from an actual generated response. If real output length varies by model, the true cost gap may be larger or smaller than this estimate.
    • The long-input surcharge is applied only where the price data has it

      Some models cost more once the input passes a token threshold (100K for Claude Haiku 5.5, 272K for the GPT-6 family and GPT-5.5, 200K for Gemini 3 Pro, and so on). Where the price data has that surcharge, it is applied to the whole input above the threshold. A surcharge the data does not list cannot be shown. Cache and batch discounts are applied from the rates you enter above — match them to each vendor's terms.
    • Pricing only refreshes when the site is rebuilt

      The price data updates only when this site is rebuilt and redeployed. Right after a vendor changes their pricing, the "pricing data fetched" date shown on the page may lag behind.

    Articles for this tool

    Recent Articles