Skip to main content
Launching the open-source gateway
<- Articles

Best LLM APIs: Which to Use in 2026 (Compared)

No single LLM API wins every task. Eight providers compared on what they're best at, what they cost, and what the rate card leaves out.

Respan · October 20, 2026 · 21 min read

Between early September and mid-October 2026, OpenAI shipped the GPT-6 family, Anthropic released Claude Opus, Sonnet, and Haiku 5.5, Google made Gemini 4 Argon generally available, and xAI, Meta, Mistral, and DeepSeek all put new models behind their APIs. Several prices and limits moved with them, and a few are already scheduled to move again before the year ends.

That pace makes the choice harder than a benchmark chart suggests. Two providers can list the same per-token price and still bill a long prompt, a cached prefix, or a reasoning-heavy request very differently, and those details decide what a production workload ends up costing.

No single LLM API wins every task. The useful question is which one fits each workload you run, and how you'll call more than one without rebuilding your stack every time a provider ships a new model.

Below are the best LLM APIs in 2026, compared on what each one is best at, how much context it takes, what it costs, and what the rate card leaves out.

What is an LLM API?

An LLM API is a hosted endpoint that lets your application send a prompt to a large language model and get the output back over HTTP. Your code sends a JSON request naming the model, the messages, and parameters like reasoning effort or a response schema, and the provider runs the model on its own hardware and returns the result.

Billing is per token, with separate rates for input and output. On top of that base rate, providers layer caching discounts, batch pricing, and rate-limit tiers that grow with your spend.

Request formats have largely converged on OpenAI's, and xAI, Meta, DeepSeek, and Alibaba all document OpenAI-compatible endpoints, so switching between them often means changing a base URL and a model name. When an app calls more than one provider, an LLM gateway in front of them handles keys, fallbacks, and cost tracking in one place.

What are the best LLM APIs?

Beyond benchmark scores, the differences between these providers show up in context limits, tool support, caching rules, data policies, and where requests are processed. Which one fits depends on the workload you're running.

ProviderBest forMax contextStandout strength
OpenAIAgents using hosted tools1.05M tokensBuilt-in web and file search
AnthropicLong-running agentic coding1M tokensCache reads skip rate limits
Google GeminiMultimodal input, including video1M tokensSearch and Maps grounding
xAIReasoning with live X data500K (Grok 4.7)X Search as a tool
MetaOpenAI-compatible multimodal agents1M tokensContributor pricing option
MistralEU residency, open weights1M (Large 4 preview)Regional endpoints in Europe
DeepSeekHigh-volume, cost-sensitive workloads1M tokensHalf-price off-peak hours
Alibaba QwenLow-cost long-context calls1M tokensFlat rate to 1M (Flash)

OpenAI API

Three GPT-6 models are currently recommended on the OpenAI API: Astra at the top, GPT-6.1 Sol in the middle, and Luna as the small tier, all with a 1.05M-token context window. For agent work, the Responses API ships hosted tools for web search, file search, code interpreter, computer use, and MCP, so you don't have to build those yourself. Tool calling on GPT-6.1 Sol only works through the Responses API, though, since its Chat Completions support has no tool calling at all.

Pricing scales with speed and prompt length. Batch and Flex run at half the Standard rate, Fast mode doubles it, and Ultrafast on GPT-6.1 Sol costs six times as much. Once a prompt passes 272K tokens, the whole request bills at 2x input and 1.5x output. Access grows with spend through automatic usage tiers, which OpenAI cut from five to three in October, so check OpenAI's rate limits before a launch. Zero data retention needs OpenAI's approval, and regional processing in the US, EU, or UAE adds 10%.

Best for: Agents using hosted tools

Context window: 1.05M tokens

Standout strength: Built-in web and file search

Anthropic Claude API

Anthropic's Claude API offers four current models, Fable 5.1, Opus 5.5, Sonnet 5.5, and Haiku 5.5, and each one takes a full 1M-token context. Anthropic positions Opus 5.5 for long-running agentic coding and knowledge work, while Haiku 5.5 targets classification, extraction, and routing. Prompt caching gives you up to four breakpoints and a choice of a 5-minute or 1-hour TTL, and cache reads don't count toward your input-tokens-per-minute limit.

