Inference APIs
Reference/Errors/Hugging Face

"api-inference.huggingface.co is no longer supported" (Hugging Face, 404/410)

A script, a notebook or a tutorial that called https://api-inference.huggingface.co/models/<model> now gets a 404 (older clients report a 410) with the message api-inference.huggingface.co is no longer supported. Nothing is wrong with your token or your code; the host itself is gone. Hugging Face replaced the serverless Inference API with Inference Providers, which lives at router.huggingface.co, speaks the OpenAI chat format for language models and, since 16 November 2026, routes those language-model requests through OpenRouter.

Last verified November 20, 2026 against HF forum: Inference API returns 404 for all models (Nov 2025), HF Inference Providers docs, HF blog: routing through OpenRouter (16 Nov 2026) · 5 min read

ProviderHugging Face
HTTP status404 Not Found (some clients see 410)
Messagehttps://api-inference.huggingface.co is no longer supported. Please use https://router.huggingface.co/hf-inference instead.
When it happensAny call to the old serverless host api-inference.huggingface.co/models/<id>, whatever the model
Can you wait it out?No. The host is retired; the request has to move to the router
Short answer
  • Chat models: point the OpenAI SDK at https://router.huggingface.co/v1 with your HF token and the model id as org/model.
  • Other tasks (image, audio, classification): use https://router.huggingface.co/hf-inference/models/<id> or InferenceClient with a provider.
  • Model not served by any provider? Pick one that is, or run the same request against another host that serves the open model.

What changed

The serverless Inference API at api-inference.huggingface.co was the free-with-a-token endpoint behind thousands of tutorials. Through 2025 it was reworked into Inference Providers: requests go to router.huggingface.co, which forwards them to a third-party host (Together, Novita, Fireworks, Groq, Cerebras and others, or Hugging Face's own hf-inference). By November 2025 the old host answered every request with the message above; a forum reply from that month calls it the legacy version of the Inference API, now deprecated. On 16 November 2026 Hugging Face announced that language-model requests are now routed through OpenRouter, with automatic retry on another provider when one fails.

Two things follow. The URL must change, and the model must be one that some provider actually serves; the old host would spin up almost any public checkpoint on demand (Model is loading, 503), and the new one does not.

Fix 1 — chat models: the OpenAI-compatible router

For text generation the shortest path is the OpenAI SDK with a new base URL. The model id is the Hub id, optionally with a suffix to pick a provider or a preference.

Python
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://router.huggingface.co/v1",   # was https://api-inference.huggingface.co
    api_key=os.environ["HF_TOKEN"],
)
resp = client.chat.completions.create(
    model="meta-llama/Llama-3.3-70B-Instruct",     # or "...:fastest", "...:cheapest", "...:novita"
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

The :fastest, :cheapest and :<provider> suffixes come from the OpenRouter-backed routing. Billing is pay-as-you-go at the provider's rate with no markup; PRO accounts get $2 of credit a month, Team and Enterprise $2 per seat. Since the OpenRouter switch you can no longer bring your own provider key for language models.

Fix 2 — everything else: InferenceClient or the hf-inference path

Image, audio, embeddings and classification tasks did not move to OpenRouter. Use the huggingface_hub client, which knows the new hosts, or the direct path.

Python
from huggingface_hub import InferenceClient

client = InferenceClient(provider="hf-inference", api_key=os.environ["HF_TOKEN"])   # or provider="fal-ai", "together", ...
image = client.text_to_image("a lighthouse at dusk", model="black-forest-labs/FLUX.1-schnell")
curl, direct path
curl https://router.huggingface.co/hf-inference/models/facebook/bart-large-cnn \
  -H "Authorization: Bearer $HF_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"inputs": "The text to summarise ..."}'

If the answer is not supported by HF inference api or not currently available via any of the supported Inference Providers, the model is simply not hosted; see that page.

Fix 3 — serve the same open model from a fixed-price host

Many of the checkpoints people called on the old host are standard open-weight models. For those the request is the same OpenAI chat call, so any OpenAI-compatible host that serves the model works, and you trade routed, provider-dependent pricing for a published per-model rate.

Python
client = OpenAI(
    base_url="https://api.inferenceapis.com/v1",
    api_key=os.environ["INFERENCEAPIS_API_KEY"],
)
resp = client.chat.completions.create(
    model="meta-llama/Llama-3.3-70B-Instruct-Turbo",   # $0.20 / $0.50 per 1M tokens
    messages=[{"role": "user", "content": "Hello"}],
)

If you were on the old host for a model that has an open-weight equivalent, the same request works against any OpenAI-compatible endpoint that serves it. Inference APIs serves meta-llama/Llama-3.3-70B-Instruct-Turbo, Qwen/Qwen3.8-Flash, deepseek-ai/DeepSeek-V4.1-Flash, openai/gpt-oss-120b and others at a published per-model price, billed per request with no monthly credits to run out of.

Frequently asked questions

Is there still a free tier?

Signed-in free accounts get a small quota on Inference Providers; Hugging Face does not publish the amount and it changes. PRO is $2 of credit a month. For anything beyond a few test calls, budget for pay-as-you-go.

Does my old HF token still work?

Yes. The token is unchanged; only the host and, for some tasks, the client call changed.

Why does the new host refuse models the old one served?

The old host would load almost any public checkpoint on request. Inference Providers only serve models a provider has chosen to deploy. Check the model page on the Hub for the Inference Providers widget.

Where Inference APIs fits

Fix 3 below is for models that no provider on Hugging Face serves any more, or when you want a fixed per-model price instead of routed pricing: the same OpenAI-style request runs against Inference APIs with only the base URL and model id changed.

Something changed or wrong? Tell us and we will re-verify the entry.