AI, Software Development
LLM API Pricing Compared

TL;DR: LLM API pricing is not a flat fee. You pay per token, and costs shift fast depending on which model you pick, how much context you pass, and how often your app calls the API. GPT-4o and Claude 3.5 Sonnet sit in a similar price band. Gemini 1.5 Flash is much cheaper for high-volume work. Get your token usage numbers right before you commit to a model.
LLM API pricing varies a lot between providers, and the number on the pricing page is rarely the number you end up paying. The real cost depends on which model you pick, how long your prompts are, and how many calls your app makes per day. Get those three things wrong and a budget that looked fine in testing can blow out fast in production.
Here is a straight comparison of what the main providers charge, what drives the bill up, and how to estimate costs before you build.
How LLM API pricing actually works
Every major provider charges by the token. A token is roughly four characters of text, so 1,000 tokens is about 750 words. Input tokens (what you send to the model) and output tokens (what the model sends back) are usually priced separately, with output costing more.
Most providers quote prices per million tokens (per 1M tokens). That sounds manageable until you factor in:
- Context window size. If your app passes a long conversation history or a big document with every request, input tokens stack up fast.
- Output length. A model generating a 500-word response costs more than one generating a two-sentence answer.
- Request volume. At 10,000 daily active users, even cheap-per-call models add up.
The pricing page tells you the rate. Your architecture determines the volume.
The main providers compared
Prices shift regularly. These figures are indicative as of early 2026 and are USD. Always check the provider's current pricing page before you lock in a model.
OpenAI
- GPT-4o: ~$2.50 input / $10.00 output per 1M tokens
- GPT-4o mini: ~$0.15 input / $0.60 output per 1M tokens
- o1 (reasoning model): ~$15.00 input / $60.00 output per 1M tokens
- o3-mini: ~$1.10 input / $4.40 output per 1M tokens
GPT-4o mini is OpenAI's value option for high-volume, lower-complexity tasks. The o1 and o3 reasoning models are expensive, but they are built for tasks that need multi-step logic.
Anthropic
- Claude 3.5 Sonnet: ~$3.00 input / $15.00 output per 1M tokens
- Claude 3.5 Haiku: ~$0.80 input / $4.00 output per 1M tokens
- Claude 3 Opus: ~$15.00 input / $75.00 output per 1M tokens
Claude 3.5 Sonnet is the workhorse for most production applications. Haiku is the fast, cheap option for simple tasks. Opus is rarely worth it at current prices unless you have a very specific use case that only it handles well.
- Gemini 1.5 Flash: ~$0.075 input / $0.30 output per 1M tokens (up to 128K context)
- Gemini 1.5 Pro: ~$1.25 input / $5.00 output per 1M tokens (up to 128K context)
- Gemini 2.0 Flash: ~$0.10 input / $0.40 output per 1M tokens
Gemini 1.5 Flash is the cheapest capable model in this group for most tasks. If your app is high-volume and the task does not need frontier-level reasoning, it deserves serious consideration.
Meta (open-source, self-hosted)
Llama 3 and Llama 3.1 are free to use under Meta's licence. You pay for compute, not tokens. On a mid-range GPU instance, running inference yourself can cost a fraction of the managed API price at scale. The trade-off is that you manage the infrastructure.
For teams exploring this path, AI Leads for Enterprise Data is worth a look for tooling that runs on self-hosted models.
What actually drives your bill
Pricing per token is only one part of the equation. These factors have a bigger impact than most teams expect.
System prompt length. A 2,000-token system prompt sent with every request adds $5 per 1M input tokens at GPT-4o rates. Across a million requests, that is $5,000 you could cut by trimming the prompt.
Context window padding. Passing full conversation history to maintain context is expensive. A conversation with 20 turns and 200 tokens per message sends 4,000 input tokens per call by the end. Summarising older messages instead of passing them raw cuts this significantly.
Retry logic. Apps that retry failed calls without rate limiting can send the same tokens multiple times. Make sure your error handling does not silently double your costs.
Output verbosity. Some models default to verbose answers. Instructing the model to be concise in your system prompt reduces output tokens, which are the more expensive half.
Choosing a model for your use case
The cheapest model that reliably does the job is the right model. Here is a rough guide:
- Simple classification, extraction, or summarisation at high volume. GPT-4o mini, Gemini 1.5 Flash, or Claude 3.5 Haiku. Test all three on your actual data.
- Complex generation, reasoning, or nuanced instruction-following. GPT-4o or Claude 3.5 Sonnet. These are comparable in quality and price.
- Multi-step reasoning or maths-heavy tasks. o3-mini is worth the premium. Avoid o1 unless o3-mini falls short.
- Large document processing (100K+ tokens). Gemini 1.5 Pro handles long context better than most. Check the context window pricing tiers.
- Cost-sensitive production apps at serious scale. Model the numbers for self-hosted Llama. The infrastructure cost often wins over API pricing above a certain volume.
For a deeper look at what goes into building an AI-powered product, how to add AI to your existing app or software covers the full picture from architecture to deployment.
How to estimate costs before you build
Do not guess. Run a back-of-envelope calculation before you pick a model.
- Estimate average input tokens per request (system prompt + user message + any context).
- Estimate average output tokens per response.
- Multiply by expected daily request volume.
- Apply the provider's per-token rate.
- Add 20% buffer for retries, longer-than-average conversations, and edge cases.
Example: 2,000 input tokens + 500 output tokens per request, 50,000 requests per day, using GPT-4o.
- Input: 2,000 x 50,000 = 100M tokens x $2.50/1M = $250/day
- Output: 500 x 50,000 = 25M tokens x $10.00/1M = $250/day
- Total: ~$500/day, or $15,000/month
Run the same numbers against Gemini 1.5 Flash and you get closer to $800/month for equivalent volume. That gap is worth stress-testing before you build.
CTOs working through these trade-offs at the platform level can see how we approach these decisions on the tech for CTOs page.
What Devwiz sees in practice
We have been building AI into products for clients across government, enterprise, and scale-ups since well before the current wave. With 200+ apps built since 2015, the cost conversation comes up early in every AI engagement.
The teams that get stung are usually the ones that prototype on GPT-4o because it is the easiest to start with, then discover in production that a cheaper model handles 80% of their use case just as well. A bit of model benchmarking on real data before you commit saves a lot of refactoring later.
If you are building something with AI at the core and want to think through the model selection and cost architecture, talk to the Devwiz team before you lock in a provider.
FAQ
Q: Is LLM API pricing the same for all regions?
Mostly, but not always. Some providers offer lower rates in specific regions, and latency can affect your architecture choices if your users are in Australia. Most major providers have infrastructure in Sydney or nearby. Check the provider's region list and factor in data residency requirements if you are handling sensitive data.
Q: Can I switch models later if costs get too high?
Yes, but it is not always painless. If your prompts are tuned for one model's behaviour, switching can change output quality. Budget time to re-test and re-tune prompts when you switch. Keeping your model selection behind an abstraction layer in your codebase makes this easier.
Q: What is the difference between input and output token pricing?
Input tokens are what you send to the model. Output tokens are what the model generates back. Output tokens cost more because generating text is computationally heavier than reading it. For most apps, controlling output length is the fastest way to cut costs.
Q: Are there free tiers I can use for testing?
Most providers offer free credits for new accounts. OpenAI, Anthropic, and Google all have trial credits. These are fine for prototyping but do not give you a reliable read on production costs. Run a proper load estimate before you move out of the free tier.
Q: How do token costs compare when using an AI agent that calls tools?
Agent loops are expensive. Each tool call adds a round trip, and passing tool schemas in the context window adds tokens to every request. A simple agent with three tools and five steps can use 10x the tokens of a single-shot request. Factor this in early if you are building agentic workflows.
Frequently asked questions
Is LLM API pricing the same for all regions?
Mostly, but not always. Some providers offer lower rates in specific regions, and latency can affect your architecture choices if your users are in Australia. Most major providers have infrastructure in Sydney or nearby. Check the provider's region list and factor in data residency requirements if you are handling sensitive data.
Can I switch models later if costs get too high?
Yes, but it is not always painless. If your prompts are tuned for one model's behaviour, switching can change output quality. Budget time to re-test and re-tune prompts when you switch. Keeping your model selection behind an abstraction layer in your codebase makes this easier.
What is the difference between input and output token pricing?
Input tokens are what you send to the model. Output tokens are what the model generates back. Output tokens cost more because generating text is computationally heavier than reading it. For most apps, controlling output length is the fastest way to cut costs.
Are there free tiers I can use for testing?
Most providers offer free credits for new accounts. OpenAI, Anthropic, and Google all have trial credits. These are fine for prototyping but do not give you a reliable read on production costs. Run a proper load estimate before you move out of the free tier.
How do token costs compare when using an AI agent that calls tools?
Agent loops are expensive. Each tool call adds a round trip, and passing tool schemas in the context window adds tokens to every request. A simple agent with three tools and five steps can use 10x the tokens of a single-shot request. Factor this in early if you are building agentic workflows.
About James Killick
James is a co-founder of Devwiz and an AI product specialist. Since 2015 he has helped ship 200+ apps for founders, businesses and government, including work for NSW Government, Briometrix and Huskee. He builds AI-first platforms and writes about turning a proven program into software. He also hosts the Up in the AI podcast.
Tags: AI Integration


