API Cost Calculator

Estimate AI API costs based on model pricing, token usage, requests, and monthly volume.

Default is 30 days. Change to 28, 30, or 31 to match your billing cycle.

Cost per request

$0.000450

Input $0.000150 + output $0.000300

Daily cost

$0.0450

100 req/day × cost/req

Monthly cost

$1.35

30 days/month

Annual cost

$16.20

Monthly × 12

Cost Breakdown

Input tokens / request1,000
Output tokens / request500
Input cost / request$0.000150
Output cost / request$0.000300
Cost per request$0.000450
Monthly requests3,000
Monthly input tokens3,000,000
Monthly output tokens1,500,000
Monthly tokens (total)4,500,000
Monthly cost$1.35
Annual cost$16.20

Model Comparison

Same workload: 1,000 input + 500 output tokens per request, 100 requests/day, 30 days/month, priced across every model.

ModelProviderInput $/MOutput $/MCost / ReqMonthlyContext
GPT-4.1 NanoOpenAI$0.1$0.4$0.000300$0.90001.0M
GPT-4.1 MiniOpenAI$0.4$1.6$0.001200$3.601.0M
GPT-4.1OpenAI$2$8$0.006000$18.001.0M
GPT-4o MiniSelectedOpenAI$0.15$0.6$0.000450$1.35128K
Claude Haiku 4.5Anthropic$1$5$0.003500$10.50200K
Claude Sonnet 4.6Anthropic$3$15$0.0105$31.50200K
Claude Opus 4.8Anthropic$5$25$0.0175$52.50200K
Gemini 3.1 Flash-LiteGoogle$0.25$1.5$0.001000$3.001.0M
Gemini 3 Flash PreviewGoogle$0.5$3$0.002000$6.001.0M

Per-request math

Cost per call broken down into input and output. No hidden assumptions.

Monthly + annual projection

Pick your days-per-month and instantly see monthly and annualised cost.

Side-by-side models

Compare GPT-4o, Claude 3.5 Sonnet, Gemini 1.5 Flash, and friends.

Dynamic Cost Insights

Each request costs about $0.000450 on GPT-4o Mini.
At 100 requests/day, you spend roughly $0.0450 per day.
Projected monthly cost over 30 days is $1.35.
Annualised that is approximately $16.20.
Monthly token volume: 4,500,000 tokens across 3,000 requests.
Real costs vary with retries, system prompts, caching, batch discounts, and provider price changes.

What Is API Pricing?

AI providers charge per million tokens for both input and output, with separate rates for each.

Pricing scales linearly with volume; there's no fixed monthly fee on standard pay-as-you-go tiers.

Some providers offer batch APIs, cache hits, or volume discounts that can cut effective price by 50% or more.

Enterprise tiers may bundle dedicated capacity or fixed throughput with different pricing.

How AI API Costs Work

Each API call counts the tokens in your prompt and the tokens in the response.

Total cost = (input tokens × input rate) + (output tokens × output rate), prorated per million.

Multiply by your request volume to project daily, monthly, and annual spend.

Cost grows with longer prompts, longer responses, more requests, or pricier models.

Input vs Output Pricing

Output is usually 2–4× more expensive than input.
Long-context models often cost more per token than short-context siblings.
Cached input can be 50–90% cheaper on supported providers.
Batch APIs typically offer ~50% discounts on async workloads.
Image, audio, and tool tokens add to the input total.
System prompts count as input on every call, and they add up quickly.

Monthly Cost Formula

inputCost = (inputTokens / 1,000,000) × inputRate
outputCost = (outputTokens / 1,000,000) × outputRate
costPerRequest = inputCost + outputCost
dailyCost = costPerRequest × requestsPerDay
monthlyCost = dailyCost × daysPerMonth
annualCost = monthlyCost × 12

Reducing AI Costs

Switch to a smaller model when quality permits, such as Haiku, Flash, or 4o Mini.
Cache reusable prompts and retrieved context.
Use batch APIs for non-interactive workloads.
Trim system prompts and tool definitions to the essentials.
Shorten outputs with explicit length limits or response schemas.
Route easy requests to cheap models and hard requests to flagship models.

Limitations

Vendor pricing changes. Verify against live provider docs.
Cache hits, batch discounts, and provisioned tiers are not modelled by default.
Image, audio, and tool-use tokens are not included unless added to your input estimate.
Real cost depends on retries, streaming overhead, and rate-limit handling.
Fine-tuned models and dedicated capacity may use different pricing.
All calculations run locally in your browser. No data is uploaded.

Frequently Asked Questions

AI API pricing usually charges per million tokens, with separate rates for input (the prompt you send) and output (the model's response). Costs scale with usage volume.
Cost estimates are based on publicly listed standard pay-as-you-go pricing. Vendor pricing changes frequently and discounted tiers, cached inputs, and batch APIs are not included unless you enter custom rates. Always verify with live provider documentation before relying on these figures for billing or procurement.