API integration
Hugging Face Switches Inference Routing to OpenRouter for Open-Weight Models
Hugging Face has moved its Inference Providers router to OpenRouter, which picks providers by live price, speed and reliability and retries failures automatically.
Hugging Face announced on November 16, 2026 that it has partnered with OpenRouter and switched the routing layer behind its Inference Providers from its own custom router to OpenRouter's. According to the blog post, requests to language models now pass through OpenRouter, which selects a provider for each call based on live measurements of price, speed and reliability, and retries the request on another provider if the first one fails. Hugging Face says existing code does not need to change.
On the technical side, the router supports OpenAI's Chat Completions and Responses APIs as well as Anthropic's Messages API for every chat model, regardless of which provider sits behind it. Developers can still express a policy or pin a provider with a suffix on the model ID, such as :fastest for highest throughput, :cheapest for the lowest price, or a specific provider name. Routing is also cache-aware: a conversation is kept on the provider holding its prompt cache, and Hugging Face recommends sending a stable UUID per conversation in a session header to make that explicit.
On usage, the post cites OpenRouter data from October 2026 showing open-weight models grew from 26.8% of tokens served in October 2025 to 71.7% at the end of September 2026, after peaking at 77.5% in July. Over the same period, weekly open-weight volume grew more than 60-fold, versus almost tenfold for closed models. Hugging Face also says open-weight models cost about four times less on average. It is careful to note that the best open-weight models still trail the best proprietary ones on the hardest benchmarks: on the Artificial Analysis Intelligence Index, Kimi K3.1 Pro scores 46 against 65 for Claude Fable 5.2, though at roughly a seventh of the cost per task.
OpenRouter says its rebuilt routing, which weighs price, speed and reliability rather than only list price, cut capacity errors by 46%, improved time to first token by 16.9% and raised throughput by 16.3% in its own measurements. Pricing is unchanged: users pay the provider's price on their Hugging Face bill with no markup, and PRO, Team and Enterprise plans receive monthly credits. Image, video and audio generation continue to run directly through Hugging Face Inference Providers and do not go through OpenRouter.
One breaking change is called out explicitly: requests to language models are now billed to the Hugging Face account or organization, so users can no longer bring their own API key for a provider with these models. Custom keys continue to work for image and video providers. Hugging Face describes this as the first step of the partnership, with account linking and more tasks routed through OpenRouter planned next. For teams relying on Hugging Face as a single entry point, multi-provider redundancy and automatic failover become defaults, but bring-your-own-key compliance and cost workflows need review. The performance and cost figures come from OpenRouter's own measurements and should be treated as vendor-reported.