Separate token prices
Apply different per-million rates to input and generated output.
Start typing to search 227 tools.
Calculate estimated LLM input and output cost for one request or a batch using editable prices per million tokens and manual or text-estimated usage.
AI Token Cost Calculator estimates API spend from input tokens, output tokens, request volume, and editable rates per one million tokens. Input and output are calculated independently because providers commonly price them differently. The result shows total token volume, each cost component, estimated cost per request, and total cost.
The calculator does not fetch live prices or select a provider model. The default numbers are editable examples, not a pricing promise. When input tokens are zero and text is supplied, Trexmi uses the same transparent heuristic as AI Token Counter and marks the source as estimated. Manual provider-reported counts take priority.
Focused controls, predictable output, and a workflow designed around this exact transformation.
Apply different per-million rates to input and generated output.
Multiply per-request token assumptions across as many as one million requests.
See input, output, per-request, and total values instead of one unexplained number.
Avoid hardwiring a provider model or presenting changing prices as permanent.
Practical details about input, output, privacy, limits, and the best way to use this tool.
Input cost equals total input tokens divided by one million and multiplied by the input rate. Output cost uses the same formula with output values. Total cost is their sum.
No. Rates are user supplied and the defaults are examples. Always copy current pricing for the exact model, service tier, region, and feature.
The form fields are per request. Trexmi multiplies them by Request count and displays the resulting total input and output usage.
If manual input tokens are zero, the text is estimated with the selected AI Token Counter profile. A nonzero manual token count takes priority.
No separate cache-read or cache-write category is modeled. Calculate those categories separately when the provider prices them differently.
Only the token counts you enter are priced. Use provider documentation to convert other modalities or count the complete structured request.
It is a planning estimate. Batch discounts, cache pricing, service tiers, taxes, credits, negotiated terms, failed requests, and rounding can change actual charges.
Many model APIs charge different prices for prompt tokens and generated tokens. Combining them under one rate can materially distort projections.
Input and output prices are applied separately before the results are added.
Input: 100,000 tokens; output: 20,000 tokens; requests: 1; input rate: $1/1M; output rate: $4/1M.
Input cost: $0.100000; output cost: $0.080000; total: $0.180000.
The request count multiplies token usage before rates are applied.
Input: 2,500 tokens/request; output: 800 tokens/request; requests: 10; input rate: $2.50/1M; output rate: $10/1M.
Total input: 25,000; total output: 8,000; input cost: $0.062500; output cost: $0.080000; total: $0.142500.
The text estimate is marked as heuristic and multiplied across the batch.
Text: Summarize the following release notes in five bullets.; output: 100 tokens/request; requests: 1,000; input rate: $1/1M; output rate: $4/1M.
Estimated input: 14 tokens/request; total input: 14,000; total output: 100,000; total cost: $0.414000.
At least one usage component is required so a zero result is intentional rather than accidental.
Input tokens: 0; output tokens: 0; text: empty.
Error: Enter input or output tokens, or paste text to estimate input tokens.
For each direction, the formula is (tokens per request × request count ÷ 1,000,000) × price per million. Input cost and output cost are then added. Keeping both components visible helps identify whether long prompts, large generated responses, or request volume drives the projection.
Use representative averages and also test a high-usage scenario. A mean estimate alone can hide expensive long-tail requests.
Manual input and output counts should come from provider usage data or a model-aware counter whenever possible. If input tokens are unknown, optional text can produce an early planning estimate. Review it first with AI Token Counter, which shows the profile and range behind the likely value.
OpenAI explains request-aware counting in its token counting documentation. Tool schemas generated with JSON to OpenAI Function Schema or MCP Tool Schema Generator can add substantial input, so count the final request rather than only the user prompt.
Prices change and can differ by model, context length, batch mode, cache state, service tier, and platform. Copy the exact current figures from the provider. See the official OpenAI API pricing and Anthropic pricing pages when working with those services.
Keep the unit consistent. A price per thousand tokens must be converted before entering a field labeled per one million.
The calculator includes standard input and output token categories only. It does not separately model cached-input reads, cache creation, reasoning-token reporting differences, image or audio units, fine-tuning, storage, tool fees, web search, batch discounts, taxes, credits, currency conversion, or negotiated contracts.
Format large usage exports with JSON Formatter, then aggregate actual provider usage outside this single-scenario calculator for invoice reconciliation.