Long context carries no surcharge on Fable, Opus, or Sonnet, which bill the full window at standard rates, while Haiku 5.5 moves to higher rates once a prompt passes 100K tokens. Batch requests run at half price. Usage tiers come with monthly spend caps, and hitting one pauses API access until the first of the next month, so you might hit it earlier than your team expects during a launch. If you need zero data retention, Fable 5.1 isn't eligible because it requires 30-day retention. The API also isn't offered in China, Russia, or Hong Kong.

Best for: Long-running agentic coding

Context window: 1M tokens

Standout strength: Cache reads skip rate limits

Google Gemini API

Google's Gemini API made Gemini 4 Argon generally available on October 13, alongside Gemini 3.8 Flash as the mid tier and 3.1 Flash-Lite at the low end. The current models accept text, image, video, audio, and PDF input with a context window of about 1M tokens, and they can ground answers in Google Search or Google Maps, with 5,000 grounded requests a month free across models. Google limited Gemini 2.5 to existing users in September, so new projects start on the 3.x and 4 Gemini models.

Argon's price doubles on December 1, and 3.8 Flash doubles on January 1, 2027. The free tier covers the Flash and Flash-Lite models but not Argon, and Google's terms allow free-tier prompts to be used to improve its products and read by human reviewers, so keep sensitive data on a paid project. Request limits aren't published in the docs; you see them in AI Studio, and each tier also caps spend over rolling 10-minute windows.

Best for: Multimodal input, including video

Context window: About 1M tokens

Standout strength: Search and Maps grounding

xAI Grok API

Grok 4.7 is the flagship on the xAI API, launched September 21 with a 500K-token context window, while the cheaper Grok 4.3 and Grok 4.20 models take 1M. The API works with the OpenAI SDK by changing the base URL, supports function calling, structured outputs, and adjustable reasoning effort, and adds server-side tools for web search, X Search, and code execution, each billed per call.

xAI doesn't list a small, low-cost tier, and batch support is limited: Grok 4.7 doesn't support batch at all, and the 20% batch discount applies only to Grok 4.3 and the 4.20 models. Prompts of 200K tokens or more bill at double the standard rates, and the faster Grok 4.7 Fast variant isn't on the public API. Requests are stored for 30 days by default, and while an admin can turn on zero data retention, xAI doesn't recommend it for most customers. The default endpoint also doesn't guarantee a processing region, and the US-only endpoint costs 1.1x.

Best for: Reasoning with live X data

Context window: 500K tokens (Grok 4.7)

Standout strength: X Search as a tool

Meta Model API

Meta opened the Meta Model API to Muse Wonder on October 12, and the API also serves Muse Spark 1.3, both with 1M-token context windows. Existing OpenAI SDK code moves over with a base URL change, and Muse Wonder handles multi-turn tool use along with image and video input. Muse Spark comes in a standard version and a cheaper "contributor" version, and the trade is that contributor traffic is used to improve Meta's products.

Meta's Muse Wonder Full variant isn't on the API at all; it's only available through a Muse Code subscription. The API pages also don't publish rate limits, batch pricing, a free tier, or a data retention policy, so confirm those with Meta before you move production traffic onto it.

Best for: OpenAI-compatible multimodal agents

Context window: 1M tokens

Standout strength: Contributor pricing option

Mistral API

The Mistral API covers open-weight models across sizes, from Ministral 3 (3B, 8B, and 14B) through Small 4, Medium 3.5, and Large 3, with Large 4 in public preview since October 6. Large 3 and Small 4 are Apache 2.0, so a model you prototype on the API can later run on your own hardware. Since August, regional endpoints have let you keep inference in Europe or the US.

Large 4 brings a 1M-token context window, but it's still a preview: its weights haven't shipped, and it launched at a sale price with no stated end date. The generally available models top out at 256K. Pricing also doesn't track model size, since Medium 3.5 currently costs more per token than either Large model. Batch runs at half price, and rate limits are set per workspace and tier, visible only in the console.

Best for: EU residency, open weights

Context window: 1M (Large 4 preview), 256K GA

Standout strength: Regional endpoints in Europe

DeepSeek API

