GEEDITORTools

API Cost Calculator

Your tokens. Your rates. Clear costs.

Custom pricing

USD / 1M

Prices per 1M tokens · USD

Include all input tokens, including cache reads and writes.

Include billed reasoning tokens. Do not add them again if your API total already includes them.

Caching & extra costs

Cache reads and writes are parts of total input, not extra input. Their sum cannot exceed the input total.

Prices per 1M tokens · USD

Add known tool or service charges here. This field is your assumption, not an automatic tool-fee calculation.

Plan your usage

01 / How it works

From tokens to a useful estimate

01

Start with one typical request

Enter your input and output prices per million tokens. Then add token counts from a typical request, paste usage JSON, or estimate the tokens in your text.

02

Count cached input once

Put cache reads and writes inside the input total. The calculator charges each part at its own rate, then adds the output cost.

03

Scale with real usage

Set daily requests and active days. Extra requests cover retries or repeated calls as a simple allowance. Compare the result with your monthly budget.

The calculation

Cost = (uncached input × input rate + cache reads × read rate + cache writes × write rate + output × output rate) ÷ 1,000,000 + other request costs.

A few things worth knowing

Will this match my API invoice?

Not necessarily. The arithmetic follows your token counts and rates, but bills can also include tools, storage, media, discounts and regional charges. Actual usage is a better starting point than an unsent prompt.

Is my prompt sent to an AI service?

No. This calculator processes text and usage JSON in your browser. It does not call an AI API or save your prompt. Other scripts installed by the site owner are outside its control.

Why can the same text have different token counts?

Models split text differently. A local o200k_base count is a reference, not a universal count for Claude, Gemini or every OpenAI model. Use provider-reported usage when precision matters.