Hugging Face hands LLM routing to OpenRouter: failover by default, custom provider keys gone
On November 16, Hugging Face replaced the custom router behind Inference Providers with OpenRouter's for all language models. Requests now fail over across providers inside one call, pricing is unchanged, and bring-your-own provider keys stop working for chat models.
On November 16, Hugging Face switched Inference Providers from its own router to OpenRouter’s. Every request to a language model made with a Hugging Face token now passes through OpenRouter, which picks a provider per call on live price, speed and reliability and retries on another provider if the first one fails. OpenRouter published a matching announcement the same day.
For most code nothing changes: same token, same endpoints, same bill. But the switch changes failure behavior, removes one feature outright, and moves a large share of open-weight inference traffic onto a single routing layer. If you call chat models through the Hub, three details matter.
What changed in the request path
Before the switch, Inference Providers picked one provider for a request and returned that provider’s error if it failed. Now a failed attempt is retried on the next best provider inside the same call, and traffic drifts away from a provider that is slow or erroring until it recovers.
Provider choice is controlled with a suffix on the model ID, which the Hugging Face post illustrates with GLM-5.3:
zai-org/GLM-5.3 # default: best mix of price, speed and reliability
zai-org/GLM-5.3:fastest # highest throughput
zai-org/GLM-5.3:cheapest # lowest price
zai-org/GLM-5.3:novita # only Novita
The router accepts OpenAI’s Chat Completions and Responses formats and Anthropic’s Messages format for every chat model, whatever provider sits behind it. That is what lets the same token drive Claude Code, Codex, OpenCode, Pi or Hermes Agent against open-weight models, and both companies published setup guides for those agents.
Routing is cache-aware: a conversation stays on the provider that holds its prompt cache. Hugging Face recommends making this explicit by sending a stable UUID per conversation in an X-HF-Session-Id header. This matters for agent loops, where a silent provider switch mid-session turns cheap cached input tokens back into full-price ones.
OpenRouter says 160 models from 38 labs are reachable this way at launch, which is every model it serves that also has a Hub page. The list includes DeepSeek V4.1 Flash, Kimi K3.1 Pro, GLM 5.3, Qwen3.8 27B, MiniMax M3.1 Flash, Nemotron 3 Ultra and gpt-oss-120b. Image, video and audio generation are not part of the change and still go directly through Inference Providers.
The breaking change: no more custom provider keys for LLMs
Because language-model requests are now billed through OpenRouter to a Hugging Face account or organization, you can no longer attach your own API key for a provider on these models. Teams that used Inference Providers as a thin client over an existing Together, Fireworks or Novita contract, to keep negotiated rates or committed spend, lose that path for chat models. Custom keys for image and video providers keep working.
What remains is exclusion and pinning. You can pin a provider with the model:provider suffix, and you can switch providers off in account or organization settings so the router never sends them traffic. Organization-level exclusions apply to every request billed to that organization, which is the control that compliance teams will care about: with default routing, a request can land on any enabled provider, so data-residency or vendor-approval rules now need to be expressed as an explicit exclusion list rather than assumed from a hard-coded provider.
Pricing itself does not change. You pay the provider’s price on the Hugging Face bill with no markup, and PRO users keep $2 of monthly credits ($2 per seat for Team and Enterprise).
What the reliability numbers do and do not show
OpenRouter rebuilt its provider routing in October to stop sorting by lowest list price alone. In its own live experiment, the new router produced 46% fewer requests hitting a capacity error, 16.9% faster time to first token and 16.3% higher throughput. The Hugging Face post repeats those three figures. OpenRouter’s post includes a fourth that Hugging Face’s leaves out: the gains came at 6.0% higher cost per request.
That trade is the practical point for anyone with a budget. The default policy optimizes a blend, not price, so a workload that previously resolved to the cheapest provider may now cost slightly more per call in exchange for fewer 429s and faster first tokens. If cost is the constraint, :cheapest restores the old behavior explicitly. All of these figures are self-reported by OpenRouter from its own traffic and have not been independently replicated.
Two new tabs on each model page make the trade inspectable: Providers lists every provider the model can route to with input and output price, speed and 24-hour uptime, and Metrics shows the best available price, throughput, time to first token and context length. The usage overview now breaks spend down by the provider each request actually reached.
Why Hugging Face gave up its own router
The post frames the deal with usage data. On OpenRouter, open-weight models went from 26.8% of tokens served in October 2025 to 71.7% at the end of September 2026, after peaking at 77.5% in July. The most used model on OpenRouter this week is open-weight: DeepSeek V4.1 Flash 1017, at 59.2 trillion tokens. Open-weight models average $0.28 per million input tokens and $1.62 per million output tokens there, against $1.27 and $6.36 for closed models.
Hugging Face is also candid about the capability gap. On the Artificial Analysis Intelligence Index, Kimi K3.1 Pro, the best open-weight model, scores 46 against 65 for Claude Fable 5.2, at about a seventh of the cost per task ($3.68 against $26.54).
Routing quality depends on live measurements across a lot of traffic, and OpenRouter has more of it: over 800 trillion tokens a month across 600+ models and 80+ providers, by its own count. Hugging Face has been adding providers one at a time, including DeepInfra in April and Baseten in August, but a router that only sees Hub traffic has less signal on which provider is degraded right now. Outsourcing the routing layer keeps the Hub as the catalog, identity and billing surface while a specialist handles provider selection.
The integration also runs in the other direction. OpenRouter can now write a JSON trace of each request (input messages, output, token counts and cost, with media stripped) to a Hugging Face Storage Bucket you own, through its Broadcast feature in beta. That puts production prompts and responses next to the datasets and models you would use to build an evaluation set or fine-tune an open-weight replacement.
What to check this week
- Custom keys. If any chat-model call relied on your own provider key through Inference Providers, it no longer does. Call that provider directly, or accept Hub billing.
- Provider allowlists. Review the Inference Providers settings for your account and organization and switch off anything not approved for your data.
- Cost drift. Compare spend by provider in the usage overview after a few days; add
:cheapestwhere latency is not critical. - Cache stability. Send
X-HF-Session-Idon multi-turn and agent workloads. - Concentration. Hugging Face calls this “the first step”: OpenRouter account linking and more task types routed through OpenRouter are next, with no dates given. One router now sits in front of a growing share of open-weight inference, so an OpenRouter outage becomes a Hub inference outage for language models. Fallback paths that call a provider directly are worth keeping.
Get Insanely Good at AI
The book for developers who want to understand how AI actually works. LLMs, prompt engineering, RAG, AI agents, and production systems.
Keep Reading
How to Profile PyTorch Attention Kernels on A100 GPUs
Learn how to use the PyTorch profiler to identify memory and compute bottlenecks in attention mechanisms using Hugging Face's tracing methodology.
Hugging Face Sale Talks Put Open AI Infrastructure at $13B
Hugging Face is reportedly evaluating acquisition interest at a valuation of $13 billion or more, nearly triple its 2023 funding valuation.
One-Click Azure Deployment Arrives for 11,000 Open Models
Enterprise developers can now deploy over 11,000 curated open-weight Hugging Face models directly to Azure A100 and H100 GPUs via Microsoft Foundry.
$7B OpenRouter Deal Positions Stripe to Bill Agentic Workloads
Stripe will acquire the AI gateway platform OpenRouter for over $7 billion, positioning the company to handle routing and billing for agentic workloads.
Chinese AI labs are trimming offensive cyber skills from new models as Beijing drafts export curbs
Bloomberg reported on November 16 that Alibaba, Tencent and Moonshot have shipped recent models with reduced offensive cyber capability after a Ministry of Commerce draft proposed banning exports of AI attack tools. The methods differ, and only Moonshot published a number.