Start a project

Tool 44 of 425 · LLM costs

LLM API Cost Calculator

Calculates API spend from your token usage and prices, with caching and batch savings.

LLM API Cost Calculator

Your input

Prices are per million tokens. The defaults are examples: replace them with your provider's rates.

Result

ItemCost

    01

    What it does

    Calculates API spend from your token usage and prices, with caching and batch savings.

    • Input, output and cached input prices
    • Per request, day and month
    • Cache hit rate
    • Batch API discount

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Cost breakdown, with a Copy and a Download button on every result.

    • LLM pricing
    • API costs
    • Tokens

    Why it matters

    Output tokens usually cost several times more than input, and prompt caching can cut input costs sharply.

    Enter your provider's current per-million-token prices; the defaults are examples only.

    How to use it

    1. Type or paste your input; the example shows the format.
    2. Press Calculate cost. Results also update as you type.
    3. Read the summary line, then the table, notes or output below it.
    4. Copy or download what you need. Nothing leaves this page.

    FAQ

    Are these prices current?

    No. They're placeholders: replace them with your provider's rates.

    What's prompt caching?

    Reusing a long shared prompt prefix, billed at a discount on repeat requests.

    Is my input uploaded?

    No. The tool runs in your browser and nothing you type, paste or open is sent anywhere.

    Can I rely on the result?

    It follows the public specification or formula named on this page and says where it simplifies. Check anything critical against the official tool or documentation before you ship it.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk