Trexmi
Calculator Ready

AI Token Cost Calculator

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.

Calculate input and output cost separately Use independent rates per million tokens Multiply per-request usage by request count Estimate input tokens from optional text
Rates are editable examples, not live provider prices. Verify current pricing and use provider-reported token usage for billing reconciliation.
INPUT Optional input text
0 chars0 words0 lines
Used to estimate input tokens when Input tokens is 0.

Tool settings

Ctrl / ⌘ + Enter
Estimated token cost Total input/output usage, per-request cost, and total cost from your supplied rates.
About the tool

What AI Token Cost Calculator does

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.

AI Token Cost Calculator separating input output and batch request costs
Model input, output, per-request, and batch costs with rates you control.

How to use

  1. Verify the rates. Find the exact model input and output prices and confirm that they are quoted per one million tokens.
  2. Enter per-request usage. Use measured token counts whenever available. Paste text only when an early input estimate is acceptable.
  3. Add request volume. Enter one for a single call or the projected number of equivalent calls.
  4. Calculate the total. Review input cost, output cost, cost per request, and combined batch cost.
  5. Reconcile later. Compare estimates with actual usage, caching categories, batch discounts, regional charges, and negotiated rates.
Built for the task

Why use AI Token Cost Calculator?

Focused controls, predictable output, and a workflow designed around this exact transformation.

01

Separate token prices

Apply different per-million rates to input and generated output.

02

Batch projection

Multiply per-request token assumptions across as many as one million requests.

03

Cost breakdown

See input, output, per-request, and total values instead of one unexplained number.

04

User-controlled rates

Avoid hardwiring a provider model or presenting changing prices as permanent.

Useful answers

Questions about AI Token Cost Calculator

Practical details about input, output, privacy, limits, and the best way to use this tool.

01 What formula does the calculator use?

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.

02 Are the displayed rates live provider prices?

No. Rates are user supplied and the defaults are examples. Always copy current pricing for the exact model, service tier, region, and feature.

03 Are token fields per request or total?

The form fields are per request. Trexmi multiplies them by Request count and displays the resulting total input and output usage.

04 What happens when I paste text?

If manual input tokens are zero, the text is estimated with the selected AI Token Counter profile. A nonzero manual token count takes priority.

05 Does the calculator include cached tokens?

No separate cache-read or cache-write category is modeled. Calculate those categories separately when the provider prices them differently.

06 Does it include images, audio, files, or tools?

Only the token counts you enter are priced. Use provider documentation to convert other modalities or count the complete structured request.

07 Can I use the total as an invoice prediction?

It is a planning estimate. Batch discounts, cache pricing, service tiers, taxes, credits, negotiated terms, failed requests, and rounding can change actual charges.

08 Why separate input and output rates?

Many model APIs charge different prices for prompt tokens and generated tokens. Combining them under one rate can materially distort projections.

Examples

Estimate one API request

Input and output prices are applied separately before the results are added.

Input
Input: 100,000 tokens; output: 20,000 tokens; requests: 1; input rate: $1/1M; output rate: $4/1M.
Output
Input cost: $0.100000; output cost: $0.080000; total: $0.180000.

Project ten repeated requests

The request count multiplies token usage before rates are applied.

Input
Input: 2,500 tokens/request; output: 800 tokens/request; requests: 10; input rate: $2.50/1M; output rate: $10/1M.
Output
Total input: 25,000; total output: 8,000; input cost: $0.062500; output cost: $0.080000; total: $0.142500.

Estimate input text for a batch

The text estimate is marked as heuristic and multiplied across the batch.

Input
Text: Summarize the following release notes in five bullets.; output: 100 tokens/request; requests: 1,000; input rate: $1/1M; output rate: $4/1M.
Output
Estimated input: 14 tokens/request; total input: 14,000; total output: 100,000; total cost: $0.414000.

Reject an empty calculation

At least one usage component is required so a zero result is intentional rather than accidental.

Input
Input tokens: 0; output tokens: 0; text: empty.
Output
Error: Enter input or output tokens, or paste text to estimate input tokens.

Input, output, and request volume

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.

Measured tokens beat character estimates

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.

Use current model pricing

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.

Limitations and omitted categories

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.