Workflows & Automation

Hugging Face and OpenRouter have partnered to simplify running open-weight models.

Hugging Face moved Inference Providers to OpenRouter, routing open-weight models across 80+ providers by price, speed, and reliability with same code.

Hugging Face and OpenRouter have partnered to simplify running open-weight models.

Key Takeaways

  • Hugging Face now routes open-weight language model requests through OpenRouter, letting developers keep the same code, API, and Hugging Face token while automatically selecting among 80+ providers based on live price, speed, and reliability.
  • Developer workflows remain mostly unchanged: users can still choose models and providers, but custom provider API keys no longer work for language model requests because billing now flows through Hugging Face accounts or organizations.
  • Open-weight models are gaining usage because they are much cheaper than closed models, even if they may score lower on the hardest reasoning tasks, making them attractive for many workloads.
  • OpenRouter’s routing improves reliability with provider retries, live performance measurements, cache-aware session routing, and reported gains such as fewer capacity errors, faster first-token latency, and higher throughput.
  • Hugging Face model pages now expose routing transparency with provider lists, performance metrics, usage breakdowns, and settings to block unwanted providers, while image, video, and audio generation still run directly through Hugging Face.

![Abstract friendly illustration of routing paths connecting model cards to provider nodes, with no people, logos, or text](/images/hugging-face-openrouter-routing.png)

Hugging Face and OpenRouter have partnered to simplify running open-weight models.

Meta description: Hugging Face and OpenRouter now route open-weight model requests across 80+ providers using live price, speed, and reliability while keeping code the same.

Tags: Hugging Face, OpenRouter, open-weight models, model routing, AI inference

Hugging Face and OpenRouter have changed how open-weight model requests are handled, and today Hugging Face moved Inference Providers from its own custom router to OpenRouter's routing system. This is for developers and teams who call language models through Hugging Face: the code can stay the same, the Hugging Face token can stay the same, and each request can be sent to the best available provider from more than 80 providers based on live price, speed, and reliability. Every major open-weight release is already published on the Hugging Face Hub, and OpenRouter serves those models at scale, so a Hub model that a provider supports can be called through the same API while OpenRouter selects the provider.

What changes for developers today

Language model requests made through Hugging Face Inference Providers now go through OpenRouter. OpenRouter evaluates providers for each call and retries on another provider if the first one fails. The router supports OpenAI's Chat Completions API, OpenAI's Responses API, and Anthropic's Messages API for every chat model, regardless of which provider is behind the call.

Existing workflows can remain intact. A user can pick a coding agent or software development kit, choose a model, copy the setup steps, or copy the whole setup as a prompt for an agent. Hugging Face also provides setup guides for Claude Code, Codex, OpenCode, Pi, and Hermes Agent. The same Hugging Face token continues to unlock other Hub services: Storage Buckets for storage, Jobs for compute, and Inference Endpoints for dedicated inference. PRO, Team, and Enterprise plans include monthly credits for compute and inference.

Hugging Face and OpenRouter have partnered to simplify running open-weight models.

One practical change affects custom provider keys. Because language model requests are now billed through the Hugging Face account or organization, developers can no longer use their own provider API key for those models. They can still select a provider or routing policy with a suffix on the model id, such as `model:provider`, or turn providers off in settings. Custom keys for image and video providers continue to work.

Why open-weight models are gaining ground

The partnership arrives as open-weight models have become a larger share of served traffic. On OpenRouter, open-weight models grew from 26.8% of tokens served in October 2025 to 71.7% by the end of September 2026, after peaking at 77.5% in July, according to OpenRouter data from October 2026. Weekly open-weight volume grew more than 60-fold over that period, while closed model volume grew almost tenfold. This week, the most used model on OpenRouter rankings is the open-weight DeepSeek V4.1 Flash 1017, with 59.2 trillion tokens served.

Cost is a major reason for that growth. Open-weight models average about four times less than closed models: $0.28 per million input tokens and $1.62 per million output tokens, compared with $1.27 and $6.36 for closed models. The trade-off is not that open-weight models are always best on the hardest tasks. On the Artificial Analysis Intelligence Index, the best open-weight model, Kimi K3.1 Pro, scores 46, while Claude Fable 5.2 scores 65. Kimi K3.1 Pro costs about a seventh as much per task, $3.68 against $26.54. That trade-off is worth it for many workloads.

How OpenRouter's routing improves reliability

At scale, OpenRouter handles more than 800 trillion tokens per month for over 10 million users, with 600+ models from 80+ providers. Its routing uses live measurements from every provider across that traffic. A rebuilt provider-selection system no longer chooses only the lowest list price; it weighs price, speed, and reliability together.

The new behavior also handles failures inside a single call. If a provider slows down or starts failing, traffic moves away from it until it recovers. If a request fails, OpenRouter retries it with the next best provider. OpenRouter's own measurements attribute a 46% reduction in capacity errors, a 16.9% improvement in time to first token, and a 16.3% throughput increase to the rebuilt routing. The previous Hugging Face routing path selected a single provider and surfaced that provider's error on failure.

Hugging Face and OpenRouter have partnered to simplify running open-weight models.

The router is also cache-aware. A conversation stays on the provider that holds its prompt cache, which matters when repeated context is used in chats or agents. To make that routing explicit, users can send a stable universally unique identifier (UUID) per conversation in the X-HF-Session-Id header. The prompt caching guide describes this option.

What stays direct and what you can inspect

Image, video, and audio generation remain outside the OpenRouter switch and continue to run directly through Hugging Face Inference Providers. Users can keep using the same token and API, and access tens of thousands of LoRAs, or low-rank adapters.

Model pages keep a chat widget, and they now add two tabs that expose the routing details behind it. Providers lists every provider OpenRouter can route the model to, with input and output price, speed, and uptime over the last 24 hours. Metrics shows the best price, throughput, time to first token, context length, and uptime among them. The usage overview breaks spend down by the provider that handled each request. Settings let users block any provider they do not want to use; blocked providers are excluded from routing. Organization-level settings work the same way and apply to all requests charged to the organization.

The billing model stays the same: the provider's price appears on the Hugging Face bill, with no Hugging Face markup added on top. PRO users receive $2 of credits every month, and Team and Enterprise organizations receive $2 per seat. See Pricing and Billing for the details.

What comes next

Hugging Face describes the OpenRouter routing switch as the first step of the partnership. The next items listed are connecting an OpenRouter account to Hugging Face and routing more tasks through OpenRouter. For now, users can try a model on the Hub or read the Inference Providers docs to get started.

Comments (0)

  1. No comments yet. Be the first to share what worked for you.

Leave a comment

Comments are reviewed before they appear. Your email address is not published.