# Inference API returns 404 Not Found for all models

**URL:** <https://discuss.huggingface.co/t/inference-api-returns-404-not-found-for-all-models/169854>\
**Category:** Beginners\
**Created:** [November 3, 2025, 10:57am UTC](https://discuss.huggingface.co/t/inference-api-returns-404-not-found-for-all-models/169854 "2025-11-03T10:57:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikePL92](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@MikePL92](https://discuss.huggingface.co/u/MikePL92)\
**Post date:** [November 3, 2025, 10:57am UTC](https://discuss.huggingface.co/t/inference-api-returns-404-not-found-for-all-models/169854/1 "2025-11-03T10:57:26Z")

</div>

Hi Team,

I’m having an issue with the Inference API. I consistently receive a `404 Not Found` response for every model I try, including public models like `gpt2` and even when using a brand new API token with “read” permissions.

I have already confirmed the following:

- My server has a successful network connection to `api-inference.huggingface.co`.
- My API key is being correctly passed in the “Authorization: Bearer” header.

Here is the verbose output from a `curl` test. The request ID for one of the failed attempts is `Root=1-69079074-1aee8cc64f9e26267e2d96a5`.

Note: Unnecessary use of -X or --request, POST is already inferred.

- Host [api-inference.huggingface.co:443](http://api-inference.huggingface.co:443) was resolved.

- IPv6: (none)

- IPv4: 18.244.164.92, 18.244.164.81, 18.244.164.97, 18.244.164.103

- Trying 18.244.164.92:443…

- ALPN: curl offers h2,http/1.1

- TLSv1.3 (OUT), TLS handshake, Client hello (1):

- CAfile: /etc/ssl/certs/ca-certificates.crt

- CApath: /etc/ssl/certs

- TLSv1.3 (IN), TLS handshake, Server hello (2):

- TLSv1.3 (IN), TLS change cipher, Change cipher spec (1):

- TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):

- TLSv1.3 (IN), TLS handshake, Certificate (11):

- TLSv1.3 (IN), TLS handshake, CERT verify (15):

- TLSv1.3 (IN), TLS handshake, Finished (20):

- TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):

- TLSv1.3 (OUT), TLS handshake, Finished (20):

- SSL connection using TLSv1.3 / TLS\_AES\_128\_GCM\_SHA256 / X25519MLKEM768 / RSASSA-PSS

- ALPN: server accepted h2

- Server certificate:

- subject: [CN=huggingface.co](http://CN=huggingface.co)

- start date: Apr 13 00:00:00 2025 GMT

- expire date: May 12 23:59:59 2026 GMT

- subjectAltName: host “[api-inference.huggingface.co](http://api-inference.huggingface.co)” matched cert’s “\*.huggingface.co”

- issuer: C=US; O=Amazon; CN=Amazon RSA 2048 M02

- SSL certificate verify ok.

- Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption

- Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption

- Certificate level 2: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption

- Connected to [api-inference.huggingface.co](http://api-inference.huggingface.co) (18.244.164.92) port 443

- using HTTP/2

- [HTTP/2] [1] OPENED stream for [https://api-inference.huggingface.co/models/gpt2](https://api-inference.huggingface.co/models/gpt2)

- [HTTP/2] [1] [:method: POST]

- [HTTP/2] [1] [:scheme: https]

- [HTTP/2] [1] [:authority: [api-inference.huggingface.co](http://api-inference.huggingface.co)]

- [HTTP/2] [1] [:path: /models/gpt2]

- [HTTP/2] [1] [user-agent: curl/8.14.1]

- [HTTP/2] [1] [accept: _/_]

- [HTTP/2] [1] [authorization: Bearer hf\_……..cwm]

- [HTTP/2] [1] [content-type: application/json] \* [HTTP/2] [1] [content-length: 18] \> POST /models/gpt2 HTTP/2 \> Host: [api-inference.huggingface.co](http://api-inference.huggingface.co) \> User-Agent: curl/8.14.1 \> Accept: _/_ \> Authorization: Bearer hf\_…….cwm \> Content-Type: application/json \> Content-Length: 18 \>

- upload completely sent off: 18 bytes

- TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): \< HTTP/2 404 \< content-type: text/plain; charset=utf-8 \< content-length: 9 \< date: Sun, 02 Nov 2025 17:10:12 GMT \< x-inference-provider: hf-inference \< x-powered-by: huggingface-moon \< vary: origin, access-control-request-method, access-control-request-headers \< access-control-allow-origin: \* \< access-control-expose-headers: X-Repo-Commit,X-Request-Id,X-Error-Code,X-Error-Message,X-Total-Count,ETag,Link,Accept-Ranges,Content-Range,X-Linked-Size,X-Linked-ETag,X-Xet-Hash \< x-request-id: Root=1-69079074-1aee8cc64f9e26267e2d96a5 \< cross-origin-opener-policy: same-origin \< referrer-policy: strict-origin-when-cross-origin \< access-control-allow-credentials: true \< x-cache: Error from cloudfront \< via: 1.1 [04cb9a524a2f5b52f2abb84002971492.cloudfront.net](http://04cb9a524a2f5b52f2abb84002971492.cloudfront.net) (CloudFront) \< x-amz-cf-pop: LHR50-P8 \< x-amz-cf-id: viDpVEZZYKNhF6tcTRDGP\_EcsZEWHStQuYq6nsDUHQTkqGKdkqS1ww== \<

- Connection #0 to host [api-inference.huggingface.co](http://api-inference.huggingface.co) left intact  
Could you please check if there are any blocks, limits, or other issues with my account that might be causing this strange `404` error?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [November 3, 2025, 11:58am UTC](https://discuss.huggingface.co/t/inference-api-returns-404-not-found-for-all-models/169854/2 "2025-11-03T11:58:43Z")

</div>

> [api-inference.huggingface.co](http://api-inference.huggingface.co)

That endpoint is for the legacy version of the Inference API and is now deprecated. [The Inference API has been revamped into Inference Providers, with changes to usage and models](https://discuss.huggingface.co/t/401-but-my-api-key-should-be-valid/169191/5). For details, refer to the documentation.

---

<div class="post-metadata">

**Author:** ![meganariley](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/meganariley/32/56966_2.png) [@meganariley](https://discuss.huggingface.co/u/meganariley)\
**Post date:** [November 3, 2025, 6:29pm UTC](https://discuss.huggingface.co/t/inference-api-returns-404-not-found-for-all-models/169854/3 "2025-11-03T18:29:17Z")

</div>

I’ll add to @John6666’s reply by mentioning our guide for making your first API request with Inference Providers: [Your First Inference Provider Call](https://huggingface.co/docs/inference-providers/en/guides/first-api-call).

You can also [Build Your First AI App](https://huggingface.co/docs/inference-providers/en/guides/building-first-app) and [Build an Image Editor](https://huggingface.co/docs/inference-providers/en/guides/image-editor) with Inference Providers too 🤗
