AI Cost Calculator

AI Prompt Cost Estimator

Paste your prompt to count tokens instantly and estimate cost across OpenAI and Anthropic models. Enter expected output length and monthly call volume to see monthly and annual projections.

Token count updates as you type. Uses GPT cl100k_base tokenizer.

Cost per API call

$0.005000

Monthly cost (1,000 calls)

$5.00

Annual cost (estimated)

$60.00

Input tokens0 × 1,000 calls = 0

Output tokens500 × 1,000 calls = 500,000

ModelGPT-4o (OpenAI)

Token estimates are approximate. Actual costs depend on exact token counts and may vary. Check provider pricing pages for current rates.

GPT-4.1 Nano (OpenAI) is the lowest-cost option for this prompt shape at $0.000200 per call -- saving roughly $4.80 per month compared to GPT-4o.

Model pricing reference

ModelInput / 1M tokensOutput / 1M tokens
GPT-4oOpenAI$2.50$10.00
GPT-4.1OpenAI$2.00$8.00
GPT-4.1 MiniOpenAI$0.40$1.60
GPT-4.1 NanoOpenAI$0.10$0.40
o3OpenAI$10.00$40.00
o4-miniOpenAI$1.10$4.40
Claude Opus 4Anthropic$15.00$75.00
Claude Sonnet 4Anthropic$3.00$15.00
Claude Haiku 4Anthropic$0.80$4.00

Prices in USD per 1 million tokens. Verify current rates at openai.com/api/pricing and anthropic.com/pricing.

Frequently asked questions

How does this tool count tokens in my prompt?
This tool uses the cl100k_base tokenizer, the same one used by GPT-4o and GPT-4 Turbo, to count tokens. Claude and Gemini use similar BPE-based tokenizers, so counts are a reliable approximation across all listed providers, typically within 5%.
Does this include system prompts or conversation history in the estimate?
Only the text you enter is counted. In a real application, your total input cost also includes your system prompt, previous conversation turns, and tool call outputs. For an accurate production estimate, paste your system prompt plus a sample user message together.
Why do output tokens cost more than input tokens?
Output generation is a sequential forward pass, the model computes one token at a time. Input tokens are processed in a single parallel pass. The sequential nature of generation is more compute-intensive, which is why output pricing is consistently higher across all providers.
Which model offers the best cost per call?
For most tasks, Claude Haiku 4 and GPT-4.1 Nano offer the lowest cost per call. For tasks requiring strong reasoning or longer outputs, GPT-4.1 Mini and Claude Sonnet 4 provide the best capability-to-cost ratio. The best-value card shown above reflects the lowest cost for your specific prompt and output length.
Can I use this to plan my monthly API budget?
Yes. Enter your typical prompt, set your monthly call volume, and the tool shows projected monthly and annual costs for every model side by side. For deeper model-specific projections, try the OpenAI Cost Calculator or Claude Cost Calculator.