development
Best LLM APIs
The best LLM APIs in 2026 compared in depth — OpenAI, Anthropic and Google first-party APIs, the enterprise gateways (AWS Bedrock, Azure AI Foundry, Google Vertex AI) and unified layers like OpenRouter, Together, Fireworks and Groq, with current per-token pricing, context windows, rate limits, data-retention terms and decisive picks for every builder.
Quick answer: For most teams building on large language models in 2026, the two default first-party APIs are the OpenAI API and the Anthropic API — Anthropic for the strongest available model quality (Claude Opus 5 at $5/$25 per million tokens), OpenAI for the broadest tooling and ecosystem (GPT-5.6 at $5/$30). The cheapest frontier-adjacent option is the Google Gemini API, which serves Gemini 3.1 Pro at $2/$12 and has the most usable free tier. To reach every model through one key, OpenRouter routes to 300+ models across 60+ providers with no per-token markup; for the fastest open-model inference, Groq serves open weights at over 1,000 tokens per second. For governed enterprise deployments, pick the gateway on the cloud you already run — AWS Bedrock, Azure AI Foundry or Google Vertex AI. The one thing to get right first: the capability gap between the top platforms is now small, so price, rate limits, data-retention terms and lock-in should drive the decision more than the model name.
The current state of LLM APIs: July 2026
The LLM API market has split into three distinct layers, and choosing well means choosing the layer before you choose the vendor.
The first-party provider APIs — OpenAI, Anthropic, Google, xAI, DeepSeek and Mistral — give you the newest models first, the deepest feature set, and the lowest latency to that vendor’s own weights. The enterprise gateways — AWS Bedrock, Azure AI Foundry and Google Vertex AI — put many vendors’ models behind one governed surface with your cloud’s identity, logging and data-residency controls. The aggregators and inference specialists — OpenRouter, Together AI, Fireworks AI and Groq — either unify every provider behind a single endpoint or serve open-weight models faster and cheaper than the labs do themselves.
Four shifts define the current moment. First, the capability gap narrowed: independent platform comparisons now put the difference between leading models at roughly 5–15%, so compliance, pricing and integration drive more real-world impact than raw model choice (EPC Group). Second, the price floor collapsed: open-weight models such as DeepSeek V4 now serve at $0.14/$0.28 per million tokens — roughly a 90x gap below flagship output pricing — while scoring 80.6% on SWE-bench Verified. Third, cost-control features became standard: prompt caching (roughly a 10x discount on repeated context) and Batch APIs (50% off asynchronous work) are now available across the major first-party platforms. Fourth, the OpenAI-compatible endpoint became the lingua franca: Groq, Together, Fireworks, OpenRouter, xAI and DeepSeek all accept the OpenAI SDK with a changed base URL, so switching providers is increasingly a configuration change, not a rewrite.
One availability caveat sits above all of this. Anthropic’s frontier-tier Claude Fable 5 was suspended worldwide on 12 June 2026 under a US export-control directive, then returned to general availability on 1 July 2026 once the controls were lifted (Anthropic); its restricted sibling Mythos 5 remains trusted-access only. For everyday API work, Opus 5 — Anthropic’s newest flagship, launched 24 July 2026 at the same $5/$25 as Opus 4.8 — is the pragmatic ceiling below the Mythos tier.
The three types of LLM API
Match the layer to the job before comparing vendors within it.
| Type | What it is | Examples | Best when |
|---|---|---|---|
| First-party provider API | Direct access to one lab’s own models | OpenAI, Anthropic, Google Gemini, xAI, DeepSeek, Mistral | You want the newest models first, the full feature set and the lowest latency |
| Enterprise cloud gateway | Many vendors’ models behind one governed cloud surface | AWS Bedrock, Azure AI Foundry, Google Vertex AI | You need in-region data, IAM/audit governance and one procurement path |
| Aggregator / unified API | One endpoint that routes to many providers | OpenRouter, Together AI, Fireworks AI | You want multi-model flexibility, failover and no per-vendor contracts |
| Fast-inference specialist | Optimised serving of (mostly open) models | Groq, Together, Fireworks | Latency and tokens-per-second are the priority |
Most production systems in 2026 use more than one layer: a first-party API for the flagship model, a cheap open-weight endpoint for high-volume routine calls, and a gateway for governed or region-locked workloads.
Top LLM APIs ranked (July 2026)
Ranked by overall suitability for a team starting a new build today, weighting model access, developer experience, price, reliability and lock-in. The flagship price is the headline per-million-token input/output rate for that platform’s strongest generally-available model, drawn from our model pages.
| Rank | API | Type | Flagship model | Price (in/out per MTok) | Best for |
|---|---|---|---|---|---|
| 1 | Anthropic API | First-party | Claude Opus 5 | $5 / $25 | Top model quality and agentic reliability |
| 2 | OpenAI API | First-party | GPT-5.6 | $5 / $30 | Broadest ecosystem and tooling |
| 3 | Google Gemini API | First-party | Gemini 3.1 Pro | $2 / $12 | Cheapest frontier-adjacent, longest context, best free tier |
| 4 | OpenRouter | Aggregator | 300+ models | Passthrough + 5.5% credit fee | Multi-model access through one key |
| 5 | AWS Bedrock | Cloud gateway | Claude, Llama, Mistral, Nova | Near-direct passthrough | Governed enterprise on AWS |
| 6 | Google Vertex AI | Cloud gateway | Gemini 3.5 Pro + Model Garden | Near-direct passthrough | Governed enterprise on GCP |
| 7 | Azure AI Foundry | Cloud gateway | GPT-5.6 + catalogue | Near-direct passthrough | Governed enterprise on Microsoft |
| 8 | Together AI | Aggregator / inference | Open-weight catalogue | Per-model, open-weight rates | Open-model hosting and fine-tuning |
| 9 | Fireworks AI | Inference specialist | Open-weight catalogue | Per-model, open-weight rates | Fast open-model production |
| 10 | Groq | Inference specialist | Open-weight catalogue | Per-model, open-weight rates | Lowest latency, highest throughput |
Also worth knowing: the xAI API serves Grok 4.5 at $2/$6, the DeepSeek API serves DeepSeek V4 at $0.14/$0.28, and Mistral’s La Plateforme is the European first-party option with EU data residency.
The best LLM APIs compared
We’ve ordered these by current suitability for a new build, not by company size. Every price is the headline per-million-token rate for the platform’s strongest available model; verify against each vendor’s live pricing page before you commit spend.
1. Anthropic API — best model quality
Type: First-party Flagship: Claude Opus 5 ($5/$25 per million tokens, 1M-token context) Also serves: Sonnet 5 ($3/$15; $2/$10 introductory to 31 Aug), Opus 4.8 ($5/$25, prior flagship), Haiku 4.5 ($1/$5), Fable 5 ($10/$50, restored 1 July 2026) Key features: Prompt caching, Message Batches (50% off), 1M-token context with no long-context surcharge, tool use, Files API, native MCP support
The Anthropic API gives you direct access to Claude Opus 5, the strongest model you can currently deploy — 96.0% SWE-bench Verified (97.0% on the independent vals.ai harness), 79.2% SWE-bench Pro, and the top score on the independent Artificial Analysis Intelligence Index — launched 24 July 2026 at the same $5/$25 as the Opus 4.8 it succeeds. Its standout trait for API builders is strong, predictable long-horizon agentic behaviour, though note Opus 5 hallucinates factual claims slightly more than Opus 4.8, so verify uncertain output. The whole Claude line offers a 1M-token context window with no long-context price premium, and prompt caching plus the Batch API bring effective costs down sharply on repeated-context and asynchronous workloads.
Why it wins: The best available model quality, the strongest long-horizon agentic behaviour, and a clean, well-documented API that has become the reference implementation for tool use and MCP. Anthropic does not train on API inputs by default.
Limitations: Claude only — no multi-vendor choice from this endpoint. Output pricing at the flagship tier is higher than OpenAI’s mid-tier and Google’s frontier-adjacent option. Frontier Fable 5 is available again but costs twice Opus 5 and carries a tighter safety classifier that trips more often on routine work.
Best for: Teams that want the highest model quality and the most reliable agentic behaviour, and are comfortable standardising on one vendor.
2. OpenAI API — broadest ecosystem
Type: First-party Flagship: GPT-5.6 ($5/$30 per million tokens) Also serves: GPT-5.5 ($5/$30), GPT-5.4 ($2.50/$15), the o-series reasoning line, embeddings, image and audio models Key features: Responses API, Batch API (50% off), structured outputs, function calling, Realtime API, fine-tuning, the most widely supported SDKs
The OpenAI API remains the default first stop for most developers because of reach, not just model quality. Its SDK is the de facto standard that most other providers emulate, its documentation and community are the largest in the space, and it covers the widest surface — text, embeddings, image generation, speech and a Realtime API for voice agents — from one account. GPT-5.6 reached general availability on 9 July 2026 and leads agentic and terminal-style coding, though it trails Opus 5 on repo-scale SWE-bench Pro. The GPT-5.4 tier at $2.50/$15 is the value pick within the OpenAI line.
Why it wins: The broadest ecosystem, the most portable SDK, and the widest range of modalities under one API. OpenAI does not train on API data by default.
Limitations: Flagship output pricing ($30/M) is the highest of the mainstream first-party APIs. On repository-scale software engineering, Claude still leads. METR flagged GPT-5.6’s reward-hacking rate as the highest of any public model it has tested, so verify autonomous output on trust-critical work.
Best for: Teams that want one vendor covering text, voice, vision and embeddings, and value ecosystem maturity over squeezing the lowest price.
3. Google Gemini API — cheapest frontier-adjacent, best free tier
Type: First-party Flagship: Gemini 3.1 Pro ($2/$12 per million tokens up to 200K tokens; $4/$18 above) Also serves: Gemini 3.5 Pro (2M-token context), Gemini 3.5 Flash (value tier) Key features: The largest usable free tier, the longest context windows, Google Search grounding, Batch mode, context caching
The Google Gemini API — accessed through Google AI Studio — is the value and long-context leader among first-party APIs. Gemini 3.1 Pro is the cheapest frontier-adjacent model at $2/$12, and Gemini 3.5 Pro pairs frontier-class quality with a 2M-token context window, the largest of any mainstream hosted model. The free tier is the most generous for prototyping, and Google Search grounding is a native feature rather than a bolt-on. For production and data-governance, the same models are available through Vertex AI with enterprise terms.
Why it wins: The lowest price for frontier-adjacent capability, the longest context, and the most usable free tier for building and testing.
Limitations: The free AI Studio tier may use submitted data to improve Google’s products, so route anything sensitive through the paid Gemini API or Vertex AI, where your data is not used for training. Above 200K tokens, Gemini 3.1 Pro pricing doubles to $4/$18.
Best for: Cost-sensitive builds, very long-context workloads (large documents, whole codebases), and anyone who wants a real free tier to prototype against.
4. OpenRouter — best unified, multi-model gateway
Type: Aggregator Models: 300+ models across 60+ providers Pricing: No per-token markup; a 5.5% fee applies to credit purchases only (TrueFoundry) Key features: One API key for every major model, automatic provider failover, a normalised OpenAI-compatible schema, free-model tier, per-request routing
OpenRouter solves the multi-vendor problem: one key, one billing relationship and one schema reach 300+ models from Anthropic, OpenAI, Google, DeepSeek, Meta, Mistral, xAI and dozens more (APIScout). It adds no per-token markup — you pay at or very close to each model’s direct rate — and takes a 5.5% fee on credit top-ups instead. Automatic failover between upstream providers improves uptime, and a free-model tier lets you test without spend. It is the cleanest way to keep model choice open and hedge against any single vendor’s price or availability changes.
Why it wins: Genuine multi-model flexibility with near-direct pricing and built-in redundancy, all behind one OpenAI-compatible endpoint.
Limitations: You are one hop further from each provider, so the very newest models and the deepest provider-specific features can arrive later than on the first-party API. The 5.5% credit fee is a small tax on top of raw token cost.
Best for: Teams that want to compare models cheaply, avoid vendor lock-in, or add automatic failover without integrating each provider separately.
5. AWS Bedrock — broadest governed enterprise catalogue
Type: Cloud gateway Models: 30+ foundation models — Claude, Llama, Mistral, Amazon Nova, Cohere, AI21, Stability — behind one AWS surface Pricing: Near-direct passthrough, billed through AWS Key features: IAM identity, CloudTrail audit logging, Bedrock Guardrails, Agents and Knowledge Bases, in-region data, no data retention
AWS Bedrock offers the broadest third-party model catalogue of the enterprise gateways, with mature agent and guardrails frameworks (EPC Group). Its advantage is governance, not model exclusivity: models run inside your AWS account with IAM permissions, CloudTrail logging and in-region data handling, and Bedrock does not retain or train on your prompts. For a team already on AWS, it turns “add an LLM” into an IAM policy rather than a new vendor contract.
Why it wins: The widest governed model selection plus AWS-native identity, logging and compliance — the safe default for regulated industries already on AWS.
Limitations: The newest frontier models can land on the first-party API before they reach Bedrock. Cross-region and quota management add operational overhead, and it only makes sense if AWS is already your platform.
Best for: Enterprises on AWS that need many models under one governed, audited, in-region surface.
6. Google Vertex AI — best for GCP and Gemini enterprise
Type: Cloud gateway Models: First-party Gemini plus a Model Garden that includes Anthropic, Llama and Mistral Pricing: Near-direct passthrough, billed through GCP Key features: 1M+ token context, Google Search grounding, BigQuery integration, in-region data, no training on your data
Google Vertex AI is the enterprise path to Gemini, adding governance, MLOps and deep BigQuery integration to the same models available on the Gemini API. Its Model Garden also hosts third-party models including Anthropic’s Claude and Meta’s Llama, so it is not Gemini-only. For teams whose data already lives in Google Cloud, Vertex keeps everything — retrieval, grounding and serving — inside one governed environment.
Why it wins: The best home for Gemini’s long-context, grounded models at enterprise scale, with native access to BigQuery data.
Limitations: Best value comes from committing to the Google ecosystem; the third-party catalogue is narrower than Bedrock’s. Setup is heavier than calling the Gemini API directly.
Best for: Enterprises on Google Cloud, and any team that wants Gemini’s long context and grounding under governed terms.
7. Azure AI Foundry — best for Microsoft and OpenAI enterprise
Type: Cloud gateway Models: OpenAI models (including GPT-5.6) plus a broad partner catalogue Pricing: Near-direct passthrough, billed through Azure Key features: Deepest Microsoft-stack integration, FedRAMP High and enterprise compliance, content safety, in-region data, no training on your data
Azure AI Foundry — the platform that absorbed Azure OpenAI and Azure AI Studio — is the enterprise route to OpenAI’s models with Microsoft’s compliance posture, including FedRAMP High certification (EPC Group). For organisations standardised on Microsoft 365, Entra ID and Azure, it puts GPT-5.6 and a wider catalogue behind identity, logging and data-residency controls you already run.
Why it wins: The strongest Microsoft-ecosystem integration and the most enterprise-hardened path to OpenAI’s models, with the deepest public-sector compliance coverage.
Limitations: Weighted toward the OpenAI line; other vendors’ newest models can arrive later. Value depends on already being a Microsoft-stack organisation.
Best for: Regulated and public-sector enterprises on Microsoft that want OpenAI models under Azure governance.
8. Together AI — best for open-model hosting and fine-tuning
Type: Aggregator / inference specialist Models: A large open-weight catalogue — Llama, DeepSeek, Qwen, Mistral and more Pricing: Per-model, at open-weight rates; dedicated endpoints available Key features: Fast serverless inference, fine-tuning, dedicated GPU endpoints, OpenAI-compatible API
Together AI specialises in serving open-weight models at production quality and letting you fine-tune them. It is the natural home if your strategy is open models — you get serverless inference for spiky traffic, dedicated endpoints for steady load, and a fine-tuning pipeline, all behind an OpenAI-compatible API. Paired with an open leader like DeepSeek V4, it delivers frontier-adjacent quality at a fraction of hosted-flagship cost.
Why it wins: The most complete platform for building on open-weight models, from serverless calls to fine-tuning to dedicated capacity.
Limitations: You give up access to the closed frontier models (Claude, GPT, Gemini) that only their makers serve. Running your own fine-tunes shifts more of the serving and evaluation burden onto your team.
Best for: Teams committed to open-weight models that need hosting, fine-tuning and dedicated capacity in one place.
9. Fireworks AI — best for fast open-model production
Type: Inference specialist Models: Open-weight catalogue tuned for speed Pricing: Per-model, at open-weight rates Key features: Low-latency optimised serving, fine-tuning, function calling, OpenAI-compatible API
Fireworks AI sits close to Together but leans harder into latency-optimised serving of open models. For high-throughput production workloads on open weights — retrieval pipelines, classification, high-volume generation — it is among the fastest and most cost-efficient endpoints, with fine-tuning and function calling built in. Like the other specialists, it accepts the OpenAI SDK with a changed base URL, so trialling it against Together or Groq is a configuration change.
Why it wins: Fast, cost-efficient production serving of open-weight models with a clean migration path from the OpenAI SDK.
Limitations: Open models only; no closed-frontier access. Feature depth is narrower than a first-party API’s full surface.
Best for: High-volume open-model workloads where latency and cost per token decide the economics.
10. Groq — fastest inference
Type: Inference specialist Models: Open-weight catalogue served on custom LPU hardware Pricing: Per-model, at open-weight rates Key features: LPU-based serving, industry-leading tokens-per-second, OpenAI-compatible API, free tier
Groq runs open-weight models on its own Language Processing Unit (LPU) hardware and is the throughput leader: it serves large open models at over 1,000 tokens per second and is roughly 3–4x faster on time-to-first-token than the fastest GPU-based providers (Groq). It now processes over a billion API calls a month. For latency-critical experiences — voice agents, live assistants, anything where the user waits on the response — speed is the differentiator, and Groq’s OpenAI-compatible API makes it a drop-in test.
Why it wins: The lowest latency and highest throughput available, at open-weight pricing, behind a standard OpenAI-compatible endpoint.
Limitations: Restricted to the open-weight models Groq hosts — no closed-frontier access. Model selection is narrower than an aggregator’s.
Best for: Real-time and latency-sensitive applications running on open-weight models.
Feature comparison: the full matrix
| Feature | Anthropic | OpenAI | Gemini API | OpenRouter | Bedrock | Vertex AI | Azure Foundry | Together | Fireworks | Groq |
|---|---|---|---|---|---|---|---|---|---|---|
| Type | First-party | First-party | First-party | Aggregator | Gateway | Gateway | Gateway | Aggregator | Inference | Inference |
| Model choice | Claude only | OpenAI only | Gemini only | 300+ | 30+ | Gemini + garden | OpenAI + catalogue | Open-weight | Open-weight | Open-weight |
| Prompt caching | Yes | Yes | Yes | Provider-dependent | Yes | Yes | Yes | Model-dependent | Model-dependent | Limited |
| Batch API (50% off) | Yes | Yes | Yes | No | Model-dependent | Yes | Yes | No | No | No |
| Structured outputs | Yes | Yes | Yes | Provider-dependent | Yes | Yes | Yes | Yes | Yes | Yes |
| Fine-tuning | Limited | Yes | Yes | No | Yes | Yes | Yes | Yes | Yes | No |
| OpenAI-compatible | Partial | Native | Partial | Yes | Via SDK | Via SDK | Native | Yes | Yes | Yes |
| Trains on your data | No (default) | No (default) | Paid: no / free: may | No | No | No | No | No | No | No |
| Free tier | Limited | Limited | Yes (generous) | Yes (free models) | No | Trial credits | Trial credits | Trial credits | Trial credits | Yes |
Data-retention and training policies change; confirm the current terms on each vendor’s documentation before handling regulated or personal data. As of July 2026, none of the mainstream first-party APIs or enterprise gateways train on API inputs by default — the one exception is Google’s free AI Studio tier, which is why sensitive work belongs on the paid Gemini API or Vertex AI.
Pricing comparison: what you’ll actually pay
Flagship models by platform (per million tokens, USD)
| Model | Platform(s) | Input | Output | Notes |
|---|---|---|---|---|
| DeepSeek V4 | DeepSeek API, Together, OpenRouter | $0.14 | $0.28 | Open weights (MIT), 1M context — the floor |
| MiniMax M3 | Together, OpenRouter | $0.30 | $1.20 | Open weights, 1M context |
| Claude Haiku 4.5 | Anthropic, Bedrock, Vertex | $1.00 | $5.00 | Cost-per-point leader among hosted models |
| Gemini 3.1 Pro | Gemini API, Vertex AI | $2.00 | $12.00 | ≤200K tokens; $4/$18 above |
| Grok 4.5 | xAI API, OpenRouter | $2.00 | $6.00 | Token-efficient; cheap per task |
| GPT-5.4 | OpenAI, Azure Foundry | $2.50 | $15.00 | Value tier; tops standardized SWE-bench Pro |
| Claude Sonnet 5 | Anthropic, Bedrock, Vertex | $3.00 | $15.00 | 1M context; $2/$10 intro to 31 Aug; Batch halves it |
| Claude Opus 5 | Anthropic, Bedrock, Vertex | $5.00 | $25.00 | Best available model quality; #1 on the AA Index |
| GPT-5.6 | OpenAI, Azure Foundry | $5.00 | $30.00 | Leads agentic/terminal coding |
| Claude Fable 5 | Anthropic | $10.00 | $50.00 | Frontier ceiling; restored 1 July 2026 |
Gateway platforms (Bedrock, Vertex AI, Azure AI Foundry) bill these models at near-direct passthrough rates plus your cloud’s usual overheads; OpenRouter passes through at or near direct rates with a 5.5% fee on credit purchases. Two levers cut the effective cost more than switching models: prompt caching (roughly 10x cheaper on repeated context) and Batch APIs (50% off for asynchronous work). Watch the tokenizer, too — newer flagship models can emit more tokens for the same text, so compare per-request cost, not just the per-token rate.
Cost strategy: route by task, not loyalty. Pin routine, high-volume calls to an open-weight model on Groq, Together or Fireworks, reserve a flagship like Opus 5 or GPT-5.6 for the hard 20%, and use caching and Batch APIs wherever the workload allows.
Use-case recommendations
For the best model quality
Winner: Anthropic API with Claude Opus 5 ($5/$25)
The strongest generally-available model, the most reliable long-horizon agentic behaviour, and the reference API for tool use and MCP. Reach for Fable 5 only when you need the absolute ceiling and can absorb double the price.
For the broadest ecosystem
Winner: OpenAI API with GPT-5.6
One account covers text, embeddings, image, speech and a Realtime API, behind the SDK everyone else emulates. The best default when you want one vendor across every modality. Alternative: Anthropic if model quality outranks breadth.
For the lowest cost
Winner: DeepSeek V4 on the DeepSeek API or an open-model host ($0.14/$0.28)
Frontier-adjacent quality at roughly a 90x gap below flagship output pricing. From a major closed lab, Claude Haiku 4.5 ($1/$5) is the cost-per-point leader. Best value frontier-adjacent: Gemini 3.1 Pro at $2/$12.
For multi-model flexibility and no lock-in
Winner: OpenRouter
One key to 300+ models with near-direct pricing and automatic failover — the cleanest hedge against any single vendor’s pricing or availability changes.
For the fastest responses
Winner: Groq
Over 1,000 tokens per second on open-weight models and 3–4x faster time-to-first-token than GPU providers — the pick for voice agents and anything real-time. Alternatives: Fireworks AI and Together AI for fast open-model serving with more features.
For governed enterprise deployments
Winner: the gateway on the cloud you already run — AWS Bedrock, Azure AI Foundry or Google Vertex AI
Model gaps are small; compliance, data residency and integration decide enterprise impact, and a second cloud triples networking, observability and compliance overhead (EPC Group). Start where your data and identity already live: Bedrock for the broadest catalogue on AWS, Foundry for OpenAI-on-Microsoft, Vertex for Gemini-on-GCP.
For the longest context
Winner: Gemini 3.5 Pro on the Gemini API or Vertex AI (2M tokens)
The largest context window of any mainstream hosted model, paired with frontier-class quality. The Claude line offers 1M tokens with no long-context surcharge as the close alternative.
For prototyping on a budget
Winner: Google Gemini API free tier, plus OpenRouter free models
The most generous free tiers for building and testing before you commit spend — just keep sensitive data off the free AI Studio tier.
How to choose an LLM API
Nine dimensions decide the fit. Rank them for your build before you compare vendors.
Model access — do you need one specific frontier model, or the freedom to switch? First-party for the former, an aggregator or gateway for the latter. Price — token rates vary roughly 100x across the table above; a routing setup usually beats any single flagship subscription. Rate limits — first-party APIs tier limits by spend history, which can throttle a fast-scaling launch, whereas gateways inherit your cloud quotas. Latency and throughput — for real-time experiences, an inference specialist like Groq changes what’s possible. Feature depth — prompt caching, Batch APIs, structured outputs, tool use and fine-tuning are not uniform; the matrix above shows where the gaps are. Data privacy and retention — confirm training and retention terms in writing for anything regulated. Compliance — SOC 2, HIPAA, FedRAMP and EU residency point you toward specific gateways. Ecosystem lock-in — an OpenAI-compatible endpoint keeps migration cheap; deep proprietary features raise the switching cost. Reliability — automatic failover (OpenRouter) or multi-region gateways matter for anything user-facing.
Our picks are ranked by suitability for a new build, weighting model access, price, feature depth, reliability and lock-in, and cross-checked against the same evidence behind our best AI models ranking. Two adjacent decisions pair naturally with your API choice: LLM observability and evaluation tooling, which tells you whether the model is actually behaving in production, and a vector database, which powers retrieval for anything beyond the context window — both are covered in their own guides as part of the wider LLM stack.
Related guides
For the underlying models these APIs serve, see our best AI models ranking. For building software specifically, the best AI for coding guide covers models, IDEs and agents, and best AI code review covers the review layer that catches what agents miss. For speech-to-text specifically — a different class of API from the text-generation platforms here — see best AI for transcription, which compares Deepgram, AssemblyAI and the other voice APIs, and best text-to-speech APIs for the synthesis half of a voice-agent pipeline.
Frequently asked questions
What is an LLM API?
An LLM API is a service you call over the internet to run a large language model without hosting it yourself. You send text (a prompt), the provider runs it through a model such as Claude Opus 5 or GPT-5.6, and you get the model’s response back, billed per token. LLM APIs come in three forms: first-party APIs from the labs (OpenAI, Anthropic, Google), enterprise cloud gateways (AWS Bedrock, Azure AI Foundry, Google Vertex AI), and aggregators that route to many models through one endpoint (OpenRouter).
What is the best LLM API in 2026?
For model quality, the Anthropic API with Claude Opus 5 ($5/$25 per million tokens) is the strongest available. For the broadest ecosystem, the OpenAI API with GPT-5.6 is the default. For the best value and longest context, the Google Gemini API with Gemini 3.1 Pro ($2/$12) wins. For multi-model access through one key, OpenRouter reaches 300+ models. There is no single best API — the right choice depends on whether you optimise for quality, ecosystem, price, speed or governance.
What is the cheapest LLM API?
For raw token cost, DeepSeek V4 at $0.14/$0.28 per million tokens is the floor among capable models, served on the DeepSeek API or open-model hosts like Together and Fireworks. From a major closed lab, Claude Haiku 4.5 ($1/$5) is the cost-per-point leader. The cheapest frontier-adjacent option is Gemini 3.1 Pro at $2/$12. Prompt caching and Batch APIs cut effective costs further on repeated-context and asynchronous workloads.
Which LLM API is best for open-source models?
Together AI and Fireworks AI are the leading platforms for hosting and fine-tuning open-weight models such as DeepSeek V4, Llama and Qwen, and Groq serves them fastest. OpenRouter reaches open and closed models alike through one endpoint. All four accept the OpenAI SDK with a changed base URL, so you can trial them against each other without rewriting your integration.
What is the fastest LLM API?
Groq is the throughput leader, serving large open-weight models at over 1,000 tokens per second on its custom LPU hardware — roughly 3–4x faster on time-to-first-token than the fastest GPU-based providers (Groq). Fireworks AI and Together AI are the close alternatives when you want fast open-model serving with more features. Speed matters most for real-time experiences like voice agents where the user waits on each response.
Is OpenRouter cheaper than calling APIs directly?
Not on the token itself — OpenRouter charges no per-token markup and passes through at or very close to each model’s direct rate, then adds a 5.5% fee on credit purchases only (TrueFoundry). You pay slightly more than going direct, in exchange for one key to 300+ models, automatic failover and no per-vendor contracts. It is cheaper in practice when the flexibility and redundancy save you engineering time, not because the tokens cost less.
Do LLM API providers train on my data?
As of July 2026, the mainstream first-party APIs (OpenAI, Anthropic) and the enterprise gateways (AWS Bedrock, Azure AI Foundry, Google Vertex AI) do not train on your API inputs by default. The notable exception is Google’s free AI Studio tier, which may use submitted data to improve Google’s products — which is why sensitive work belongs on the paid Gemini API or Vertex AI. Data-retention and training terms change, so confirm the current policy on each vendor’s documentation before handling regulated or personal data.
What’s the difference between a first-party API and a gateway like Bedrock or OpenRouter?
A first-party API (OpenAI, Anthropic, Google) gives you one lab’s own models, with the newest releases first and the deepest features. A cloud gateway (AWS Bedrock, Azure AI Foundry, Google Vertex AI) puts many vendors’ models behind your cloud’s identity, logging and data-residency controls — governance is the point. An aggregator (OpenRouter) routes to hundreds of models through one endpoint for maximum flexibility and failover. Many production systems use all three: first-party for the flagship, a gateway for governed workloads, and an aggregator for cheap multi-model routing.
Can I switch LLM APIs without rewriting my code?
Increasingly, yes. Groq, Together, Fireworks, OpenRouter, xAI and DeepSeek all accept the OpenAI SDK with a changed base URL, so moving between them is a configuration change. Switching between the three first-party APIs (OpenAI, Anthropic, Google) still means adapting to each one’s request and response format, though thin abstraction layers and OpenRouter’s normalised schema smooth most of that over. Avoiding deep proprietary features keeps your switching cost low.
This guide is updated as APIs launch and pricing changes. Model figures are drawn from each model’s primary sources and our own model pages; platform figures are cited inline. Data-retention and training terms change frequently — confirm the current policy with each vendor before handling regulated data. Pricing and availability current as of 28 July 2026 and subject to change.