Hugging Face language model inference switches to OpenRouter-based automatic routing

Key details Language model requests through Hugging Face Inference Providers have switched from its own router to OpenRouter. It selects providers based on price, speed, and reliability, and retries with another provider on failure, while existing code can remain unchanged. However, support for using personal provider-specific API keys for language models is being discontinued. Use cases Users can specify a routing policy by appending :fastest, :cheapest, or a provider name to the model ID. Sending a fixed UUID for each conversation in the X-HF-Session-Id header can explicitly direct routing toward the provider holding the prompt cache. Costs and limitations Charges are billed to the Hugging Face account at provider prices, with no additional markup, according to the announcement. PRO provides $2 in monthly credits, while Team and Enterprise provide $2 per seat per month. Image, video, and audio generation are outside the scope of this routing change.

Visit original source