{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreibzmmh7prdumqdf2zoivcdpkjxkb3a5kfid7yobivivwuptflwwru",
    "uri": "at://did:plc:pgryn3ephfd2xgft23qokfzt/app.bsky.feed.post/3mhaa4xvyczz2"
  },
  "path": "/t/401-unauthorized-on-inference-providers-router-chat-completions-token-works-for-v1-models/174329#post_1",
  "publishedAt": "2026-03-17T00:52:26.000Z",
  "site": "https://discuss.huggingface.co",
  "tags": [
    "https://router.huggingface.co/v1/chat/completions",
    "https://router.huggingface.co/v1/models"
  ],
  "textContent": "Hi HF team,\nI’m trying to use the Inference Providers router for chat completions:\n\nPOST https://router.huggingface.co/v1/chat/completions\n\nI consistently get:\n{“error”:“Invalid username or password.”} (401)\n\nWhat I’ve already verified:\n\n  * GET https://router.huggingface.co/v1/models succeeds (status 200) with the same token.\n\n  * Token is **fine‑grained** with **“Make calls to Inference Providers.”**\n\n  * Inference Providers are enabled in settings.\n\n  * I set **HF Inference** as preferred provider.\n\n  * I generated a **new token after** enabling settings.\n\n\n\n\nModel tried:\n\n  * Qwen/Qwen3.5-9B:preferred (also tried other model/provider combos)\n\n\n\nThe issue persists both in a small Python test and in a Streamlit app.\n\nCould you check if my account has a restriction for chat completions or if there’s another required permission?\n\nThanks!",
  "title": "401 Unauthorized on Inference Providers router chat completions (token works for /v1/models)"
}