Two models make up the DeepSeek API lineup, V4-Pro and Flash, both with a 1M-token context and up to 384K output tokens, and the weights for both are on Hugging Face. The API exposes OpenAI- and Anthropic-compatible endpoints, runs thinking mode by default with adjustable reasoning effort, and caches context automatically. DeepSeek also swaps the model behind a name without renaming it, which matters if you pin evals to a model string, since the DeepSeek models behind deepseek-flash have changed twice since September.

The clock sets the price: off-peak rates are half the peak rate, and peak covers 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays. There's no batch API, so off-peak hours are how you save on async work. Concurrency is capped per account at 2,500 for Flash and 500 for V4-Pro, with 429 errors past that. DeepSeek's privacy policy says it collects, processes, and stores personal data in the People's Republic of China, which rules it out for some compliance setups. V4-Pro's future also wobbled in September, when DeepSeek announced and then reversed a plan to route it to Flash.

Best for: High-volume, cost-sensitive workloads

Context window: 1M tokens

Standout strength: Half-price off-peak hours

Alibaba Qwen API

Alibaba serves Qwen through Model Studio, where the current lineup is Qwen3.8-Max, Qwen3.7-Plus, and Qwen3.8-Flash, each with a 1M-token context and a thinking mode. Every region has its own OpenAI-compatible endpoint, and Alibaba also publishes open-weight Qwen3.8 models on Hugging Face.

Qwen3.7-Plus and Qwen3.7-Flash price by prompt size, with the tier set by the request's total input, so one long prompt bills every token at the higher rate. Qwen3.8-Max and Qwen3.8-Flash bill one rate across the full 1M window. API keys are bound to the region they were created in, the US (Virginia) region has no batch or fine-tuning, and Qwen3.8-Max's cache pricing only appears in the console.

Best for: Low-cost long-context calls

Context window: 1M tokens

Standout strength: Flat rate to 1M (Flash)

LLM API pricing comparison

Prices are each provider's list rates per 1M tokens on the standard tier, for the shortest-context bracket, as of October 20, 2026. Cached input is the price of a cache hit, and Alibaba prices are for its Singapore region. Each model links to its Respan model page, which shows the price through Respan's gateway.

ProviderModelInputCached inputOutputNote
OpenAIGPT-6 Astra$10.00$1.00$50.00Surcharge above 272K
OpenAIGPT-6.1 Sol$2.00$0.10$10.00Surcharge above 272K
OpenAIGPT-6 Luna$0.10$0.01$0.50Surcharge above 272K
AnthropicClaude Fable 5.1$10.00$0.25$50.00
AnthropicClaude Opus 5.5$4.00$0.20$20.00
AnthropicClaude Sonnet 5.5$2.00$0.10$10.00
AnthropicClaude Haiku 5.5$0.10$0.01$0.50Higher above 100K
GoogleGemini 4 Argon$2.00$0.10$10.00$4 / $20 from Dec 1
GoogleGemini 3.8 Flash$0.75$0.075$3.75Doubles Jan 1, 2027
GoogleGemini 3.1 Flash-Lite$0.25$0.025$1.50
xAIGrok 4.7$2.00$0.50$6.00Doubles at 200K+
xAIGrok 4.3$1.25$0.20$2.50Doubles at 200K+
MetaMuse Wonder$4.00$0.20$20.00
MetaMuse Spark 1.3$1.25$0.15$4.25
MistralMistral Large 4$0.68$0.07$2.09Sale; list $1.36 / $4.18
MistralMistral Small 4$0.15$0.015$0.60
DeepSeekV4-Pro$0.66$0.022$1.98Off-peak; peak doubles
DeepSeekV4.1 Flash$0.15$0.003$0.60Off-peak; peak doubles
AlibabaQwen3.8-Max$2.00Console only$6.00
AlibabaQwen3.8-Flash$0.15Console only$0.47

Sonnet 5.5 and GPT-6.1 Sol share the same $2 input and $10 output rates, so the gap between OpenAI and Anthropic pricing at that tier comes from the rules around the rate: OpenAI surcharges prompts past 272K tokens, while Anthropic bills Sonnet's full 1M window at the standard price. GPT-6 Luna and Claude Haiku 5.5 match each other at the low end too, until a Haiku prompt passes 100K tokens.

What the rate card doesn't show

