# Token returns 401 Unauthorized – Request for help

**URL:** <https://discuss.huggingface.co/t/token-returns-401-unauthorized-request-for-help/166036>\
**Category:** Awesome paper\
**Created:** [August 7, 2025, 10:58pm UTC](https://discuss.huggingface.co/t/token-returns-401-unauthorized-request-for-help/166036 "2025-08-07T22:58:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dydycore](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@dydycore](https://discuss.huggingface.co/u/dydycore)\
**Post date:** [August 7, 2025, 10:58pm UTC](https://discuss.huggingface.co/t/token-returns-401-unauthorized-request-for-help/166036/1 "2025-08-07T22:58:04Z")

</div>

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

```auto
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:

```auto
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,
