AI API Cost Calculator
Estimate request costs for OpenAI, Anthropic, and Google, and compare models at the same usage.

A single user request can trigger several model calls, tool calls, or image processing. Long responses and retries also increase spending. When budgeting for an AI API, it helps to measure cost per successfully completed task: how much the service spent to give the user the result they needed.
First, check what your provider charges for and which billing units it uses. Alongside API fees, account for the application that uses the API. Include the following components where they apply to your service:
For a text API billed by token usage, add the costs of regular input, cached input, and output. For each component, divide the token volume by the billing unit in the rate sheet, then multiply by the corresponding rate. Add the cost of tools and other billed operations.
Add retry costs only if those calls are not already included in the token and operation volumes. Then add infrastructure costs. Divide the total by the number of API calls and, separately, by the number of successfully completed tasks. Cost per task helps show whether inexpensive calls are worthwhile when their results often need another attempt or manual correction.
Suppose a service makes 10,000 API calls per month, excluding retries. Each call averages 1,200 input tokens and 300 output tokens. Of the input, 400 tokens form a repeated context; they are billed as cached input in half of the calls. Assume hypothetical rates per million tokens of 2 currency units for regular input, 0.5 for cached input, and 8 for output.
If a tool is called once in each of 1,000 of these API calls and costs 0.01 currency unit per tool call, it adds another 10 currency units. The preliminary total is 55 currency units before retries and infrastructure, including storage.
Start with the largest cost component and change one factor at a time. For each change, check whether quality holds up on the tasks your service handles.
For each call, record the model identifier, input and output volume, cache hit status, number of tool calls, retries, final status, and estimated cost. Grouping these records by feature and customer helps compare spending and identify the share attributable to retries and unsuccessful calls.
Build a small scenario table for the forecast: traffic volume, average and high usage per call, the expected share of successful tasks, and applicable rates. Compare the forecast with actual spending, and assess application changes by their effect on cost and quality.
For an initial estimate, use our AI API cost calculator: https://achugunov.ru/tools/ai-api-cost
Estimate request costs for OpenAI, Anthropic, and Google, and compare models at the same usage.
I’ll check whether AI is actually useful for the task, compare suitable models, and estimate the running cost.

A practical framework for estimating AI integration costs through project scope, cost categories, risks, scenarios, and total cost of ownership.

Compare API pricing, context limits, image and video support, benchmark claims and practical tradeoffs using official documentation.

An evidence-based comparison of GPT-6 Astra, Gemini 3.8 Flash, and Claude Fable 5.1 for reasoning, coding, research, agents, and API cost.