Hugging Face moves its LLM routing to OpenRouter: what changes
Since 16 November 2026, chat requests on Hugging Face Inference Providers are routed by OpenRouter. Billing stays with Hugging Face, failover is new, and custom provider keys for language models are gone.
Hugging Face no longer decides which provider answers a chat request made through its Inference Providers service. Since 16 November 2026 that decision belongs to OpenRouter. In a post signed by seven authors, including co-founder Julien Chaumond, the company says it is “switching Inference Providers from our own custom router to OpenRouter’s”. Language-model requests now go through OpenRouter, which picks a provider “based on live price, speed and reliability, and retries on another provider if the first one fails.” OpenRouter published its own announcement the same day.
For most users the visible surface does not move. Requests still go to router.huggingface.co, are authenticated with a Hugging Face token and are billed on the Hugging Face invoice at the provider’s price. What changes underneath is the routing policy, the failure behaviour and one billing option. Hugging Face lists a single breaking change: you can no longer bring your own API key for a provider when calling language models.
This article sets out what the switch does, how the new routing decides, what it costs, and what a team that runs open-weight models through Hugging Face should check. GenAI Brief has not run traffic through the new router; performance figures below are OpenRouter’s and Hugging Face’s, and are labelled as such.
What changed on 16 November, in one table
Inference Providers launched on the Hub in January 2025 as a single API and bill in front of third-party inference companies. Until 16 November 2026 Hugging Face ran the router itself. The 16 November post describes the old behaviour in one sentence: “Before, Inference Providers picked one provider for your request and returned its error if it failed.”
| Before 16 November 2026 | After 16 November 2026 | |
|---|---|---|
| Who picks the provider for language models | Hugging Face’s own router | OpenRouter’s router |
| Endpoint and token | router.huggingface.co, Hugging Face token | Unchanged |
| Failed request | Error from the chosen provider returned to caller | Retried on the next provider inside the same call, unless pinned |
| Policy suffixes | :fastest, :cheapest, :provider | Same suffixes; default now weighs price, speed and reliability |
| Own provider API key for language models | Supported | No longer supported |
| Own provider key for image and video | Supported | Still supported |
| Image, video, audio generation | Hugging Face routing | Still Hugging Face routing, not OpenRouter |
| Billing | Provider price, no Hugging Face markup | Unchanged |
| Provider visibility | Provider list on model pages | New Providers and Metrics tabs, spend by provider |
Compiled by GenAI Brief from the Hugging Face post, Hugging Face documentation and OpenRouter’s announcement, read on 18 November 2026.
The API surface is broad. Hugging Face says the router supports OpenAI’s Chat Completions and Responses APIs and Anthropic’s Messages API “for every chat model, whatever the provider behind it.” Its documentation still labels the Responses API as beta and says all chat completion models “should be compatible” with it, which is a softer statement than the blog’s. The Hub publishes setup guides for Claude Code, Codex, OpenCode, Pi and Hermes Agent.
OpenRouter’s post adds two numbers Hugging Face does not give. It says 160 models from 38 labs are available this way, “which is every model OpenRouter serves that has a page on the Hub”, and it names the most used, including DeepSeek V4.1 Flash, Kimi K3.1 Pro and Kimi K3, GLM 5.3 and GLM 5.3 Flash, Qwen3.8 27B, MiniMax M3.1 Flash, Xiaomi MiMo-V2.6-Flash, NVIDIA Nemotron 3 Ultra and OpenAI’s gpt-oss-120b.
How the router now decides
OpenRouter rebuilt its default provider routing on 28 October 2026, three weeks before the Hugging Face switch. That rebuild is what Hugging Face customers now get. OpenRouter says its old default “mostly rewarded providers for one thing: a low price”, based almost entirely on input token price, and that this let providers win traffic by “listing an artificially low input price and then making back the difference with overpriced cached or completion tokens.”
The new router computes what OpenRouter calls a Routing Cost for each provider serving a model, on every request. In OpenRouter’s words: “what does one try cost, and how often does it work?” The cost of one try is the effective price plus a money value for waiting. The result is divided by the probability that the try succeeds. OpenRouter’s worked illustration is a $0.40 price plus 0.60 of waiting cost, so one try costs 1.00; with an 80 per cent chance of success, the Routing Cost is 1.25 per good answer. Lower wins more traffic.
The inputs, as OpenRouter documents them:
- Effective price. What the provider would actually charge, computed from recent traffic with the provider’s real cache hit rate and the model’s typical mix of input and output tokens, not the list price.
- Throughput. Output tokens per second measured end to end, including time to first token. A faster provider “can charge more and still win your request.”
- Time to first token. Added again on its own, because agent sessions make many tool calls in a row and each waits for a first token.
- Rate limits. A 429 adds the wait plus a penalty, weighted by how often the provider rate-limits.
- Reliability. Provider-caused errors carry “a heavy penalty”. OpenRouter’s example: a 1 per cent error rate with an 8x penalty raises the Routing Cost by about 8 per cent. A provider whose error rate climbs far above the others for the same model stops receiving requests until it recovers.
- Quality. As of October, “the main check is whether tool calls come back well formed”. A provider flagged for broken tool calls, or for benchmark accuracy well below what the model should score, “drops far behind and only gets a small amount of test traffic”.
Traffic is not sent to the single best provider. Providers inside what OpenRouter calls the competitive edge share most of it, and two guardrails apply: every provider keeps a trickle of traffic so recovery can be noticed, and a provider that starts failing gets less until it recovers.
Hugging Face’s routing documentation summarises the same three inputs, effective price, speed and reliability, and says the measures are updated in real time.
The suffixes still work, with one difference in failover
Hugging Face kept its model-id suffixes, which matter because many coding agents let a user set only a model name:
| Model id | What it does | Failover |
|---|---|---|
zai-org/GLM-5.3 | Default routing: best mix of price, speed and reliability | Yes |
zai-org/GLM-5.3:fastest | Highest throughput | Yes, per Hugging Face’s description of OpenRouter retries |
zai-org/GLM-5.3:cheapest | Lowest price | Yes, per the same description |
zai-org/GLM-5.3:novita | Only Novita, or an error if Novita does not serve the model | No: “A pinned provider (:novita) is never replaced.” |
Source: Hugging Face blog post and routing documentation, 16 to 18 November 2026.
The failover row is the practical one. A team that pinned a provider to get deterministic behaviour, for example to keep a known quantisation or data policy, keeps that determinism but also keeps the old failure mode: an outage at that provider is an error. A team on the default or a policy suffix now gets an automatic retry, and should expect that a single logical request may be served by a different provider from the one that received the first try.
Caching and conversation stickiness
Routing is cache-aware. OpenRouter’s routing post says “only the first request in a conversation will have a provider algorithmically selected”, and that an ongoing conversation is pinned to its original provider so the prompt cache stays warm, falling back to another provider if that one becomes unavailable. On Hugging Face, the prompt caching guide asks callers to make this explicit by sending a stable UUID per conversation in the X-HF-Session-Id header; “Other values are ignored.” Hugging Face says its Python and JavaScript clients do this automatically. Callers using a generic OpenAI or Anthropic SDK against router.huggingface.co need to add the header themselves.
Caching is worth getting right for agent workloads. OpenRouter’s October data recap says agent-classified API keys took 76 per cent of its tokens in October and that most providers served cached prefixes for 85 to 97 per cent of agentic prompt tokens. Those are OpenRouter-wide figures, not Hugging Face traffic, but they show why a conversation that hops providers on every turn can cost far more than one that stays put.
What OpenRouter measured, including the part Hugging Face left out
Hugging Face’s post says that “in OpenRouter’s measurements, the new routing cut capacity errors by 46% and improved time to first token by 16.9% and throughput by 16.3%.” Those numbers are accurate to OpenRouter’s post. OpenRouter’s own Hugging Face announcement adds the fourth number: the gains came “for 6.0% higher cost per request.”
OpenRouter describes the method as a switchback experiment rather than an A/B test, because routing changes affect the control group: if the new router moves traffic away from a struggling provider, the old router’s requests to that provider get faster. It split each day into three-hour blocks, flipped matched pairs between the old and new routers with a one-hour burn-in discarded at each changeover, and ran it for a week across “a representative sample of open source models”. The test covered more than 24 million requests and 103 billion input tokens.
| Measure | Old router | New router | Change (95% interval) |
|---|---|---|---|
| Time to first token, median | 1,007 ms | 837 ms | 16.9% lower (13.9% to 19.8%) |
| Time to first token, p95 | 4,601 ms | 3,733 ms | 18.9% lower |
| Throughput, median | 62.4 tok/s | 72.6 tok/s | 16.3% higher (13.8% to 18.9%) |
| Whole request, median | 4.00 s | 3.24 s | 19.0% lower |
| Requests that hit at least one 429 | 7.1% | 3.8% | 46% fewer (35% to 59%) |
| Requests that needed a retry | 10.4% | 6.9% | 34% fewer |
| Cost per 1,000 requests | $1.25 | $1.32 | 6.0% higher (5.1% to 7.0%) |
| Cost per million tokens | $0.301 | $0.324 | 7.3% higher (4.9% to 9.6%) |
Source: OpenRouter, “How we rebuilt provider routing”, 28 October 2026. OpenRouter-reported; measured on OpenRouter traffic, not on Hugging Face traffic. The two cost percentages are OpenRouter’s and do not equal the ratio of the rounded dollar figures shown ($1.32 against $1.25 is 5.6 per cent; $0.324 against $0.301 is 7.6 per cent). OpenRouter does not explain the gap; it says it measured the impact per model, which may account for it.
Three cautions apply before carrying these numbers over to a Hugging Face workload. First, the baseline was OpenRouter’s old price-led router, not Hugging Face’s old router, whose policy Hugging Face’s post describes only as picking one provider. Second, the sample was open-weight models on OpenRouter’s general traffic mix; a workload dominated by long agent sessions with warm caches may see different results. Third, OpenRouter says the results came “before providers have had any time to optimize for the new algorithm”, which cuts both ways for anyone forecasting costs.
A worked cost example
This example is hypothetical. The spend figure is invented; only the 6.0 and 7.3 per cent figures come from OpenRouter, and they may not apply to any given workload.
A team spends $8,000 a month on chat inference through Hugging Face, all on default routing, and its traffic behaves like OpenRouter’s experimental sample. If its cost per request rose by the measured 6.0 per cent, the bill would go to about $8,480 a month, $480 more. In exchange, on OpenRouter’s numbers, roughly one request in thirty fewer would hit a rate limit and median time to first token would fall by about 170 ms.
For a batch summarisation job that runs overnight, the latency gain is worth little and :cheapest is the more defensible choice. For an interactive coding agent making dozens of tool calls per task, a sixth less waiting per call may be worth more than 6 per cent of the bill. The suffix is the control: Hugging Face has kept it, and the decision can be made per workload rather than per account.
Billing, credits and the end of custom keys
Hugging Face’s pricing page says: “Hugging Face charges you the same rates as the provider, with no additional fees.” The 16 November post confirms that pricing does not change and that Hugging Face does not add a markup. Neither post says whether OpenRouter takes a share of the provider price on traffic it routes for Hugging Face; the commercial terms between the two companies are not described.
Included credits are small and general-purpose:
| Account | Monthly credits | Where they can be spent |
|---|---|---|
| Free | None; credits must be purchased | Pay-as-you-go |
| PRO | $2.00 | All Hugging Face compute services |
| Team or Enterprise organisation | $2.00 per seat, pooled | All Hugging Face compute services |
Source: Hugging Face Pricing and Billing documentation, read 18 November 2026.
Organisation billing works through the X-HF-Bill-To header, or the bill_to parameter in Hugging Face’s clients, and Enterprise organisations with resource groups can attribute costs to a group ID. Enterprise plans also get a usage API that returns daily spend broken down by member, model and provider, with token counts for chat completions. Hugging Face says costs in that API are rounded to the nearest cent per row and appear up to two hours after a request.
The breaking change
The post states it plainly: “Requests to language models now go through OpenRouter and are billed to your Hugging Face account or organization, so you can no longer use your own API key for a provider with these models.” Custom keys for image and video providers keep working.
This matters for one group in particular: teams that negotiated rates or reserved capacity directly with an inference company and used Hugging Face as the front door. Their chat traffic now bills at the provider’s list price through Hugging Face, and their own contract no longer applies to those calls. The options are to accept the Hugging Face bill, to call the provider’s API directly, or to use OpenRouter’s own API, which supports bring-your-own-key. OpenRouter’s documentation says the cost of using custom provider keys there is “5% of what the same model/provider would cost normally on OpenRouter”, deducted from OpenRouter credits, with a free allowance that is plan-dependent ($25,000 of list-price inference a month on pay-as-you-go). That is a separate account with separate settings, not a Hugging Face feature. Hugging Face lists “Connect your OpenRouter account to Hugging Face” as a next step, without a date.
Controlling which providers see your traffic
Provider settings are the main governance control, and they carry over. In user settings a provider can be turned off, and Hugging Face says “the router never sends your requests to a provider you turned off, and pinning it with a suffix returns an error.” For requests billed to an organisation, the organisation’s settings apply instead of the member’s, and, according to the pricing page, “explicitly requesting a provider that is disabled by the organization returns an error.”
There is one gap we could not close from the documentation. The Hugging Face post says OpenRouter routes “across 80+ providers”. Hugging Face’s providers page says chat requests go to “a provider serving the model, including the ones below”, and lists 19 language-model providers with suffixes: Baseten, Cerebras, Cohere, CoreWeave, DeepInfra, DigitalOcean, Featherless AI, Fireworks, Liquid AI, Mistral, Moonshot AI, Nebius, Novita, Parasail, Prime Intellect, Reka, Tencent, Together AI and Zai. The page also says you can turn off “the providers listed on this page”. It does not say whether every provider in OpenRouter’s pool for a given model appears in the Hugging Face settings toggle. An organisation that relies on an allow-list of approved processors should check the settings page and the new Providers tab for its models, rather than assume the 19-name list is complete.
Data handling: what the documents say and do not say
The Hugging Face security page, as read on 18 November 2026, says Hugging Face “does not store any user data for training purposes”, does not store the request body or response when routing, and keeps logs “for debugging purposes for up to 30 days, but no user data or tokens are stored.” It refers users to each provider’s data policy, and says routing uses TLS in transit.
That page does not mention OpenRouter. Neither the 16 November post nor OpenRouter’s announcement describes what OpenRouter logs or retains for requests that arrive from Hugging Face, or whether OpenRouter’s own account-level privacy settings apply to them. Since every chat request now passes through a second company, a team with contractual data-processing requirements should ask both Hugging Face and OpenRouter for a written answer before relying on the security page as it stands.
Corporate ownership is also worth noting for procurement. OpenRouter announced on 19 August 2026 that it is joining Stripe, saying the transaction was “subject to customary closing conditions” and expected to close “in the coming weeks”. OpenRouter wrote that routing decisions “will remain driven by one thing: what’s best for you, the user.” We did not find a later statement confirming the close.
The other direction: traces into Storage Buckets
OpenRouter’s announcement describes a second integration that the Hugging Face post leaves out. OpenRouter can now send a trace of each request to a Hugging Face Storage Bucket the customer owns, through its Broadcast feature, which OpenRouter labels beta.
According to OpenRouter’s setup guide, each trace is written as a JSON file through Hugging Face’s S3-compatible API, at a default path of openrouter-traces/{date}, with template variables including {apiKeyName}. Trace files include full input and output messages, token counts, costs and timing. The announcement says images and other media are left out. Authentication uses S3 credentials generated from a Hugging Face token with write access. With Broadcast’s Privacy Mode on, prompt and completion content and provider error text are excluded, while usage, cost, timing and metadata are still sent.
As GenAI Brief reads the setup guide, this applies to traffic sent through OpenRouter’s own API and configured in OpenRouter’s settings; neither company says that Inference Providers traffic sent through Hugging Face can be traced this way. OpenRouter frames it as raw material for an evaluation set or a fine-tuning run on an open-weight model. The other side of that is that full prompts and responses land in a bucket that needs the same access controls as any production log.
Reading the usage claims
Both posts open with OpenRouter’s usage data to argue that open-weight models are now the bulk of what developers run. Hugging Face writes that open-weight models “went from 26.8% of the tokens served in October 2025 to 71.7% at the end of September 2026, after peaking at 77.5% in July.”
OpenRouter’s source post defines the metric more narrowly: the share of weekly tokens across OpenRouter’s top 50 models, classified by whether each catalogue entry links to published weights. A different OpenRouter metric tells a different story for the same week. Its October data recap says the open-weight share of paid tokens “fell to 52% in the week of September 28”, when Claude Opus 5.5, Claude Sonnet 5.5 and GPT-6.1 Sol launched, and was back above 70 per cent two weeks later. The same recap says open weights take “about a quarter of paid spend”.
| Metric (OpenRouter data) | Week of 28 September 2026 | Source |
|---|---|---|
| Open-weight share of top-50 models’ tokens | 71.7% | OpenRouter insights post |
| Open-weight share of paid tokens | 52% | OpenRouter October 2026 recap |
| Open-weight share of paid spend | About a quarter (flat over roughly the last quarter, not a figure for this week alone) | OpenRouter October 2026 recap |
All three are OpenRouter’s own figures. GenAI Brief has not checked the underlying data.
The two token figures are not contradictory; they count different things. The insights post counts tokens to the top 50 models only, and its methodology leaves out stealth models (38.7 trillion tokens in the most recent week, against 116.5 trillion for the top 50) and everything outside the top 50. The recap counts paid traffic only and excludes free model variants. They do show that “open weights are 72 per cent of usage” depends on what is in the denominator.
The price comparison is similarly specific. Hugging Face says open-weight models cost “about four times less on average: $0.28 per million input tokens and $1.62 per million output tokens, against $1.27 and $6.36 for closed models.” OpenRouter’s source table labels those as token-weighted list prices over four weeks on OpenRouter. The gap is real but the categories overlap: the same OpenRouter post notes that Kimi K3’s input prices across its 20 providers ranged from $0.24 to $4.50 per million tokens on 21 October 2026, and that GPT-6 Luna listed below any Kimi K3 provider.
On quality, Hugging Face says Kimi K3.1 Pro, which it calls the best open-weight model, scores 46 on the Artificial Analysis Intelligence Index against 65 for Claude Fable 5.2, at about a seventh of the cost per task ($3.68 against $26.54). Those are Hugging Face’s readings of a third-party index, and OpenRouter’s insights post reads the same index differently: using its own benchmarks endpoint at each model’s highest reasoning setting, it names MiMo-V2.6-Pro (46.3) as the top open-weight model and Claude Opus 5.5 (57.6) as the top closed one. Our earlier analysis of why open weights trail the frontier covers why such gaps have persisted.
What it means for someone running open-weight models
The switch is most consequential for three kinds of user.
Developers using Hugging Face as a single API for open models. Little changes in code, and failover is a real improvement over the old behaviour of returning the first provider’s error. The cost of that improvement is that the bill now reflects a router that will sometimes pick a faster, pricier provider. Use :cheapest where latency does not matter, and check the new spend-by-provider view after a week.
Teams that pinned providers for a reason. A pin still holds and is “never replaced”, so it keeps both its guarantees and its outages. If the pin exists to control quantisation or data policy, keep it and build your own retry to a second pinned provider. If it exists only for speed, the default router may now do the job with failover included.
Organisations that brought their own provider contracts. This is the group the change hurts. Language-model calls can no longer use those keys through Hugging Face. Decide whether the negotiated rate is worth calling the provider directly, or whether Hugging Face list price plus failover is acceptable.
For coding agents, Hugging Face’s Claude Code guide shows the pattern that now runs through OpenRouter underneath: set ANTHROPIC_BASE_URL to https://router.huggingface.co, pass the Hugging Face token as the API key, and map Claude Code’s model slots to Hub model ids such as zai-org/GLM-5.3. The guide says omitting a provider suffix “uses the default routing”, which “automatically fails over if a provider becomes unavailable”. Teams evaluating self-hosting against this kind of hosted routing can weigh the trade-offs in our Mistral Large 4 licensing and self-hosting guide.
What to check before the next invoice
- Search your code and configuration for custom provider keys used with chat models through Hugging Face. Those calls are now billed to Hugging Face, and the keys no longer apply.
- Decide a policy per workload. Default for interactive agents,
:cheapestfor batch work, a pinned provider where quantisation or data policy must not change. - Add
X-HF-Session-Idto multi-turn requests if you call the router with a generic OpenAI or Anthropic SDK rather than Hugging Face’s clients. - Review provider toggles at organisation level. Confirm that the providers you have approved are the only ones enabled, and check each model’s new Providers tab.
- Ask for the data-processing position in writing. As read on 18 November 2026, the security page does not mention OpenRouter.
- Compare a week of spend by provider with the week before 16 November. OpenRouter measured a 6.0 per cent higher cost per request on its own traffic; your number is the one that matters.
The partnership gives Hugging Face users a router that has been tuned on far more traffic than Hugging Face handled itself, and the failover alone will remove a class of errors. It also puts a second company in the path of every chat request and ends one way of paying for it. Hugging Face describes this as “the first step”. The next ones, account linking and more tasks routed through OpenRouter, will decide how much of the Hub’s inference ends up running on OpenRouter’s rules.
Sources
- Hugging Face and OpenRouter join forces to make open-weight models easy to run Hugging Face
- OpenRouter Now Powers Inference on Hugging Face OpenRouter
- How we rebuilt provider routing for better, faster inference OpenRouter
- Inference Providers documentation Hugging Face
- Routing and Providers Hugging Face
- Providers Hugging Face
- Pricing and Billing Hugging Face
- Prompt caching Hugging Face
- Hub Integration and Settings Hugging Face
- Security and Compliance Hugging Face
- Responses API (beta) Hugging Face
- Claude Code integration Hugging Face
- Broadcast to Hugging Face Storage Buckets OpenRouter
- BYOK: bring your own provider API keys OpenRouter
- Open-weight vs closed-weight models OpenRouter
- October 2026 data recap OpenRouter
- OpenRouter is Joining Stripe OpenRouter
- Welcome to Inference Providers on the Hub Hugging Face
Frequently asked questions
Do I need to change my code after Hugging Face switched to OpenRouter?
Usually not. Requests still go to router.huggingface.co with a Hugging Face token, and model ids and suffixes such as :fastest, :cheapest and :provider work as before. The exception is anyone who used their own provider API key for a language model: Hugging Face says that no longer works, and those requests are now billed to the Hugging Face account or organisation.
Does Hugging Face or OpenRouter add a markup on Inference Providers?
Hugging Face says no. Its pricing documentation says it charges the same rates as the provider with no additional fees, and the 16 November post says pricing does not change. PRO accounts get $2 of compute credits a month and Team and Enterprise organisations get $2 per seat.
How do I stop the router from sending my requests to a particular provider?
Turn the provider off in your Inference Providers settings, or in the organisation's settings for requests billed to an organisation. Hugging Face says the router never sends requests to a disabled provider, and that pinning a disabled provider with a suffix returns an error.
Does Hugging Face Inference Providers fail over between providers now?
For unpinned requests, yes. Hugging Face's routing documentation says OpenRouter retries a failed request on another provider serving the model, and that a request pinned to one provider, such as model:novita, is never moved to another one. Before 16 November, Inference Providers returned the chosen provider's error.
Can I still use my own Together or Fireworks key with Hugging Face?
Not for language models. The 16 November post calls this a breaking change. Custom keys still work for image and video providers. OpenRouter's own API supports bring-your-own-key, at a fee of 5% of the normal OpenRouter price, but that is a separate account and a separate integration.
Which Hugging Face features still bypass OpenRouter?
Image, video and audio generation. Hugging Face says those tasks continue directly through Inference Providers, with the same token and API, and custom keys for image and video providers keep working.
How do I keep a multi-turn conversation on one provider for prompt caching?
Send a stable UUID per conversation in the X-HF-Session-Id header. Hugging Face's prompt caching guide says the router then keeps the conversation on the same provider. Its Python and JavaScript clients handle this automatically.


