401 Unauthorized on Inference Providers router chat completions (token works for /v1/models)
Hugging Face Forums [Unofficial]
March 17, 2026
Hi HF team, I’m trying to use the Inference Providers router for chat completions:
POST https://router.huggingface.co/v1/chat/completions
I consistently get: {“error”:“Invalid username or password.”} (401)
What I’ve already verified:
GET https://router.huggingface.co/v1/models succeeds (status 200) with the same token.
Token is fine‑grained with “Make calls to Inference Providers.”
Inference Providers are enabled in settings.
I set HF Inference as preferred provider.
I generated a new token after enabling settings.
Model tried:
- Qwen/Qwen3.5-9B:preferred (also tried other model/provider combos)
The issue persists both in a small Python test and in a Streamlit app.
Could you check if my account has a restriction for chat completions or if there’s another required permission?
Thanks!
Discussion in the ATmosphere