Wain AI/Tech Blog

AI news and trends worldwide, updated nearly every day

Hugging Face's Inference API Switches Language-Model Routing to OpenRouter - Your Own Provider Keys No Longer Work

Hugging Face's Inference API Switches Language-Model Routing to OpenRouter - Your Own Provider Keys No Longer Work

On November 16, 2026, Hugging Face switched the router for language models in Inference Providers from its own to OpenRouter's. Failed requests are retried on another provider and there is no markup, but your own provider API keys can no longer be used with language models.

On November 16, 2026, Hugging Face announced that Inference Providers, its service for calling models from multiple inference providers through a single API, has replaced its in-house router for language models with OpenRouter’s 1. For every call it now weighs cost, latency, and stability to pick a provider, and falls back to another one when a call errors out. There is no added markup. The trade-off is that, for language models, API keys you bring from a provider no longer work.

From one fixed provider to routing with retries

Until now, Inference Providers chose a single provider for each request and, if that provider failed, handed its error straight back 1. After the switch, language-model requests pass through OpenRouter, are assigned using up-to-date cost, latency, and stability data, and a failed attempt is handed to another provider. Hugging Face says no code changes are needed.

You can steer the routing with a suffix at the end of the model ID. Using GLM-5.3 as the example, the post shows that leaving the suffix off weighs cost, latency, and stability together, :fastest favors throughput, :cheapest picks the lowest price, and a provider name such as :novita restricts the request to that provider.

Routing also takes prompt caching into account, so a conversation sticks with whichever provider already has its cache. You can make that explicit by sending the same UUID for every turn of a conversation in the X-HF-Session-Id header. Supported request formats are OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages, and Hugging Face has published setup guides for coding agents including Claude Code and Codex.

No more bring-your-own keys for language models

The change users have to act on is the one the post itself labels a breaking change. Since language-model traffic is now relayed via OpenRouter and charged to the user’s or organization’s Hugging Face billing, API keys set up directly with a provider can no longer be used for these models 1.

To choose a provider, add a model:provider suffix to the model ID, or disable the providers you do not want in your settings. Your own keys still work for image and video providers. Generating images, video, or audio bypasses OpenRouter entirely and is handled by Inference Providers directly, as before.

The post does not say what happens to terms you may have negotiated with a provider through your own key. If that applies to you, it is worth checking with the provider how those terms are handled once billing moves to Hugging Face.

Pricing unchanged, control through settings and headers

Prices do not change. Usage is charged at each provider’s own rate and appears on the Hugging Face invoice with no Hugging Face surcharge 1. Monthly included credits are $2 for a PRO account and $2 per seat for Team and Enterprise organizations 2.

You can now see where requests go. Model pages gain a Providers tab, which lists every provider eligible for that model along with what it charges for input and output, how fast it runs, and its availability during the last day, and a Metrics tab showing the best values among them, such as price and throughput. Spending in the usage overview is broken down per provider.

For organizations, disabling providers is the main lever. Organizations have the same setting as individuals, covering all traffic charged to that organization. According to the pricing documentation, explicitly requesting a provider the organization has disabled returns an error, and billing to an organization is done by passing its name in the X-HF-Bill-To header 2. Organizations that cannot use certain providers, for example because of data-handling requirements, would be well advised to turn those off in the organization settings first so they are left out of routing after the switch.

Open-weight models carrying more of the load

The Hugging Face post also cites figures from OpenRouter. OpenRouter handles more than 600 models from over 80 providers with monthly volume above 800 trillion tokens across a user base of over 10 million, it says 1. By OpenRouter’s count, the open-weight share of its token volume rose from 26.8% in October 2025 to 71.7% as of late September 2026. On average, the post says, open-weight models cost $0.28 for input and $1.62 for output per million tokens, roughly a quarter of closed models’ $1.27 and $6.36.

The post addresses the performance gap too. It says the highest-ranked open-weight model on the Artificial Analysis Intelligence Index, Kimi K3.1 Pro, reaches 46, compared with 65 for Claude Fable 5.2, while costing about one-seventh as much per task ($3.68 versus $26.54).

Hugging Face calls this the first step of the partnership. Next, it plans to let users connect an OpenRouter account to Hugging Face and to route more tasks through OpenRouter. For code that calls language models through Inference Providers, the first thing to check is whether it passes its own provider key; if it does, that needs to be replaced with provider selection by suffix and disabling providers in settings.

Sources

  1. Hugging Face and OpenRouter join forces to make open-weight models easy to run - Hugging Face official blog (November 16, 2026)
  2. Pricing and Billing - Hugging Face Inference Providers documentation (checked November 17, 2026)

We publish the latest AI news nearly every day.

Subscribe via RSS Get new posts the moment they go live.

Search other keywords →