AI API Cost Calculator

Compare inference costs across GPT-5, Claude 4.5, Gemini 3, and more.
Now with agentic loops, caching, and reasoning tokens

Last Updated: February 6, 2026

Configure Your Workload

tokens
tokens

Agentic Loop Configuration

In 2026, most AI applications use multi-step "agentic loops" rather than single prompts. Calculate costs for workflows like: "5 research steps + 1 summary step = 6 total steps."

1 step

Context Caching (Save up to 90%)

Modern APIs (Anthropic, Gemini, OpenAI) offer context caching that reduces input costs by up to 90% for repeated data. Set your cache hit rate to see potential savings.

0%

Reasoning models (like OpenAI's o-series) "think" before responding. These "thinking tokens" cost extra money and are often missed by older calculators. Enable reasoning to see the true cost.

Cost Comparison

GPT-5

OpenAI
$0.1155
Total Cost
Input tokens$0.0875
Output tokens$0.0280

Claude 4.5 Sonnet

Anthropic
$0.1800
Total Cost
Input tokens$0.1500
Output tokens$0.0300
Lowest

Gemini 3 Pro

Google
$0.0825
Total Cost
Input tokens$0.0625
Output tokens$0.0200

Context Caching Savings

Enable context caching to save up to 90% on repeated inputs

Comparison Heat Map

Visual comparison showing which model performs best for different use cases

Model
Low Latency
Fast response times, minimal processing
High Intelligence
Complex reasoning, large context, advanced capabilities
Cost Optimized
Lowest total cost with caching
High Volume
Best for bulk processing, high throughput
GPT-5
OpenAI
#2
2nd
#2
2nd
#2
2nd
#2
2nd
Claude 4.5 Sonnet
Anthropic
#1
Best
#3
3rd
#3
3rd
#3
3rd
Gemini 3 Pro
Google
#3
3rd
#1
Best
#1
Best
#1
Best
Best for this scenario
Good option
Average
Not recommended

Detailed Breakdown

ModelInput PriceOutput PriceContextTotal Costvs. Lowest
Gemini 3 ProGoogle
$1.25/1M$10.00/1M2.0M$0.0825Lowest
GPT-5OpenAI
$1.75/1M$14.00/1M256.0K$0.1155+$0.0330 (40%)
Claude 4.5 SonnetAnthropic
$3.00/1M$15.00/1M200.0K$0.1800+$0.0975 (118%)

Developer Code Snippet

Copy-paste code to integrate Gemini 3 Pro into your application

import google.generativeai as genai

genai.configure(api_key="your-api-key")
model = genai.GenerativeModel('gemini-3-pro')

response = model.generate_content(
    "Your prompt here",
    generation_config={
        "max_output_tokens": 2000
    }
)

print(response.text)

💡 Replace "your-api-key" with your actual API key. Adjust tokens and parameters as needed.

Compare AI API Costs Across All Major Providers

Make informed decisions about which AI API to use by comparing real-time pricing across GPT-5, Claude 4.5, Gemini 3, and more. Our comprehensive calculator helps you estimate costs for text, image, video, and audio processing, including agentic loops, context caching, and reasoning tokens.

Accurate Pricing

Compare costs across 9+ AI models with up-to-date pricing for input, output, and cached tokens. Calculate total expenses including agentic workflows and reasoning overhead.

All Modalities

Estimate costs for text, image, video, and audio processing. Compare pricing across different input modalities to find the best solution for your use case.

Cost Optimization

Factor in context caching savings, agentic loop costs, and reasoning token overhead to get accurate total cost estimates for your AI applications.

Why Compare AI API Costs?

Choosing the right AI API can significantly impact your application's costs. With pricing differences of up to 20x between models, a thorough cost comparison is essential. Our calculator helps you:

  • Estimate costs before committing to a provider
  • Compare pricing across multiple models simultaneously
  • Factor in context caching and agentic workflows
  • Understand reasoning token overhead
  • Get developer code snippets for integration

Supported AI Models

Compare costs across major AI providers including OpenAI (GPT-5, GPT-5 Mini, o3), Anthropic (Claude 4.5, Claude 4 Opus), Google (Gemini 3 Pro, Gemini 3 Flash), xAI (Grok-4), and Meta (Llama 4 Maverick). Each model's pricing is calculated based on publicly available API rates.