I have been granted access to the gated model “s2w-labs/darkbert-base-cased”. I can confirm my account has the correct permissions, as I can download files manually from the model’s page on the Hub.
However, all my attempts to access the model via the API fail with an authentication error.
I have performed extensive troubleshooting, and I am certain the issue is not on my end. The final proof is a direct API call with curl using a newly generated “read” token, which still fails.
Server Response: {"error":"Invalid credentials in Authorization header"}
This test proves that my network connectivity is fine, but the token is considered invalid by the API, even though my account has all the necessary rights on the website. This suggests a permission synchronization issue between the web UI and the API backend for my account.
Could you please investigate the API permissions for my account regarding this model?
Hello,
Thank you for your help. Your suggestion to use the whoami-v2 endpoint was the key to diagnosing the problem.
I can confirm that the whoami-v2 test works perfectly. This proves my token is valid.
Test 1 (Success): curl https://huggingface.co/api/whoami-v2 -H “Authorization: Bearer [MY_TOKEN]” → Returns my user information correctly.
However, when I use the exact same token to download a file from the s2w-labs/darkbert-base-cased repository, I get a 404 Repository Not Found error.
Test 2 (Failure): A Python script using huggingface_hub.hf_hub_download for repo_id=“s2w-labs/darkbert-base-cased” → Fails with 404 Repository Not Found.
Conclusion:
This proves that my API token is valid, but it does not have the necessary permissions to see the gated darkbert-base-cased repository, even though my account was granted access and can download files manually from the web UI.
Could you please ask the team to manually sync the API permissions for my account (Researcher-maker) to grant my tokens access to this specific repository?
Thank you again for your support.
Could you please ask the team to manually sync the API permissions for my account (Researcher-maker) to grant my tokens access to this specific repository?
I can’t find that repository…
Is it private instead of gated…?
Anyway, since I don’t have any special permissions, if you’re certain it’s an account issue, contact HF Support. website@huggingface.co