If you're adding AI features to a product in 2026, the question isn't "can we afford to train a model?" (you can't, and you don't need to). Training a frontier model costs tens to hundreds of millions of dollars in compute alone. The question that actually matters is: what will it cost to call a model via API, at our traffic?
Here's a practical breakdown, with a formula and a script you can run against your own numbers.
How LLM API pricing works
Every major provider charges per token, and almost always per million tokens:
- Input tokens: your system prompt, user message, retrieved context, chat history.
- Output tokens: what the model generates. These usually cost 3–5x more than input.
- Context size: long-context requests can be priced higher per token on some models.
- Prompt caching: re-used prefixes (system prompts, catalogues, style guides) are billed at a steep discount.
- Batch APIs: non-urgent jobs can often run at ~50% off.
So the core formula is:
monthly_cost = requests_per_month × (
avg_input_tokens / 1_000_000 × input_price +
avg_output_tokens / 1_000_000 × output_price
)
Reference prices (per 1M tokens)
Approximate list prices at the time of writing. Always check the provider's pricing page before budgeting.
| Model | Input | Output |
|---|---|---|
| Amazon Nova Micro | $0.035 | $0.14 |
| GPT-4o Mini | $0.15 | $0.60 |
| DeepSeek-V3.2 | $0.28 | $0.42 |
| Claude Haiku 4.5 | $1.00 | $5.00 |
| Claude Sonnet 5.5 | $2.00 | $10.00 |
| Claude Opus 5.5 | $4.00 | $20.00 |
| o1 Pro | $150 | $600 |
There's a ~4,000x spread between the cheapest and most expensive rows. Model choice is the biggest cost lever you have.
A tiny estimator
PRICES = { # USD per 1M tokens: (input, output)
"nova-micro": (0.035, 0.14),
"gpt-4o-mini": (0.15, 0.60),
"haiku-4.5": (1.00, 5.00),
"sonnet-5.5": (2.00, 10.00),
}
def monthly_cost(model, requests, in_tokens, out_tokens):
p_in, p_out = PRICES[model]
return requests * (in_tokens * p_in + out_tokens * p_out) / 1_000_000
# Natural-language search: 100k queries/month, ~400 in / ~100 out
for m in PRICES:
print(f"{m:12s} ${monthly_cost(m, 100_000, 400, 100):,.2f}/month")
Output:
nova-micro $2.80/month
gpt-4o-mini $12.00/month
haiku-4.5 $90.00/month
sonnet-5.5 $180.00/month
Two worked examples
1. Auto-categorising marketplace listings
10,000 new listings/day, ~200 input tokens (title + description + category list) and ~30 output tokens each. On Haiku 4.5:
- Input: 2M tokens/day → $2.00
- Output: 0.3M tokens/day → $1.50
- ≈ $3.50/day, ~$105/month
Cache the category taxonomy in the prompt prefix and the input side drops sharply.
2. Natural-language search
100,000 searches/month at ~400 in / ~100 out: roughly $90/month on Haiku, $180/month on Sonnet, and under $3/month on Nova Micro if the quality is good enough for your use case.
Five ways to cut the bill
- Right-size the model. Classification, extraction and routing rarely need a frontier model.
- Trim prompts. Verbose system prompts get billed on every single call.
- Cache reusable context. Catalogues, policies and style guides belong in a cached prefix.
- Batch what isn't real-time. Nightly enrichment jobs don't need low latency.
- Cascade models. Let a cheap model handle the easy 80%, and escalate only low-confidence cases to a stronger one.
What about "free" open-source models?
Llama, Mistral and similar models have no per-token fee, but you pay in GPUs, hosting, monitoring and engineering time. Below a fairly high volume, managed APIs are usually cheaper all-in.
Bottom line
Measure your average input/output tokens per request, multiply by volume, and test the cheapest model that meets your quality bar first. If your AI bill is already growing faster than usage, it's worth getting a second pair of eyes. The team at Journeyhorizon offers AI cost optimization services for exactly this: model selection, caching, routing and spend monitoring for production AI features.
Adapted from the original guide on the Journeyhorizon blog.
Top comments (0)