Best LLM APIs in 2026: By Use Case
A practitioner's guide to picking the right LLM API for coding, long docs, cheap extraction, reasoning, vision, voice, and on-device work.
Key takeaways
- The best LLM API depends on the job: a frontier model such as Claude Opus 5.5 ($4/$20 per million tokens) or gpt-6-astra ($10/$50) for coding agents and hard reasoning, and a small tier such as gpt-6-luna ($0.10/$0.50) or Claude Haiku 4.5 for high-volume extraction.
- Prices are as of October 2026; batch APIs halve them.
On this page
Use a frontier model for coding agents and hard reasoning, a small fast tier for high-volume classification, and route between them. As of October 2026 that spread is wide: gpt-6-luna costs $0.10 per million input tokens, Claude Opus 5.5 $4, gpt-6-astra $10. Picking the tier per task moves your bill more than picking the vendor.
The price sheet, side by side
Standard-tier list prices in USD per million tokens, taken from each provider's own pricing page as of October 2026. OpenAI figures are short-context rates; Gemini 3.1 Pro is for prompts up to 200k tokens.
| Model | Provider | Tier | Input | Output | Cached input |
|---|---|---|---|---|---|
| Claude Fable 5.1 | Anthropic | Top | $10 | $50 | $0.25 |
| Claude Opus 5.5 | Anthropic | Frontier | $4 | $20 | $0.20 |
| Claude Sonnet 5.5 | Anthropic | Mid | $2 | $10 | $0.20 |
| Claude Haiku 4.5 | Anthropic | Small | $1 | $5 | $0.10 |
| gpt-6-astra | OpenAI | Frontier | $10 | $50 | $1.00 |
| gpt-6.1-sol | OpenAI | Mid | $2 | $10 | $0.10 |
| gpt-6-luna | OpenAI | Small | $0.10 | $0.50 | $0.01 |
| gemini-3.1-pro-preview | Frontier | $2 | $12 | $0.20 | |
| gemini-3.8-flash | Mid | $0.75 | $3.75 | $0.075 | |
| gemini-3.5-flash-lite | Small | $0.30 | $2.50 | $0.03 | |
| deepseek-flash | DeepSeek | Small | $0.30 | $1.20 | $0.006 |
Two footnotes matter. Gemini 3.8 Flash doubles to $1.50/$7.50 on January 1, 2027. DeepSeek's figures are peak-hour rates; off-peak is half.
Coding and agents
The most demanding category. Agentic coding means long tool-use loops, context windows full of repo files, and low tolerance for a model going off the rails halfway through a refactor. Use the frontier tier from Anthropic, OpenAI, or Google, all tuned for tool calling and multi-step execution.
A coding agent can burn 50k to 200k tokens per task, so price matters, but a cheaper model that fails and retries costs more than the smart one that gets it right. Reserve the frontier model for reasoning and code generation and route trivial sub-steps, like file summaries and lint parsing, to a small tier.
Long-document analysis
For contracts, papers, or a quarter of logs, the deciding factor is context size and recall in the middle of it. Claude 4.6 and later models include a 1M-token window at standard per-token pricing, and DeepSeek's API models also list 1M tokens.
Long context is where prompt caching pays most. Cache a 200k-token document once and each follow-up question pays full price only for new tokens. Cache reads cost 10% of the base input rate on most Claude models and on gpt-6-astra. Put stable content (document, system prompt) first and the question last.
High-volume classification and extraction
Sentiment tagging, entity extraction, routing, moderation. Simple per call, enormous in volume, so unit cost dominates. Use the small tiers: gpt-6-luna, Claude Haiku 4.5, Gemini Flash-Lite, or an open-weight model like Llama, Qwen, or Mistral that you host.
Two levers cut cost hard. Batch APIs from Anthropic, OpenAI, and Google take 50% off input and output for asynchronous jobs, ideal for nightly ETL. And structured outputs keep responses short and parseable.
# Route by task complexity, not by habit
def pick_model(task):
if task.type in ("classify", "extract", "route"):
return "small-fast" # gpt-6-luna / Claude Haiku 4.5 / Gemini Flash-Lite
if task.type == "long_doc":
return "long-context" # Claude or Gemini with caching on
if task.type in ("code", "agent", "reasoning"):
return "frontier" # Claude Opus 5.5 / gpt-6-astra / Gemini 3.1 Pro
return "small-fast"
model = pick_model(task)
Complex reasoning
Math, multi-hop logic, planning, hard debugging. Reasoning or "thinking" modes spend extra tokens deliberating before answering, and those tokens are billed as output. A reasoning call can take tens of seconds, so keep it off chat boxes where users expect instant replies, and set a reasoning-effort or thinking-budget parameter so easy questions don't pay for deep deliberation.
Multimodal and vision
Screenshots, scans, charts, UI understanding. Frontier models from all three providers take images alongside text in one call. Images are billed as tokens derived from resolution, so a high-res screenshot can cost as much as a page of text; downscale to the smallest size that still answers the question. For OCR of clean documents, a dedicated OCR service is often cheaper.
Realtime and voice
Voice agents need speech-to-speech streaming, not a text call wrapped in TTS. OpenAI's Realtime API (gpt-realtime-2.1 and a mini variant) and Google's Gemini 3.8 Live handle audio in and out with interruption support. Latency matters more than token price here: keep the model tier modest and push heavy reasoning to a background call.
On-device and open-weight
When data must never leave your infrastructure, or you need zero per-call fees at scale, use open-weight models: Llama, Qwen, and Mistral ship strong small variants. The cost shifts from per-token price to GPUs, scaling, and uptime. For bursty or low-volume work, an aggregator like OpenRouter, which passes provider prices through without markup, is usually the better deal until volume justifies dedicated capacity.
Questions people ask
Which LLM API is cheapest per token?
Among the big three as of October 2026, OpenAI's gpt-6-luna is cheapest at $0.10 per million input tokens and $0.50 output. DeepSeek's deepseek-flash is $0.15 input and $0.60 output off-peak. Batch APIs from Anthropic, OpenAI, and Google halve list prices again, and cached input costs 10% or less of base, so job shape often matters more than the headline rate.
How does LLM API pricing work?
You pay per token, with separate rates for input and output; output usually costs about five times more. Cached input, meaning a repeated prompt prefix, bills at a steep discount, and batch jobs get 50% off. Token counts differ by model: Anthropic says Claude 4.7 and later use a tokenizer that produces about 30% more tokens for the same text.
Which LLM API is best for coding agents?
A frontier tier: Claude Opus 5.5, gpt-6-astra, or Gemini 3.1 Pro. Agents run long tool-use loops where one failed step wastes the whole task, so reliability beats unit price. Run your own evals on real repository tasks, then route cheap sub-steps like summaries and lint parsing to a small model to recover most of the cost.
The decision, concretely
- Agents, coding, hard reasoning? One frontier provider, with caching on.
- Millions of extraction or classification calls? A small tier through the batch API.
- Repeated questions over one large corpus? Prompt caching with stable content first.
- Data residency or a hard cost ceiling? Open-weight models, self-hosted or via an aggregator.
The call we'd make
Default to one frontier provider for agents and reasoning, add a small-fast model for volume work, turn on caching for repeated context and batch for anything asynchronous, and keep an open-weight option in your back pocket. Don't marry one vendor: route by task, measure with evals, and recheck prices quarterly. For serving infrastructure, see our pillar on best LLM APIs and AI infrastructure, and for a head-to-head read OpenAI vs Anthropic vs Gemini.
Sources
GitLab CI/CD Best Practices in 2026: Pipelines You Can Trust
A production-focused GitLab CI/CD guide: include/extends templates, rules and workflow, needs DAGs, cache vs artifacts, protected environments, masked/protected variables and Vault, built-in security scanning, and review apps β with copy-paste examples.
Fixing DNS Resolution Failures in Kubernetes
A pod can't reach a service by name, the app throws connection errors, and everyone blames the network. Usually it's DNS, and usually it's fixable.
More from AI
Explore more articles in this category
Meta and Sierra's Personal Agent Protocol, Explained
It is OAuth for letting your AI agent act on your behalf with a business, not another MCP, and it is nowhere near ready to build on.
Mistral Large 4 'Le Chonk': Self-Host or Use the API?
A 1T-parameter MoE model with open weights coming doesn't make self-hosting the right call for most teams.
Claude Haiku 5.5: When to Route Down From the Frontier Tier
Haiku 5.5 is cheap enough to stop rationing subagent calls, but the 75% savings claim only holds if your prompts are short.
You might have missed
Evergreen posts worth revisiting.