# Hugging Face routes language model requests through OpenRouter

published: 2026-11-18T16:05:26.779Z
topic: infrastructure
source: https://the-decoder.com/hugging-face-now-routes-model-requests-through-openrouter-for-the-best-price-or-speed/
url: https://aiagentnews.io/stories/hugging-face-routes-language-model-requests-through-openrouter

Hugging Face's Inference Providers service now sends language model requests through OpenRouter, which picks a provider for each call based on price, speed and reliability. Developers no longer need their own API keys for language model providers, because Hugging Face bills those calls directly at provider prices with no markup.

Hugging Face says its Inference Providers service now routes language model calls through OpenRouter. By default, the router weighs price, speed and reliability for each request and falls back to another provider during outages. Existing code keeps working without changes.

Developers can add a ':fastest' suffix to pick the provider with the highest throughput, or ':cheapest' for the lowest cost, or name a provider directly. The 'X-HF-Session-Id' header lets routing take provider caches into account. OpenRouter reports, from its own measurements, a 46 percent drop in capacity errors, a 16.9 percent improvement in time to first token and a 16.3 percent rise in throughput.

Bring-your-own API keys for language model providers no longer work, although they remain available for image and video providers. Hugging Face says open-weight models made up 71.7 percent of weekly tokens among the 50 most-used OpenRouter models at the end of September 2026. Both companies are changing hands: Nvidia is buying Hugging Face for $12.9 billion, and Stripe has agreed to acquire OpenRouter for more than $7 billion.

## Why it matters if you build agents

Agent code that calls Hugging Face for language models can drop separate provider keys, but billing for those calls now runs through Hugging Face. Use ':cheapest' for background jobs and ':fastest' for latency-sensitive steps, or name a provider when you need consistent behavior. Since the serving provider can change between requests, check the new provider tabs on model pages and watch for changes in output or latency.
