# AI API cost calculator

Estimate KeepRouter model costs with live customer prices. Calculate input, output and cached tokens, images, video seconds or audio duration before creating a key.

## How to calculate your API bill

Use the published price for the exact model ID and endpoint you plan to call. This calculator reads KeepRouter's current customer price list. It estimates model usage charges in USD; it does not represent another provider's direct pricing. The estimate excludes top-up processing fees, taxes and any application infrastructure costs.

### Text and embedding tokens

Per-request cost = (total input tokens − cached input tokens) × input rate + cached input tokens × cache rate + output tokens × output rate. Multiply that cost by the number of requests for a workload estimate. Cached input is part of total input, not an additional prompt. If you have no confirmed cache hit, set cached input to zero. An unavailable cached price is unknown, not a zero-dollar rate.

For example, a hypothetical model priced at $1 per million input tokens, $0.10 per million cached input tokens and $3 per million output tokens would cost $0.0020 for 2,000 total input tokens, 1,000 cached input tokens and 300 output tokens. At 10,000 requests the estimate is $20. These numbers illustrate the formula; select a model above for its current price.

### Images, video and speech

Image estimates follow the selected model's published billing unit: a flat per-image charge, or separate input and output token charges for token-priced image models. Video estimates use seconds of generated video and the model's per-second rate. Speech estimates combine any published input-token charge with seconds of returned audio. Duration quantities are not token counts. Check the model page before submitting: supported durations and required reference media vary, and a budget estimate does not validate a generation request.

For example, a hypothetical video rate of $0.10 per second gives $0.60 for a 6-second clip, or $60 for 100 such clips. The selected model's actual price, input requirements and allowed durations remain authoritative.

## From estimate to a working request

1. Open the [model catalog](/models) and confirm the precise model ID, endpoint, capability limits and current quote.
2. Start with the [free-model quickstart](/docs/quickstart) to check authentication without topping up.
3. For a paid model, create a key scoped to that model and add sufficient prepaid credit. A key restricted to `free` stays restricted after a top-up.
4. Use the request example on the model page. Compare the response usage and your console record with the estimate; actual usage can differ from your planned output length or cache reuse.

## Frequently asked questions

### Does a ChatGPT or Claude subscription cover these API charges?

This tool estimates KeepRouter API usage. A subscription purchased from a model maker is a separate product and does not supply KeepRouter prepaid credit. Choose a model and inspect its current customer price before calling it.

### Does changing the model preserve every feature?

No. Match the endpoint and model capability first. Streaming, tools, images and model-specific options need their own checks. A lower estimated price alone does not establish task quality or compatibility.

### Is a saved calculation a locked quote?

No. A shared link stores your model and quantities, while the calculator loads the currently published price. Prices can change. For a dated estimate, save the rates and calculation alongside the date.

### Can I compare official provider prices with KeepRouter prices?

Keep the two price lists separate. This tool uses KeepRouter's catalog; a provider's direct account can have different prices, caching rules, billing units or plan terms. Compare the same workload and feature requirements using each service's current official quote.

## Sources and next steps

- [Live KeepRouter model catalog](/models)
- [Machine-readable customer price list](/models.csv)
- [OpenAI SDK configuration](/use-cases/openai-sdk)
- [API error reference](/docs/errors)
- [Published billing and refund terms](/refund)

Method reviewed: 2026-09-23. Model prices are loaded separately from the live catalog.
