Use a clear, descriptive title like: Persistent "404 Not Found" Error on Public Inference API with Valid Fine-Grained Token
Hello Hugging Face Team and Community,
I am having a persistent issue accessing the public Serverless Inference API, as I consistently receive a 404 Not Found
error for all models I try. I suspect this is an account-level restriction, as I have exhausted all local troubleshooting steps.
My Hugging Face Username is: Mathew001
Summary of the Problem: All POST requests to https://api-inference.huggingface.co/models/<MODEL_ID>
return the 404 Not Found
error.
Key Troubleshooting Steps Confirmed (Code is NOT the issue):
-
Correct API/Model: The error occurs on reliably public models, including
gpt2
andgoogle/flan-t5-small
. -
Correct Tool & Syntax: I am using PowerShell’s native
Invoke-RestMethod
(irm
), which is correctly configured for the POST request, headers, and JSON body. -
Token Type Confirmed: I am using a Fine-Grained User Access Token.
-
Permissions Confirmed: The token has the explicit permission
Inference > Make calls to Inference Providers
checked. -
Authorization Format: The header is correctly formatted as
'Authorization': 'Bearer hf_...'
.
Example Request: (Note: The request below is what fails, but I have verified the syntax is correct in PowerShell.)
$url = 'https://api-inference.huggingface.co/models/gpt2'
$token = 'hf_...' # Secure token used
# ... other variables defined correctly ...
irm -Uri $url -Method Post -Headers $headers -Body $body
# Output: irm : Not Found
Given that I have verified the code, endpoint, and token permissions multiple times, I believe there may be an underlying issue with my account’s ability to access the service.
Could someone please check the status or permissions associated with my user ID, Mathew001
, regarding access to the public Inference Providers?
Thank you for your help!
Best regards, Mathew Oloyede