The per-token rate is the starting point, and several billing rules change what a real request costs:

  • Long-context surcharges - OpenAI bills the whole request at 2x input and 1.5x output once a prompt passes 272K tokens, xAI doubles its rates at 200K, Claude Haiku 5.5 moves to a higher rate above 100K, and Qwen3.7 models price by prompt-size tier.
  • Cache writes - A cache hit is cheap, but writing the cache costs 1.25x normal input at both OpenAI and Anthropic. Anthropic charges 2x for a 1-hour write, and in Claude prompt caching that only pays off when the prefix gets reused enough times within the hour, while Gemini 3.8 Flash adds an hourly storage fee.
  • Reasoning tokens - OpenAI, Anthropic, and Google bill thinking tokens at the output rate, and OpenAI returns only a count of them, so a short answer can still produce a large bill if the model reasoned at length first.
  • Batch discounts - OpenAI, Anthropic's Message Batches API, Gemini, and Mistral take 50% off asynchronous work. xAI's discount is 20% and covers only Grok 4.3 and 4.20, and DeepSeek has no batch API.
  • Regional processing - Keeping inference in one region costs 10% more at OpenAI, Anthropic, and xAI.
  • Tokenizer changes - Anthropic notes that the tokenizer on Claude 4.7 and later produces about 30% more tokens for the same text, so a prompt can cost more on a newer model at an identical rate.

Because of these rules, the cheapest API for a workload depends on its traffic shape: how long the prompts run, how often a prefix repeats, how much the model reasons, and how much of the work can wait.

The best LLM API provider: Respan

Respan LLM Gateway

Picking the best LLM API for each workload usually means running more than one, and every provider brings its own keys, rate-limit tiers, caching rules, and outages. Respan is the AI router with built-in observability and automated evals: one OpenAI-compatible API to 1,000+ models across every major provider, where every request is traced, priced, and scored in the same place. Route, observe, and evaluate every LLM call.

Setup is a base URL and API key change in the OpenAI SDK, and the Respan AI gateway handles the rest:

  • One API for every model - Reach 1,000+ models across every major provider, and switch between them by changing the model name.
  • Stay up when a provider fails - List your fallback models once, and Respan moves to the next one the moment a provider errors or rate-limits. Requests that fail on upstream rate limits retry automatically.
  • Know where every dollar goes - See cost by model, by request, and by end customer, and set soft and hard spend limits per API key or per customer. A soft limit warns you as spend approaches it, and a hard limit stops a leaked key at the ceiling.
  • Pick the model per task - Respan Router (beta) classifies each request and picks a model that fits its context length and required capabilities, and with cost-aware routing on, it weighs cache costs before switching. It runs on Respan credits at the serving model's list price, with no router markup.
  • Catch regressions before users do - Score output with evals on a test set before shipping and on live production traffic after, then click any score to land on the trace behind it.
  • See exactly what your agents did - Every LLM call, tool run, and agent turn becomes a span in one trace, with input, output, latency, and cost on each.
  • Pay the way you want - Run on prepaid Respan credits with auto-reload and no processing fee, with any provider discount Respan gets passed straight through, or bring your own provider keys on Team and above.

Instead of reading logs after the fact, use Respan to run observability in production, know when production shifts, and act before it spreads. The Free plan includes 100k logs and 1k scores, with unlimited seats.

LLM API news

New flagship models reached the API at nearly every major provider between September and mid-October 2026, and several came with price changes that take effect later this year:

  • GPT-6 arrives - OpenAI released the GPT-6 family across September, with Astra on September 3, Sol and Luna on September 22, and GPT-6.1 Sol on September 29. On October 6, it cut its usage tiers from five to three.
  • Claude 5.5 lineup - Anthropic released its Claude 5.5 models in sequence: Opus 5.5 on September 22, Sonnet 5.5 on September 28, and Haiku 5.5 on October 7, when Sonnet 5.5's cache-read price also dropped from $0.20 to $0.10 per 1M tokens.
  • Gemini 4 goes GA - Google made Gemini 4 Argon generally available on October 13 at $2 input and $10 output per 1M tokens through November 30, rising to $4 and $20 on December 1.
  • Grok 4.7 launches - xAI released Grok 4.7 on September 21 with a 500K-token context window, keeping the faster Grok 4.7 Fast variant limited to Cursor and Grok Build.
  • Meta adds Muse Wonder - Meta added Muse Wonder to its Model API on October 12 at $4 input and $20 output per 1M tokens, with a 1M-token context.
  • Mistral previews Large 4 - Mistral Large 4 entered public preview on October 6 with a 1M-token context and a launch sale price, with open weights announced but not yet released.
  • DeepSeek updates Flash - On October 17, deepseek-flash moved to DeepSeek V4.1 Flash (the 1017 build), and DeepSeek's Search and Fetch APIs became generally available at $0.75 per 1,000 calls.
  • OpenAI outage - On September 29, an API outage caused elevated errors for more than five hours across 12 OpenAI API components, including Chat Completions, Responses, Batch, and Realtime.

