Unauthorized for url error with huggingface

Keep getting this error message

File “\langchain-models\venv\Lib\site-packages\huggingface_hub\utils_http.py”, line 477, in hf_raise_for_status
raise _format(HfHubHTTPError, str(e), response) from e
huggingface_hub.errors.HfHubHTTPError: 401 Client Error: Unauthorized for url: https://api-inference.huggingface.co/models/deepseek-ai/DeepSeek-R1-0528/v1/chat/completions (Request ID: Root=1-6870d8eb-5a9733c17f893c654b51371f;0a7a931e-b853-48bd-9540-91a1fb0f9316)

Invalid username or password.

1 Like

The token might be missing or may not have access. Recheck that.

1 Like

I had created this read-only token, which I am using it by setting HUGGINGFACEHUB_ACCESS_TOKEN

1 Like

api-inference.huggingface.co

This format’s endpoint has probably been discontinued, so you will need to find a new endpoint URL. It should be relatively easy to find by searching from the Deploy button on the model page.