Skip to content

Technical Report: Deprecated HuggingFace API Endpoint in Cloudflare AI Gateway #27332

@jadmadi

Description

@jadmadi

Example URL(s)

Actual Behavior

The Cloudflare AI Gateway documentation for HuggingFace providers appears to be outdated. The documentation does not reflect that HuggingFace has deprecated api-inference.huggingface.co in favor of router.huggingface.co. As a result, users attempting to use HuggingFace models through the AI Gateway encounter errors indicating the old endpoint is no longer supported, even though the gateway URL format (https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/huggingface/{model}) remains unchanged.

Expected Behavior

The documentation should be updated to:

  1. Clearly state that the AI Gateway now routes to HuggingFace's updated router.huggingface.co endpoint internally.
  2. Remove any references to the deprecated api-inference.huggingface.co endpoint.
  3. Include a note about the transition and potential temporary errors during the migration period.
  4. Provide updated examples or confirm that existing gateway URLs continue to work without user-side changes.

Additional information

Image

Metadata

Metadata

Assignees

Labels

product:ai-gatewayAI Gateway: https://developers.cloudflare.com/ai-gateway/

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions