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.
Your tokens. Your rates. Clear costs.
Prices per 1M tokens · USD
This is a character-based estimate, not a model tokenizer. Language and code can change the result substantially.
Add system instructions, history, message formatting or tool definitions not included in the text above.
Paste a text-response usage object. Only token counts are imported; your prices stay unchanged.
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.
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.
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.
Put cache reads and writes inside the input total. The calculator charges each part at its own rate, then adds the output cost.
Set daily requests and active days. Extra requests cover retries or repeated calls as a simple allowance. Compare the result with your monthly budget.
Cost = (uncached input × input rate + cache reads × read rate + cache writes × write rate + output × output rate) ÷ 1,000,000 + other request costs.
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.
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.
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.