LLM API Cost Calculator

Estimate LLM API costs based on input tokens, output tokens, requests and monthly usage. Compare the estimated cost of popular AI models and understand how token usage affects your API bill.

Quick Answer: LLM API cost is generally calculated from the number of input and output tokens multiplied by the model's price per million tokens. Input and output tokens usually have different prices, so both should be calculated separately.
LLM API COST CALCULATOR

LLM API Cost Calculator

Enter your token usage and select an AI model to estimate the cost of an API request and your projected monthly spend.

Tokens sent to the model.

Tokens generated by the model.

$2.00 input / $12.00 output per 1M tokens

Number of API calls using this token volume.

Cost formula: (Input tokens ÷ 1,000,000 × input price) + (Output tokens ÷ 1,000,000 × output price)
Estimated Cost Per Request
$0.0080

Based on the selected model and token usage

Input Cost $0.0020
Output Cost $0.0060
Total Tokens 1,500
Monthly Cost $80.00
Cost / 1,000 Requests
$8.00
Cost / 1M Requests
$8,000.00
Monthly Tokens
15M

LLM API Cost Comparison

Compare the estimated cost of the same token workload across popular LLM models.

Model Input / 1M Output / 1M Cost / Request Monthly

Prices are reference API rates in USD per million tokens. Actual billing may vary based on provider, pricing tier, caching, batch processing, long-context pricing, tools, multimodal inputs and other charges.

LLM Monthly Budget Planner

See how many API requests your monthly budget could support with the selected token usage and model.

Approx. Requests 12,500
Tokens Processed 18.75M

Budget estimates assume the same input/output token volume for every request.

Understanding LLM API Costs

Input tokens: These are the tokens sent to the model, including your prompt, system instructions and other request content.

Output tokens: These are the tokens generated by the model in response to your request.

Input and output are priced separately: Most commercial LLM APIs publish separate prices for input and output tokens. Output tokens are often more expensive.

Monthly cost: Your monthly bill depends on the number of API requests and the average number of input and output tokens consumed per request.

Why can my actual API bill be different?

Production API costs can include additional factors such as cached input tokens, batch pricing, long-context pricing, tool usage, multimodal inputs, search or grounding charges, and provider-specific pricing rules.

LLM API Cost Scenarios

Use common workload patterns to understand how token usage affects API spending.

Small Workload
1K input + 500 output

Suitable for simple prompts, classification and short responses.

Medium Workload
5K input + 2K output

Useful for document analysis, assistants and content workflows.

Large Workload
20K input + 5K output

More representative of large-context applications and agents.

Frequently Asked Questions

How is LLM API cost calculated?

LLM API cost is generally calculated by multiplying input and output token usage by their respective prices per million tokens.

Are input and output tokens priced differently?

Yes. Most commercial LLM providers publish separate input and output token prices, and output tokens are often more expensive.

How much does 1 million LLM tokens cost?

There is no single price. The cost depends on the model, provider and whether the tokens are input, output or cached tokens.

How do I calculate my monthly LLM API cost?

Multiply the estimated cost of one request by the expected number of API requests per month. For more accurate planning, estimate input and output tokens separately.

Does this calculator include cached tokens?

The basic calculation uses standard input and output token pricing. Cached-token pricing can differ by provider and should be calculated separately when applicable.

Can I use this calculator for production budgeting?

It is useful for planning and estimates. Before finalizing a production budget, verify the provider's current pricing, usage tier, caching rules, tools and other applicable charges.

Does a cheaper model always mean lower API costs?

Not necessarily. A model that produces better results with fewer retries or shorter prompts can sometimes have a lower effective cost for a complete workflow.

Last reviewed: September 3, 2026. API prices can change. Always verify current pricing with the relevant provider before production budgeting.

This calculator provides estimates for planning and educational purposes. Actual API billing can vary according to model, tokenization, pricing tier, caching, batch processing, tools and other provider-specific charges.

Stay Updated with New Calculators

Get the latest AI tools and calculators directly in your inbox.