Token returns 401 Unauthorized – Request for help

I’m currently unable to authenticate using my personal access token:

nginx

CopyEdit

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

No matter what I try — whether logging in via Python (from huggingface_hub import login) or making a direct GET request to https://huggingface.co/api/whoami-v2 with the token in the Authorization header — I consistently get the same response:

arduino

CopyEdit

401 Unauthorized {"error":"Invalid credentials in Authorization header"}

I generated this token today and ensured all the necessary scopes were enabled. I’ve spent hours testing everything: using different machines, operating systems, environments (Python CLI, PowerShell, raw requests), upgrading the huggingface_hub library, confirming the correct token format, trying with both a brand new account and an older one — yet the result is always the same.

Given all these checks, my conclusion is that the token itself is not being accepted server-side, despite being freshly generated and properly configured. I believe the issue may be on your end — possibly a bug or a server-side token validation issue.

Could you please help me identify what’s wrong or advise me on what needs to be done to make this token work?

Thank you very much for your time and support,

1 Like