Estimate whether a request fits the model context and what it may cost per request, per day, and per month.
Saved only in this browser
When to use this
Use it before scaling a prompt or agent workload
Check the full request shape—content, instructions, tools, output, and safety buffer—before approving a model or monthly budget.
Default result
The default OpenAI GPT-5.4 mini scenario costs $0.0150 per request and $45.00 per month.
When to use this
Use it before a prompt, document, or agent workflow reaches volume
This calculator is for AI API prompts, RAG requests, long-document summaries, support bots, and agent workflows where context fit and token cost can change the architecture.
Default result
The server-rendered long-document example costs $0.0150 per request and $45.00 per month.
Input split
12,800 tokens input
12,800 tokens standard input and 0 tokens cached input.
Context headroom
346,000 tokens usable headroom
Headroom is measured after the selected safety buffer is reserved.
Monthly volume
42M tokens per month
Use this to compare usage tiers, budgets, and batch-processing options.
Worked example: long document summary cost
The default scenario uses 12,000 content tokens, 300 instruction tokens, 500 tool or schema tokens, and 1,200 expected output tokens. Total billable input is 12,800 tokens and total request size is 14,000 tokens.
With GPT-5.4 mini at $0.75 per 1M input tokens and $4.50 per 1M output tokens, input cost is 12,800 / 1,000,000 x $0.75 = $0.0096 and output cost is 1,200 / 1,000,000 x $4.50 = $0.0054.
Cost per request is $0.0150. At 100 requests per day for 30 active days, the monthly estimate is 3,000 requests x $0.0150 = $45.00.
The request uses 14,000 / 400,000 = 3.5% of the GPT-5.4 mini context window, so it fits comfortably with a 10% safety buffer before long-context pricing, latency, and truncation risk are considered.
How to estimate AI token cost
The calculator adds content tokens, instruction tokens, and tool or schema tokens to get billable input tokens. It then splits those input tokens into standard and cached input based on the cache-share assumption, adds output-token cost, and multiplies by request volume.
Cost per request equals standard input cost plus cached input cost plus output cost. Monthly cost equals cost per request times requests per day times active days per month.
How much of the context window will my prompt use?
Context-window use is the total request size divided by the model context window. Total request size includes input tokens plus expected output tokens. The fit recommendation also reserves a safety buffer for variable user text, retrieval chunks, tools, and output growth.
Should I count system prompts and tool schemas?
Yes. Stable instructions, tool definitions, JSON schemas, retrieval context, and wrapper text can quietly become a large part of every request. Count them separately so cost optimization does not focus only on the user-visible text.
How do cached input tokens change API cost?
Cached input can reduce cost when a stable prefix repeats across requests and qualifies for the provider's caching rules. Do not apply the cached-input price to the entire prompt unless the provider usage logs show that those tokens are actually cached.
When does long context become expensive?
Long context becomes expensive when the same large prompt runs many times, when output is also long, or when the provider charges differently above a context threshold. Check long-context pricing, latency, truncation, and quality before moving a large prompt into production.
Reference data used by the defaults
Topic
Reference value
Source
Date
Note
OpenAI GPT-5.5 pricing
$5.00 input, $0.50 cached input, $30.00 output per 1M tokens
This calculator uses editable token inputs and a rough text estimate only for planning.
All prices, context windows, output limits, cache behavior, and long-context rules should be verified on the provider page before you approve spend.
FAQ
How accurate is the token estimate from pasted text?
It is a planning estimate only. Exact token counts depend on the model tokenizer, tools, schemas, files, images, reasoning behavior, and provider accounting. Use the provider token counting API or usage dashboard before budgeting.
Should system prompts and tool schemas be counted?
Yes. Instructions, developer messages, tool definitions, JSON schemas, retrieved context, and hidden wrapper text can all increase input tokens. This calculator separates those inputs so they are not forgotten.
Why include expected output tokens?
Output tokens affect both cost and context fit. Long answers, code generation, reasoning traces, or structured JSON can make output spend larger than the prompt spend.
What is a safe context-window buffer?
A 10% to 20% buffer is a practical planning range for variable user text, retrieval chunks, formatting, tool schemas, and longer-than-expected output. Use a larger buffer for agent workflows.
When does caching matter?
Prompt caching matters when a large part of the input repeats across requests, such as stable instructions, long reference material, or tool schemas. It should not be assumed for every token.
Why are all model prices editable?
Provider prices, model names, access tiers, data residency, batch discounts, and long-context charges can change. Enter the current price from the provider before using the estimate.
Privacy choices
Choose your cookie settings
We use necessary browser storage to keep Useful Atlas working and self-hosted Plausible for cookieless aggregate statistics. Optional Google Analytics and future marketing tools stay off unless you allow them.
Necessary storage
Required for privacy choices, theme preference, security, and requested site features.
Optional Google Analytics
Used only after consent to measure visits and improve calculators, guides, and navigation.
Necessary storage
Required for core site functions and privacy preference storage.
Always on
Optional analytics
Controls Google Analytics and similar optional tools. Plausible remains cookieless and does not set tracking cookies.
Advertising and partner tracking are not active. Future advertising or affiliate tools must be added behind consent controls and documented before they are enabled.