Hugging Face hands language-model routing to OpenRouter, and custom provider keys stop working
Inference Providers now picks a provider per request with automatic retries and policy suffixes, but bring-your-own keys for language models are gone.
Hugging Face has replaced the router behind its Inference Providers service with OpenRouter's. In a post published today, the company says requests to language models on its platform now go through OpenRouter, which picks a provider for each call and retries on another one if the first fails. Hugging Face calls it the first step of a partnership between the two companies. Its Inference Providers documentation has already been updated to say routing is powered by OpenRouter.
For anyone already calling open-weight models through Hugging Face, the change is meant to be invisible at the code level: the same token, the same endpoint and the same model ids. What changes is how a provider gets chosen, what happens when it fails, and one billing rule that breaks existing setups.
What actually changes
Before, Hugging Face picked one provider for a request and passed back that provider's error if it failed. Now OpenRouter's router decides, using what Hugging Face describes as live measurements of price, speed and reliability, and moves a failed attempt to the next provider inside the same call. According to the post, OpenRouter routes across more than 80 providers.
Developers keep the ability to steer. A suffix on the model id sets the policy: :fastest for highest throughput, :cheapest for lowest price, or a provider name such as :novita to pin one provider. Without a suffix, the default balances the three factors. Users and organizations can also switch off specific providers in their settings, and the router will never send requests there.
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 means a coding agent or SDK built for either vendor's API can point at Hugging Face's endpoint and reach open-weight models without a translation layer.
The breaking change
Language-model requests are now billed to the Hugging Face account or organization, so custom provider API keys no longer work for those models. Teams that brought their own key for a specific inference provider through Hugging Face will need to either move that traffic to the provider directly or accept billing through Hugging Face. Custom keys for image and video providers keep working, and image, video and audio generation continue to run through Hugging Face's own Inference Providers path, not OpenRouter.
Hugging Face says pricing does not change: users pay the provider's price on their Hugging Face bill with no markup. PRO accounts get $2 of monthly credits, and Team and Enterprise organizations get $2 per seat.
Prompt caching and routing
One detail matters for cost. Hugging Face says routing is cache-aware: a conversation stays on the provider that holds its prompt cache. To make that explicit, clients can send a stable UUID per conversation in an X-HF-Session-Id header. Without it, a router that optimizes each call independently could, in principle, move a long conversation between providers and lose cache hits. If you run multi-turn agents through this endpoint, setting the header is the cheap way to keep caching predictable.
The numbers behind the pitch
The post leans on OpenRouter's own usage data, and those figures should be read as vendor statistics, not independent measurement. By that data, open-weight models went from 26.8% of tokens served on OpenRouter in October 2025 to 71.7% at the end of September 2026, after peaking at 77.5% in July. Hugging Face also cites average prices of $0.28 per million input tokens and $1.62 per million output tokens for open-weight models, against $1.27 and $6.36 for closed ones.
It is also candid about the gap. Citing the Artificial Analysis Intelligence Index, the post says the top open-weight model, Kimi K3.1 Pro, scores 46 against 65 for Claude Fable 5.2, at about a seventh of the cost per task ($3.68 against $26.54). OpenRouter says its rebuilt routing cut capacity errors by 46% and improved time to first token by 16.9% and throughput by 16.3%; those are OpenRouter's measurements as reported by Hugging Face, and Promptea could not open OpenRouter's own write-up to check them.
What it means for model choice
The practical effect is that the provider becomes a runtime decision rather than a design-time one. Until now, picking an open-weight model on Hugging Face also meant living with whichever provider served it, including its outages. With retries and policy suffixes, the questions shift to which model fits the task and whether you care more about latency or price for that workload.
The trade-offs are worth naming. Automatic routing means two identical requests can be served by different providers, which may differ in quantization, context limits or tool-calling behavior. The new Providers and Metrics tabs on model pages, which show each provider's price, speed and uptime over the last 24 hours, and the per-provider spend breakdown in the usage overview, are the tools for auditing that. Teams that need reproducible behavior should pin a provider with a suffix rather than rely on the default.
Hugging Face lists two next steps: connecting an OpenRouter account to Hugging Face, and routing more task types through OpenRouter. It has not given dates for either.
为什么重要
- Provider choice for open-weight models becomes a per-request runtime decision, with automatic failover instead of a returned error.
- Teams using their own provider keys for language models through Hugging Face must change their setup.
- Cache-aware routing with a session header affects how much multi-turn agents pay for repeated context.
要点
- Hugging Face Inference Providers now routes language-model requests through OpenRouter, retrying failed calls on another provider.
- Suffixes such as :fastest, :cheapest or a provider name still let you control routing, and providers can be disabled in settings.
- Custom provider API keys no longer work for language models; image and video keys still do.
- Hugging Face says there is no markup, and that an X-HF-Session-Id header keeps a conversation on the provider holding its prompt cache.
来源
- Hugging Face一手来源Hugging Face and OpenRouter join forces to make open-weight models easy to runhuggingface.co
- Hugging Face一手来源Inference Providers documentationhuggingface.co
- inference
- open-weight models
- routing
- api pricing
- prompt caching
- model selection
- Hugging Face
- OpenRouter