huggingface_hub 2.5.0: chat completions now go through the Hub router
huggingface_hub 2.5.0 sends chat_completion through the Hub router at /v1/chat/completions. OAuth Space users must log in again.
Your keys
0 of 1 ready
Create each key on its own page, paste it below, then copy the finished lines into your project's .env file. Your keys stay in this tab. They are never sent to Wirestack or saved; we only count that the panel was used.
- Hugging Face access tokenHF_TOKENGet key
Make a fine-grained token with the "Make calls to Inference Providers" permission.
What changed
huggingface_hub 2.5.0, released November 26, 2026:
chat_completionrequests made with a Hugging Face token now go through the Hub router at/v1/chat/completions. Calls made with a provider's own API key are not affected and still go straight to the provider.- Spaces OAuth: the client secret is now optional, and the signing key changes. Users logged in to an OAuth Space will need to log in again once the Space upgrades
huggingface_hub. - A 402 response with the
EgressLimitReachedcode now raisesEgressLimitError. - Sandboxes take a network policy:
network="none"blocks all outbound connections, or you can limit access to an allowlist. The policy cannot be removed from inside the sandbox.
What to do
If you call chat_completion with HF_TOKEN, expect requests to reach the router endpoint after upgrading; check any proxy or firewall rules that only allow provider hosts. If you run an OAuth Space, warn your users they will be signed out once. Catch EgressLimitError if you handle 402s yourself.
Source
Affected by this? Start from a checked Hugging Face Inference Providers integration
Code with pinned versions, checked against the official docs on a schedule.
