Automate 3000+ Apps AI Support Chatbot Rent Cloud GPUs Smart Forms Free Rank In AI Search Track Your Rankings
Automate 3000+ Apps AI Support Chatbot
Free Email Marketing AI Data Analyst Funnels + Email Free AI Agent Workspace Build AI Apps No Code No-Code AI Agents
Home » AI Costs and Pricing » AI API Pricing

AI API Pricing Comparison: OpenAI, Anthropic, Google, and More

AI API pricing is measured in cost per million tokens, where one token equals roughly three quarters of a word. As of September 2026, budget models cost $0.10 to $0.25 per million input tokens and $0.25 to $1.00 per million output tokens. Mid tier models run $1 to $3 input and $3 to $15 output. Frontier models cost $10 to $15 input and $30 to $75 output. Prices have dropped over 95% since early 2023.

How Token Pricing Works

Every AI API provider charges by the token. Tokens are the smallest unit of text the model processes. In English, one token averages about 4 characters or 0.75 words. A 1,000 word document uses roughly 1,300 tokens. A typical chatbot conversation (user question plus AI response) uses 500 to 2,000 tokens total.

Input tokens and output tokens are priced separately. Input tokens include everything you send to the model: the system prompt, the conversation history, any retrieved context from your knowledge base, and the user's latest message. Output tokens are what the model generates in response. Input tokens always cost less than output tokens because the model does more computational work when generating new text than when reading existing text.

This distinction matters for cost optimization. A chatbot that sends 3,000 tokens of knowledge base context with every query but only generates a 200 token response spends most of its budget on input tokens. Understanding this ratio helps you pick the most cost effective provider for your specific use case.

Anthropic (Claude) Pricing

Anthropic offers three model tiers under the Claude brand:

Claude Haiku (budget)
Input: $0.25 per million tokens. Output: $1.25 per million tokens. The fastest and cheapest Claude model, optimized for high volume tasks like customer support, content classification, and data extraction. Handles straightforward conversations with quality comparable to frontier models from two years ago.
Claude Sonnet (mid tier)
Input: $3.00 per million tokens. Output: $15.00 per million tokens. The workhorse model for most applications. Strong at complex reasoning, nuanced writing, code generation, and multi-step tasks. Best balance of capability and cost for production applications.
Claude Opus (frontier)
Input: $15.00 per million tokens. Output: $75.00 per million tokens. The most capable Claude model, used for tasks requiring advanced reasoning, complex analysis, or the highest quality output. Most applications do not need this tier.

Anthropic also offers prompt caching, which stores frequently used prompt prefixes (like system prompts and knowledge base context) on their servers. Cached tokens cost 90% less than regular input tokens. For chatbots that send the same context with every message, this reduces the effective input cost dramatically. A 3,000 token system prompt that normally costs $0.009 per call at Sonnet rates drops to $0.0009 per call when cached.

Batch API processing gives an additional 50% discount on both input and output tokens. If your workload can tolerate a few hours of delay (email processing, content generation, data analysis), batch pricing makes Anthropic's models extremely cost effective.

OpenAI (GPT) Pricing

GPT-4o mini (budget)
Input: $0.15 per million tokens. Output: $0.60 per million tokens. OpenAI's budget model, comparable to Claude Haiku. Good for high volume, straightforward tasks.
GPT-4o (mid tier)
Input: $2.50 per million tokens. Output: $10.00 per million tokens. The standard production model, comparable to Claude Sonnet. Handles most business applications well.
GPT-4.5 / o3 (frontier)
Input: $10.00 to $15.00 per million tokens. Output: $30.00 to $60.00 per million tokens. OpenAI's most capable models, with o3 adding extended reasoning for complex problem solving at additional compute cost.

OpenAI offers similar prompt caching and batch API discounts. Their Assistants API bundles conversation management and file retrieval but charges additional fees for storage and retrieval operations on top of token costs.

Google (Gemini) Pricing

Gemini Flash (budget)
Input: $0.075 per million tokens. Output: $0.30 per million tokens. The cheapest option among the major providers. Extremely competitive for high-volume, simple tasks. Google subsidizes aggressively to gain market share.
Gemini Pro (mid tier)
Input: $1.25 per million tokens. Output: $5.00 per million tokens. Comparable to Sonnet and GPT-4o for most tasks, with the added advantage of a very large context window (up to 2 million tokens).
Gemini Ultra (frontier)
Input: $7.00 per million tokens. Output: $21.00 per million tokens. Google's most capable model, priced lower than Anthropic and OpenAI's frontier offerings.

Google's pricing advantage comes with context window generosity. Gemini models accept up to 2 million tokens of input, meaning you can include entire documents or long conversation histories without truncation. For applications that need to process large documents, this can eliminate the need for a separate RAG pipeline, simplifying your architecture and reducing development costs.

Open Source Model Costs

Running open source models (Llama 3, Mistral, Qwen, DeepSeek) eliminates per-token API fees entirely. Instead, you pay for GPU compute. The cost depends on the model size and your infrastructure choice:

The break-even point between open source self-hosting and API usage depends on your volume. At 10,000 requests per day, self hosting a 7B model on a single GPU costs roughly $300 to $600 per month, while the equivalent API calls at budget model rates cost $30 to $100 per month. APIs win at this volume. At 100,000 requests per day, self hosting costs the same $300 to $600 per month (the GPU runs regardless of utilization), while API costs scale to $300 to $1,000 per month. At this volume, the calculus starts to favor self hosting, especially when you factor in data privacy and latency benefits.

Cost Optimization Strategies

Model Routing

Use a cheap model for simple queries and route complex queries to a more capable model. A customer service chatbot can send 85% of conversations to Haiku or GPT-4o mini (at $0.25 per million tokens) and only escalate complex or sensitive queries to Sonnet or GPT-4o ($3 to $10 per million tokens). This cuts your average cost per conversation by 60% to 80% compared to sending everything to the mid-tier model.

Prompt Caching

Structure your prompts so the static parts (system prompt, knowledge base context) come first and the dynamic parts (user message, conversation history) come last. This maximizes cache hit rates and reduces input costs by up to 90% on repeated calls.

Batch Processing

Any workload that does not need real-time responses should use batch APIs. Content generation, email processing, data analysis, report generation, and document classification all work well in batch mode at half the per-token cost.

Context Window Management

Sending less context saves money. Instead of including your entire knowledge base in every prompt, use RAG to retrieve only the most relevant sections. Instead of sending the full conversation history, summarize older messages. Every token you do not send is a token you do not pay for.

Pricing changes frequently. The rates listed here reflect September 2026 published pricing. All three major providers cut prices multiple times per year, typically when launching new model versions. Check each provider's pricing page for current rates before making commitments.