An OpenAI token calculator that counts your real prompt
This OpenAI token calculator turns a prompt into money. Paste the text you send with each request and it counts the tokens exactly with the model’s own encoding, adds the output you expect, applies OpenAI’s price for the model and processing tier, and multiplies by your traffic — per request, per day and per month.
It knows the prices on OpenAI’s API pricing page as checked on 14 October 2026, including cached input, cache writes, long-context rates and the Batch, Flex, Fast and Ultrafast tiers. A comparison table ranks every listed model for the same workload, so you can see what a cheaper model would save. Image inputs are counted with OpenAI’s published formula for the models that have one.
How to estimate your OpenAI API bill
- Paste the prompt you send with every request — or choose Type a token number.
- Pick the Model and the Processing tier; tiers OpenAI does not offer for that model are greyed out.
- Enter Output tokens per request and, if you use prompt caching, the Cached input share.
- Add Images per request with their size and detail level if you send pictures.
- Set Requests per day and Days per month, then compare models in the table below.
OpenAI Token Calculator features
Exact input tokens
The prompt is tokenized with o200k_base or cl100k_base — the same engine as the LLM token counter.
Dated price table
40 models and five processing tiers from OpenAI’s pricing page, with the check date shown.
Caching done right
Cached reads and cache writes are billed at their own rates instead of the full input price, as OpenAI’s caching guide describes.
Exact arithmetic
Costs are computed in whole units of $0.0000000001, so totals carry no rounding drift.
Image tokens
OpenAI’s patch and tile formulas for vision input — and no number at all where OpenAI publishes no formula.
Your currency
Type a rate to see ₹, £ or € next to dollars; no exchange rate is fetched or guessed.
The formula
OpenAI prices text by the million tokens, with separate rates for input, cached input, cache writes and output. For one request:
cost = (uncached input × input price + cached input × cached price + cache writes × write price + output × output price) ÷ 1,000,000
Then daily cost = cost × requests per day and monthly cost = daily cost × days. Requests whose input is over 272,000 tokens use the long-context prices where OpenAI lists them. Reasoning models think in hidden tokens that are billed as output, so set the output figure generously for them. The result is an estimate for planning, not a quote: your invoice follows the usage OpenAI records.
Worked example
The example prompt — a bookshop support assistant with order details and a customer question — is 112 tokens with o200k_base. With gpt-5.4-mini at Standard prices ($0.75 input and $4.50 output per 1M tokens) and 300 output tokens:
- Input: 112 × $0.75 ÷ 1,000,000 = $0.000084
- Output: 300 × $4.50 ÷ 1,000,000 = $0.00135
- Per request: $0.001434 · at 1,000 requests a day: $1.434 · over 30 days: $43.02
Output dominates: shortening answers usually saves more than trimming the prompt. Trimming still helps on long prompts — the prompt optimizer shows the exact tokens saved.
Batch, Flex, Fast and caching
OpenAI’s caching guide gives the trade-off: writing a prefix once and reusing it once costs 1.35× its ordinary price, and one write plus nine reads costs 2.15× instead of 10×. Regional data-residency endpoints add 10 % for models released from 5 March 2026, which this calculator does not include.
| Option | What it changes | Good for |
|---|---|---|
| Batch | Half the Standard price on most models; results within 24 hours | Bulk classification, evaluations, back-office jobs |
| Flex | Batch-level prices in exchange for slower responses and occasional unavailability (beta, some models) | Evaluations, data enrichment, background work |
| Fast / Ultrafast | Higher prices for faster responses (Priority was renamed Fast on 30 July 2026) | Latency-critical products |
| Cached input | Reused prompt prefixes billed at the cached rate — 0.1× input on most GPT-5.6 and later models | Long system prompts sent with every request |
| Cache writes | GPT-5.6 and later charge 1.25× the input price when a prefix is written | Prefixes reused at least a few times |
Image tokens
Newer models cover an image with 32 × 32 pixel patches and multiply the patch count by a model factor — a 1024 × 1024 image at high detail is 1,024 patches × 1.2 = 1,229 tokens on gpt-6-astra, OpenAI’s own example. GPT-4o, GPT-4.1 and GPT-5.1 use 512-pixel tiles plus a base charge instead (765 tokens for the same image on GPT-4o). OpenAI publishes no formula for some models, such as gpt-6-sol, and the calculator then leaves images out rather than guessing.
OpenAI Token Calculator FAQ
How do I calculate OpenAI API cost per request?
Multiply input tokens by the input price and output tokens by the output price, each per million tokens, and add them. This OpenAI token calculator does it for you, with the exact token count of your prompt.
Are these prices current?
They were copied from OpenAI’s API pricing page on 14 October 2026, and the date is shown under the table. OpenAI changes prices and adds models, so check the page before you commit a budget; the Custom option lets you type any price.
Does the count include the hidden chat formatting?
No — it counts the text you paste. Each message adds a few tokens for its role and boundaries, and tools, schemas and files add more. For an exact figure, OpenAI’s input-token endpoint counts the whole request.
Which tokenizer do GPT-6 models use?
OpenAI has not said. The calculator uses o200k_base, the encoding of every GPT-5 model in OpenAI’s tiktoken library, and marks the figure with an asterisk.
How much does Batch save?
On most models the Batch price is half the Standard price, for jobs that can wait up to 24 hours. Pick Batch under Processing to see the exact figure.
Can I see the cost in rupees, pounds or euros?
Yes. Type the currency code and today’s rate; the page shows both amounts. It never fetches a rate, so the conversion is exactly as current as the number you type. For live rates, use the currency converter.