Hugging Face routes language model inference through OpenRouter
Hugging Face and OpenRouter announced that language-model requests through Hugging Face Inference Providers now use OpenRouter’s provider-routing system. The existing Hugging Face token and APIs remain in place, while OpenRouter selects providers using live price, speed, and reliability data and retries failed requests with another provider. Custom provider API keys no longer work for language-model requests, which are instead billed to the Hugging Face account.
The change gives developers automatic provider selection and failover across Hugging Face’s model platform without requiring changes to existing code, while altering billing and provider-key behavior.
Hugging Face and OpenRouter are teaming up to make open-weight models easy to run. Every major open-weight release is already being published on the Hugging Face Hub, and OpenRouter serves those models at scale, routing each request across 80+ providers based on live measurements of each one. Together, every open-weight model on the Hub that a provider serves can be called with your Hugging Face token, through the same API, with the best provider picked for each request.
Today, we are switching Inference Providers from our own custom router to OpenRouter's. Requests made to language models now go through OpenRouter, which picks the best provider for each call based on live price, speed and reliability, and retries on another provider if the first one fails. Your code stays the same.
Run them with the tools you already use
The router supports OpenAI's Chat Completions and Responses APIs and Anthropic's Messages API for every chat model, whatever the provider behind it. Pick your coding agent or SDK and a model, then copy the steps, or copy the whole setup as a prompt for your agent:
#Hugging Face#OpenRouter#Hugging Face Inference Providers#Hugging Face Hub