The September 29 outage is a reminder that a single provider going down takes every feature built on it down too, unless a fallback chain sends those requests to another model.

FAQ

Should you use a local LLM or an LLM API?

Use an LLM API unless your data can't leave your own infrastructure or your traffic is steady enough to keep dedicated GPUs busy. The frontier models, such as Claude Fable 5.1, GPT-6 Astra, and Gemini 4 Argon, aren't released as open weights, so you can't run them yourself. Running locally means buying or renting GPUs and handling serving, scaling, and upgrades yourself, in exchange for no per-token bill and full control of the data.

The middle ground is an open-weight model that's also offered as an API, such as DeepSeek V4, Qwen3.8, or Mistral's Apache 2.0 models. You can prototype against the hosted API and move the same model in-house later if cost or compliance requires it.

What is the cheapest LLM API?

On per-token price, the cheapest current options are small models: Ministral 3 3B at $0.10 per 1M input and output tokens, Qwen3.7-Flash from $0.03 input and $0.13 output for prompts up to 32K tokens, and GPT-6 Luna and Claude Haiku 5.5 at $0.10 input and $0.50 output. DeepSeek Flash comes in at $0.15 and $0.60 during off-peak hours.

The cheapest per token isn't always the cheapest per task, though, since a small model that needs retries or longer reasoning can cost more than a mid-tier model that gets it right the first time. Respan shows cost per request and per end customer across every model you call, so you can compare what each task costs on your own traffic, and Respan Router (beta) picks a cheaper model when one fits the task.

Is there a free LLM API?

Yes. Google's Gemini API has a free tier on its Flash and Flash-Lite models (not Gemini 4 Argon), Mistral's Experiment plan needs only a verified phone number, and Alibaba Model Studio gives 1M free tokens per model for 90 days in its Singapore region. The trade-off is your data: Google can use free-tier prompts to improve its products, and Mistral says Experiment-plan requests may be used to train its models.

Anthropic, xAI, and DeepSeek don't offer a free API tier, and while OpenAI lists a free usage tier, its current GPT-6 models aren't available on it. Respan's Free plan covers the other half of the stack at no cost, with 100k logs and 1k eval scores, so you can measure a free model's output before you pay for anything.

Which LLM API is the fastest?

It depends more on the model tier and reasoning setting than on the provider. On the Artificial Analysis provider leaderboard, the top output speeds and lowest latencies come from inference hosts like Cerebras and Baseten serving open-weight models, while first-party APIs vary widely with reasoning effort, and a model set to maximum reasoning can take tens of seconds before its first token.

Within a provider, the small tiers at low reasoning effort respond fastest, and two providers sell speed directly. OpenAI's Fast and Ultrafast tiers cost 2x and up to 6x Standard, and Anthropic's fast mode on Opus 5.5 delivers up to 2.5x the output tokens per second, though not a faster time to first token. Respan records latency on every request by model, so you can compare speeds on your own prompts, and the gateway typically adds 30-40ms.

How do you monitor and optimize LLM API costs?

Log every call with its model, token counts, and cost, tag it with the customer and feature that triggered it, and set alerts before spend reaches a limit instead of after the invoice arrives. Optimization comes once you can see the spend: cache stable prompt prefixes, move asynchronous work to batch, cap output length, and send simple steps to smaller models.

Respan handles the monitoring by default, since every request through the gateway is logged with cost by model, by request, and by end customer. Monitors alert you in Slack, email, or a webhook when cost crosses a threshold, hard limits block spend at the ceiling, and exact-repeat caching and Respan Router cut the cost of the calls themselves.

Related articles

Built for AI agents.
Break less.
Ship more.