InputTestHub

LLM API Cost Calculator

Works out what an LLM feature costs per call, month and year, including what prompt caching saves and how models compare.

Developer Nothing uploaded No sign-up Free, unlimited
Developer tool
Blank uses the preset. Override it — presets go stale.
Enter your figures and press Calculate.
In short The cost of an LLM call is input tokens times the input price plus output tokens times the output price, and output is typically four to five times dearer than input. The lever most people miss is prompt caching: a cache read is billed at roughly a tenth of the normal input price, so anything that resends the same system prompt, tool definitions or document on every turn — which is most agents — can cut its bill dramatically without changing a single response. The other thing worth knowing is that the whole conversation is resent on every call, so a long chat costs the sum of every prefix rather than the sum of its messages.

How to use the LLM API Cost Calculator

  1. Pick a model, then correct its prices if they have moved.
  2. Enter the tokens for one typical call.
  3. Set the cached share if your prompt repeats.
  4. Read the comparison table as a ranking.

About the LLM API Cost Calculator

The LLM API Cost Calculator works out what an LLM feature costs per call, month and year, including what prompt caching saves and how models compare. It runs as plain JavaScript inside the page, which means there is no upload step, no queue and no size limit imposed by a server — the only limit is your own device.

What people use it for

  • Costing a feature before building it.
  • Showing what prompt caching would save on an agent loop.
  • Comparing models on your own traffic rather than on a benchmark.

Details

OutputTypically 4 to 5 times the input price
Cache readsRoughly a tenth of the input price
ConversationsThe whole history is resent on every call
PricesList figures as of August 2026 — every one is editable here

The maths behind it

This tool uses cost per call = (uncached input × input price + cached input × input price × cache rate + output × output price) ÷ 1,000,000. Every intermediate value is shown on screen, so the result can be checked by hand.

The comparison table ranks the models on your traffic shape, which is more useful than a price list: a workload that is mostly long input and short output ranks models quite differently from one that generates pages of text from a short prompt.

Where this tool stops

List prices before committed-use or volume discounts, and before the extra billing that reasoning tokens, image inputs, web search and code execution attract on most platforms.

Frequently asked questions

What is prompt caching and why does it matter so much?
Providers will store the unchanging prefix of your prompt and bill re-reads of it at a fraction of the input price — usually around a tenth. An agent that sends a 4,000-token system prompt and tool definitions on every turn is paying full price for the same tokens hundreds of times a day without it. It is the single largest saving available in most deployments and it requires no change to the responses at all.
Why is a long conversation so expensive?
Because the entire history goes with every call. Turn 40 sends all 40 turns, turn 41 sends 41, and the total cost of a conversation is the sum of every prefix rather than the sum of its messages — it grows with the square of the length. Summarising older turns, or caching them, is what keeps that flat.
Are these prices reliable?
They are list prices as of the date shown and they will be wrong eventually — providers cut prices, retire models and change tiers without notice. That is exactly why every figure here is an editable field: correct it from the provider's own page rather than trusting the preset.
Does the LLM API Cost Calculator cost anything?
No charge and no sign-up. There is no free tier to run out of because there is no paid tier — inputtesthub.com is funded by advertising rather than by metering the tool.
Does anything I enter leave my computer?
No. The LLM API Cost Calculator runs entirely in your browser using JavaScript. Nothing is transmitted, logged or stored, which you can verify yourself in the Network tab of your browser's developer tools.
Can I check the maths myself?
It uses cost per call = (uncached input × input price + cached input × input price × cache rate + output × output price) ÷ 1,000,000. The full working is printed under the result, so you can follow every step rather than trusting a black box.
What problem does the LLM API Cost Calculator solve?
In practice it gets used for three things: costing a feature before building it. Showing what prompt caching would save on an agent loop. Comparing models on your own traffic rather than on a benchmark. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
Is there anything the LLM API Cost Calculator cannot do?
List prices before committed-use or volume discounts, and before the extra billing that reasoning tokens, image inputs, web search and code execution attract on most platforms. Knowing where a tool stops being trustworthy matters more than the cases where it works.
What figures does the LLM API Cost Calculator work from?
Output is Typically 4 to 5 times the input price. Cache reads is Roughly a tenth of the input price. Conversations is The whole history is resent on every call. These are printed on the page itself, so you do not have to take them on trust.
How precise is the result?
The calculation runs in double precision and the result is shown to ten significant figures, so converting a value and converting it back returns the original. What is displayed is rounded for readability; what is copied is not.

Related developer tools

All 92
01

Unix Timestamp Converter

Converts Unix epoch timestamps to human-readable dates in any time zone, and dates back to…

02

Subnet Calculator

Calculates network address, broadcast, usable host range, wildcard mask and host count from an…

03

IP Address Converter

Converts IPv4 addresses between dotted decimal, integer, binary and hexadecimal notation.

07

Context Window Planner

Works out how many conversation turns fit in a context window once the system prompt, tools…

08

Embedding Cost Estimator

Estimates what embedding a corpus costs, how many chunks it produces, and how much vector…

09

JSON Formatter

Formats, indents and validates JSON with precise error positions, key sorting and a…

10

JSON Validator

Checks whether JSON is valid and reports the exact line, column and reason for the first error…