Last updated: November 18, 2026
Hugging Face Inference Providers now routes language model requests through OpenRouter. Since November 16, 2026, each chat request goes to the provider with the best mix of live price, speed and reliability, and fails over to another provider if the first one errors. Your Hugging Face token and code stay the same, with no markup on provider prices.
Contents
- What changed on November 16
- Before and after: what is different
- How to call a model through the new router
- Routing suffixes and failover
- Pricing, credits and billing
- Sending OpenRouter traces to Hugging Face
- Limits and caveats
- Frequently asked questions
What changed on November 16
In a Hugging Face blog post dated November 16, 2026, the company said it is “switching Inference Providers from our own custom router to OpenRouter’s.” Requests to language models now go through OpenRouter, which chooses a provider per call and retries on another provider when one fails.
OpenRouter’s announcement says 160 models from 38 labs are available this way, which it describes as every model OpenRouter serves that has a page on the Hub. Examples include DeepSeek V4.1 Flash, Kimi K3.1 Pro, GLM 5.3, Qwen3.8 27B, MiniMax M3.1 Flash and OpenAI gpt-oss-120b.
The Hugging Face changelog entry adds two new tabs to the chat widget on model pages. Providers lists each provider that can serve the model with its price, speed and uptime. Metrics shows the best of each.
For OpenRouter’s own platform features, see our OpenRouter Auto Code guide.
Before and after: what is different
The table summarizes the changes for language models. Image, video and audio generation are not affected.
| Area | Before November 16 | Now (OpenRouter routing) |
|---|---|---|
| Provider choice | Hugging Face’s own router picked one provider | OpenRouter picks per request on live price, speed and reliability |
| Failed requests | The provider’s error was returned | Retried on the next best provider inside the same call |
| Routing controls | Provider selection on the model ID | Default routing, :fastest, :cheapest or :provider suffixes |
| Custom provider keys | Supported | No longer work for language models; still work for image and video providers |
| Pricing | Provider price, no Hugging Face markup | Unchanged: provider price, no markup |
How to call a model through the new router
The router accepts OpenAI’s Chat Completions and Responses APIs and Anthropic’s Messages API for every chat model, according to the blog post. The pricing and billing docs show the OpenAI-compatible base URL, https://router.huggingface.co/v1.
- Create a token at hf.co/settings/tokens with the “Make calls to Inference Providers” permission.
- Open a supported model page on the Hub, such as zai-org/GLM-5.3, and check the Providers and Metrics tabs.
- Click View code to copy setup steps for your SDK or coding agent. Hugging Face lists guides for Claude Code, Codex, OpenCode, Pi and Hermes Agent.
- Point an OpenAI-compatible client at
https://router.huggingface.co/v1and use your Hugging Face token as the API key. - Set the model to the Hub model ID, with a routing suffix if you want one, for example
deepseek-ai/DeepSeek-V4.1-Flash:cheapest. - Optionally, turn off unwanted providers in your Inference Providers settings.
from openai import OpenAI
import os
client = OpenAI(
base_url="https://router.huggingface.co/v1",
api_key=os.environ["HF_TOKEN"],
)
r = client.chat.completions.create(
model="zai-org/GLM-5.3:fastest",
messages=[{"role": "user", "content": "Summarize this changelog."}],
)
print(r.choices[0].message.content)
For coding agent setups, our Hermes Agent 0.23 guide covers that agent in more detail.
Routing suffixes and failover
The routing docs explain that, without a suffix, OpenRouter’s default routing compares the cost of a good answer from each provider. It weighs three things:
- Effective price: what the provider actually charges, including its real cache hit rate, not just the list price.
- Speed: throughput and time to first token.
- Reliability: how often the provider fails, returns malformed tool calls, or turns requests away for lack of capacity.
Append a suffix to the model ID to change the policy. It works in every client, including tools that only accept a model name:
- No suffix: best mix of price, speed and reliability.
:fastest: highest throughput in tokens per second.:cheapest: lowest price.:novita(or another provider name): only that provider, or an error if it does not serve the model.
If a provider fails, OpenRouter retries on another provider serving the model. A pinned provider is never replaced. Routing is cache-aware, so a conversation stays on the provider holding its prompt cache. To make that explicit, send a stable UUID per conversation in the X-HF-Session-Id header.
OpenRouter says that when it rebuilt this routing in October, a live experiment measured 46% fewer capacity errors, 16.9% faster time to first token and 16.3% higher throughput, at 6.0% higher cost per request, according to its post.
Pricing, credits and billing
Hugging Face says pricing does not change. You pay the provider’s price on your Hugging Face bill with no markup. The pricing docs list the included credits:
- Free users: no monthly credits; buy credits to use Inference Providers.
- PRO users: $2.00 per month.
- Team or Enterprise organizations: $2.00 per seat per month, shared among members.
These general compute credits also cover Inference Endpoints, Spaces hardware and Jobs. To bill an organization, pass the X-HF-Bill-To: my-org-name header, or bill_to in the huggingface_hub client. Requests billed to an organization follow that organization’s provider settings.
Hugging Face cites OpenRouter data that open-weight models average $0.28 per million input tokens and $1.62 per million output tokens, against $1.27 and $6.36 for closed models. To run open weights locally instead, see our Qwen3.8-27B GGUF guide, our MiniMax M3.1 Flash guide and our Transformers 5.23 guide.
Sending OpenRouter traces to Hugging Face
OpenRouter can also send a trace of each request to a Hugging Face Storage Bucket you own, through Broadcast, which is in beta. Each JSON file holds the input messages, the model output, token counts and cost. Images and other media are left out. OpenRouter lists these steps:
- Create a Storage Bucket on Hugging Face.
- Create an access token with Write permission and generate S3 credentials from it.
- In OpenRouter, go to Settings, then Observability, turn on Broadcast and open Hugging Face Storage Buckets.
- Enter your namespace, bucket name, access key ID and secret access key. A path template such as
{apiKeyName}/{date}is optional. - Click Test Connection, then save.
Limits and caveats
- Pinned providers do not fail over. A provider suffix returns an error if that provider does not serve the model or is disabled in your settings.
- Organization settings win. Requests billed to an organization use its enabled and disabled providers, not your personal settings.
- Not yet available. Connecting an OpenRouter account to Hugging Face and routing more tasks through OpenRouter are listed as next steps.
Frequently asked questions
Does Hugging Face now use OpenRouter?
Yes. Since November 16, 2026, Hugging Face Inference Providers sends requests for language models through OpenRouter’s router. OpenRouter picks a provider for each call and retries on another provider if the first one fails.
Do I need an OpenRouter account or a new API key?
No. Hugging Face says your existing token and code keep working. Use a Hugging Face token with the “Make calls to Inference Providers” permission.
Does Hugging Face add a markup to OpenRouter prices?
No. Hugging Face says you pay the provider’s price on your Hugging Face bill with no markup. PRO users get $2 of monthly credits, Team and Enterprise organizations get $2 per seat, and free users must buy credits.
How do I force the cheapest or fastest provider?
Add a suffix to the model ID. Use :cheapest for the lowest price, :fastest for the highest throughput, or a provider name such as :novita to pin one provider. Without a suffix, the router balances price, speed and reliability.
Can I still use my own provider API key on Hugging Face?
Not for language models. Hugging Face calls this a breaking change: chat requests are billed to your Hugging Face account or organization, so custom provider keys no longer work for them. Custom keys for image and video providers keep working.
Sources
- Hugging Face blog: Hugging Face and OpenRouter join forces to make open-weight models easy to run (November 16, 2026)
- OpenRouter blog: OpenRouter Now Powers Inference on Hugging Face (November 16, 2026)
- Hugging Face docs: Routing and Providers
- Hugging Face docs: Pricing and Billing
- Hugging Face changelog: Inference Providers Powered by OpenRouter
Image: Hugging Face logo, public domain, via Wikimedia Commons.
1 thought on “Hugging Face OpenRouter Routing: Power-User Guide to Suffixes, Pricing and Failover”