Skip to content

404 Not Found when using https://router.huggingface.co/hf-inference #42169

Description

@oliveiradany07

System Info

Hello Hugging Face Team,

I’m trying to use the new Router API endpoint for model inference:

https://router.huggingface.co/hf-inference

However, whenever I make a request, I always get a "Not Found" (404) response.

Here’s what I’m doing:

Expected behavior:

  • The API should return generated text from the model (like it did with the old api-inference endpoint).

Actual behavior:

  • Always returns 404 Not Found.

I’ve tried with multiple public models (like gpt2, EleutherAI/gpt-neo-125M), but the problem persists.

Environment:

  • Node.js 20
  • Axios for HTTP requests
  • Hugging Face API key: valid and works with the old api-inference endpoint (deprecated)

Could you please advise if this is a bug or if there’s a change in how the Router API should be called?

Thank you!

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

The tasks I am working on are:

  • My own custom task: generating full HTML/CSS/JS websites from prompts.

Expected behavior

The API should return generated text from the model (HTML, CSS, JS) based on the prompt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions