Skip to tool
JoeLucky

Click ★ on a tool to save it

Tool Categories

Base64 Encoder/DecoderJSON Tree ViewerHOTJWT Encoder/DecoderUUID GeneratorURL Encoder / DecoderJSON to CSVCSV to JSONJSON to YAMLYAML to JSONJSON to XMLXML to JSONCSV to YAMLYAML to CSVJSON FormatterYAML FormatterXML FormatterHTML FormatterCSS FormatterRegex TesterHash GeneratorCron ParserHTML Entity Encoder/DecoderNumber Base ConverterURL Parser / Query InspectorCSV Viewer/ValidatorMarkdown PreviewSQL FormatterMermaid Live EditorLLM API Cost CalculatorNEWLLM VRAM CalculatorNEWRAG Chunk VisualizerNEWCloud Storage Cost Calculator (S3, R2, B2)NEWSLA Uptime CalculatorNEW
JoeLucky

Practical online tools, all in one place

Privacy PolicyTerms of Service

© 2026 JoeLucky®. All rights reserved.

  1. JoeLucky
  2. /Developer
  3. /LLM API Cost Calculator

LLM API Cost Calculator

Compare per-request and monthly API costs across OpenAI, Anthropic and Gemini, with the price check date.

Report

SIMILAR DEVELOPER

View all
LLM VRAM Calculator

Estimate the VRAM an LLM needs and check whether it fits on your GPU.

Open →
RAG Chunk Visualizer

Paste a document to see RAG chunking and embedding cost estimates live. Your text is never uploaded.

Open →
Currency Converter

Convert between world currencies, several at once. Rates update daily and are for reference only.

Open →

💬 Comments

?

No comments yet. Be the first!

WHAT IS LLM API COST CALCULATOR?

The LLM API Cost Calculator turns tokens per request and requests per day into per-request, monthly and yearly cost, and compares several OpenAI, Anthropic and Google Gemini models side by side. Formula: request cost = uncached input × input price + cache-read × cache price + cache-write × write price + output × output price (all prices per million tokens). It supports prompt caching, Batch/Flex/Fast, long-context pricing and custom models, with price sources and the verification date shown under the tool.

How to use?

  1. Enter input and output tokens per request and requests per day; if unsure, paste a sample text to get a token range.
  2. Pick the processing mode (Standard, Batch, Flex, Fast) and, if you use prompt caching, the cache-read and cache-write shares.
  3. Tick the models to compare and add a custom model with your own quote if needed.
  4. Read the table sorted by monthly cost, copy it or download the CSV, and watch the long-context, price-change and out-of-date labels.

Notes

  • Example: with Sonnet 5.5, 2,000 input and 500 output tokens per request and 1,000 requests a day, one request costs about $0.009 and a 30-day month about $270; the real prices are those in the verified data shown under the tool.
  • Prices are hand-maintained static data with a warning after 30 days without verification; tax, negotiated pricing, cloud-marketplace prices and add-ons such as tools or search are not included.
  • The text-based token estimate is only a range; use the usage numbers from the API for exact counts, and include reasoning tokens in the output.
  • Everything is calculated in your browser and no paid API is called.

Frequently asked questions

How is LLM API cost calculated?

Request cost = uncached input tokens × input price + cache-read tokens × cache price + cache-write tokens × write price + output tokens × output price, with every price quoted per million tokens. Multiplying by requests per day and days per month gives the monthly and yearly cost.

Are the prices live? Where do they come from?

No. Prices are static data kept in the site's code and updated by hand against each vendor's official pages. The sources and a "verified on" date are listed under the tool, and a "may be out of date" warning appears after 30 days. You can also add a custom model with your own quote.

How do I fill in the prompt-caching shares?

"Share served from cache" is the part of each request's input read from the cache. Anthropic also has a "share written to cache", which usually costs more than ordinary input. OpenAI and Gemini have no separate write price, so written tokens are billed as ordinary input. The two shares cannot add up to more than 100%.

What are the Batch, Flex and Fast modes?

Batch and Flex trade a lower price for slower or queued processing, while Fast pays more for quicker output. Each vendor supports different modes and multipliers; a model that does not support your chosen mode is listed as skipped. Where OpenAI's page only says "about 50%" or "about 2×", the table marks the result as approximate.

What is long-context pricing and how is the threshold decided?

Some models switch the whole request to a higher rate once a single prompt passes a certain length. The threshold differs by model and is applied per request, so enter the input tokens of ONE request, not the monthly total. Models priced at the long-context rate are labelled in the result table.

How do I get token counts? How accurate is the text estimate?

The most accurate source is the usage field in each API response or the vendor's own token-counting endpoint. This tool's text estimate gives only a range (about 4 characters ≈ 1 token in English, about 1 character ≈ 1 token in CJK), and tokenizers can differ noticeably; newer Claude models produce about 30% more tokens for the same text. Remember that output tokens include reasoning (thinking) tokens.

Why does the result differ from my real invoice?

Usual reasons: add-on charges such as tool calls and web search, reasoning tokens, tax, separate cloud-marketplace pricing (Bedrock, Vertex and similar), regional uplifts, negotiated or committed-use discounts, and real token counts that differ from your estimate. This tool only calculates token cost at public standard prices.

Is anything I enter sent anywhere?

No. Everything is calculated in your browser. Pasted text is only used to estimate tokens locally and is never sent to a server, and no paid API or model provider is called.

Processing mode

Prompt caching

%
%
Cache lifetime (Anthropic write price)
Gemini explicit-cache storage (optional)

Estimate tokens from text

Paste a sample prompt or reply for a rough range (not an exact count from any vendor tokenizer).

Models to compare

OpenAI

Anthropic

Google Gemini

The cheapest model saves $361.50 per month versus the most expensive.
Model
ModelPer requestPer 1,000Per monthPer yearOutput share
Claude Haiku 5.5Lowest
new tokenizer: about 30% more tokens for the same text
$0.000450$0.450$13.50$162.0056%
Gemini 2.5 Flash
audio input is priced differently; text / image / video prices are used here
$0.00185$1.85$55.50$666.0068%
GPT-5.4 mini
$0.00375$3.75$112.50$1,350.0060%
Gemini 2.5 Pro
$0.00750$7.50$225.00$2,700.0067%
Claude Sonnet 5.5
new tokenizer: about 30% more tokens for the same text
$0.00900$9.00$270.00$3,240.0056%
GPT-5.4
$0.0125$12.50$375.00$4,500.0060%

Cost breakdown of one request — Claude Haiku 5.5

Uncached input$0.000200
Cache read$0.00
Cache write$0.00
Output$0.000250

Price sources and verification

Data verified on 2026-10-20

  • Anthropic — Pricing(page shows no date)
  • OpenAI — API pricing(page shows no date)
  • Google — Gemini API pricing(page dated 2026-10-16)

This tool is not affiliated with OpenAI, Anthropic or Google. Prices are each vendor's public standard API list prices in USD, excluding tax, negotiated pricing, cloud-marketplace pricing (Bedrock, Vertex, etc.) and add-ons such as tool calls or web search.

Formulas and assumptions
  • Request cost = uncached input × input price + cache-read × cache price + cache-write × write price + output × output price (all prices per 1M tokens).
  • Long-context pricing is decided per request from the prompt length; thresholds differ by model (for example 100K for Haiku 5.5, 272K for OpenAI, 200K for Gemini Pro).
  • Use the usage numbers returned by each API as the source of truth; the text estimate is only a range. Output tokens must include reasoning (thinking) tokens.
  • Batch, Flex and Fast are vendor processing modes; where an OpenAI page only says "about 50%" or "about 2×", the result is marked as approximate.
  • Everything is calculated in your browser; no paid API is called.