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

Lowest

Gemini 3 Flash

Google
$0.004350
Total Cost
Input tokens$0.003750
Output tokens$0.000600

Llama 4 Maverick

Meta
$0.0112
Total Cost
Input tokens$0.0100
Output tokens$0.001200

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
Gemini 3 Flash
Google
#1
Best
#2
2nd
#1
Best
#1
Best
Llama 4 Maverick
Meta
#2
2nd
#1
Best
#2
2nd
#2
2nd
Best for this scenario
Good option
Average
Not recommended

Detailed Breakdown

ModelInput PriceOutput PriceContextTotal Costvs. Lowest
Gemini 3 FlashGoogle
$0.07/1M$0.30/1M1.0M$0.004350Lowest
Llama 4 MaverickMeta
$0.20/1M$0.60/1M1.0M$0.0112+$0.006850 (157%)

Developer Code Snippet

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

import google.generativeai as genai

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

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.

Gemini 3 Flash vs Llama 4 Maverick: Complete Cost Comparison 2026

Compare pricing, features, and total cost of ownership between Gemini 3 Flash (Google) and Llama 4 Maverick (Meta). Find out which AI model offers the best value for your use case.

Pricing Overview

Gemini 3 Flash

  • Input: $0.07 per 1M tokens
  • Output: $0.30 per 1M tokens
  • Cached: $0.02 per 1M tokens
  • Context: 1,000,000 tokens

Llama 4 Maverick

  • Input: $0.20 per 1M tokens
  • Output: $0.60 per 1M tokens
  • Context: 1,000,000 tokens

Key Differences

Gemini 3 Flash is more affordable

63% cheaper input pricing

Llama 4 Maverick has larger context

1.0x more context capacity

Which Model Should You Choose?

Choose Gemini 3 Flash if:

  • You need Google's ecosystem and integrations
  • Cost efficiency is your primary concern

Choose Llama 4 Maverick if:

  • You prefer Meta's platform and tools

Frequently Asked Questions

Which is cheaper: Gemini 3 Flash or Llama 4 Maverick?

Gemini 3 Flash offers lower input pricing at $0.07 per 1M tokens compared to $0.20 for Llama 4 Maverick. However, total costs depend on your usage patterns, output requirements, and whether you can leverage context caching. Use the calculator above to estimate costs for your specific use case.

What's the difference in context window size?

Gemini 3 Flash supports up to 1,000,000 tokens, while Llama 4 Mavericksupports 1,000,000 tokens. Llama 4 Maverickcan handle longer documents and conversations without truncation, which is important for applications requiring extensive context.

Can I use both models together?

Yes, many developers use multiple AI models for different tasks. You might use Gemini 3 Flashfor high-volume, cost-sensitive operations and Llama 4 Maverick for tasks requiring specific capabilities. The calculator above helps you compare costs across both models.

How do I reduce API costs?

Both models support context caching, which can significantly reduce costs for repeated inputs. Gemini 3 Flash offers cached input at $0.02 per 1M tokens.Additionally, optimize your prompts, use streaming for faster responses, and consider agentic workflows to minimize token usage.