AI API COST CALCULATOR

AI API cost calculator for input and output tokens.

A headline price is not a workload budget. Enter the token mix your application actually produces, choose a listed model, and see the estimated USD cost for one request and a monthly request volume.

Create an account
01

Calculate input and output separately

AI APIs normally charge input and output at different rates. The basic estimate is (input tokens ÷ 1,000,000 × input rate) + (output tokens ÷ 1,000,000 × output rate). Keeping the two sides separate prevents a short prompt with a long answer from looking artificially cheap.

02

Use a representative token mix

Measure a small sample of successful requests instead of guessing from characters or message count. Include system instructions, conversation history, retrieved context, tool results, and the assistant output when estimating production traffic.

03

Account for cache, retries, and failure policy

Prompt caching, retries, and provider-specific billing can change the final total. Use the calculator as a transparent baseline, then reconcile it against the request-level usage ledger and your application's retry behavior.

04

Turn one request into a monthly budget

Multiply the blended request estimate by expected successful requests. Add a separate allowance for retries and long-tail workloads, then use project keys, balance alerts, and hard caps to keep the real spend close to the budget.

INTERACTIVE ESTIMATE

Calculate a real request.

Choose a listed model, enter the tokens your app sends and receives, and adjust the monthly volume. The estimate stays in USD and keeps input and output visible.

Formula(input ÷ 1M × input rate) + (output ÷ 1M × output rate)

Estimated cost$0.416$416.00 / month at 1,000 requests

Planning estimate only. Reconcile production usage with the live pricing page and request ledger.

THE BASELINE FORMULA

Model the cost your product actually creates.

Start with successful requests, then add an explicit retry and long-context allowance. Prices are USD per one million tokens.

input_cost = input_tokens / 1_000_000 * input_rate
output_cost = output_tokens / 1_000_000 * output_rate
request_cost = input_cost + output_cost
monthly_cost = request_cost * successful_requests

COMMON QUESTIONS

What developers ask

What is the AI API cost formula?

Estimated cost = (input tokens ÷ 1,000,000 × input price) + (output tokens ÷ 1,000,000 × output price). Add cache, retries, and other applicable charges separately when the provider bills them.

Are input and output tokens priced the same?

Usually not. Output tokens are often priced higher, so calculate both sides separately using the current model rate.

Does this calculator show an invoice total?

No. It is a planning estimate in USD. The applicable published model rate, usage record, exchange rate, payment method, and billing rules determine the final account charge.

How can I estimate monthly AI API spend?

Measure average input and output tokens per successful request, multiply the blended cost by expected requests, and add a conservative allowance for retries and unusually long jobs.

Where can I verify the current model prices?

Use the live WorldGate pricing page and the individual GPT or Claude model pages before funding or comparing a production workload.

Lower model cost. Clearer usage.

Start with one WorldGate API key.

Start building