Hugging Face
The Inference Providers router — one chat-completions endpoint, provider-pinned pricing
Fronts Hugging Face’s Inference Providers router. It is the leanest of the model-inference routes here: the admitted surface is stateless chat completion only, and — like the OpenAI, Anthropic and Grok routes — it’s policed, not a transparent pass-through.
This route ships behind a kill switch that defaults to off, plus a per-account pilot allowlist — the same current-availability caveat as the other model-inference routes. A request can 404 here even with a funded, valid key until this route is enabled for your deployment.
Endpoints
Exactly two forms are admitted; anything else under /huggingface is refused with the gateway’s own 404 and never reaches the router.
The provider pin
Hugging Face’s router serves each model through several competing backing providers whose prices differ, and nothing in a routed response identifies which one served it. So the gateway’s catalog pins every admitted model to a specific (model, provider) pair with its own verified rate:
- A bare model id (e.g.
openai/gpt-oss-120b) resolves to its pinned default provider. - An explicit
model:providersuffix (e.g.openai/gpt-oss-120b:together) is honored only if that exact pairing is cataloged. - The router’s own
:fastest,:cheapest, and:preferredrouting-policy suffixes are rejected — they would make the price paid unpredictable, since nothing confirms which provider actually served the request.
Request policy
- Overwritten unconditionally: the
Authorization: Bearerheader, replaced with the gateway’s own Hugging Face token. - Always removed: the
X-HF-Bill-Toheader — it’s a client-suppliable org-billing redirect header with our token attached, a channel no other upstream on this gateway has. - Function-only: each
tools[]entry must havetype: "function", validated structurally; any other type is rejected. - No forced per-tenant identity field — Hugging Face documents no
user/attribution field on chat completions, so this route (uniquely among the four) doesn’t force one.
Billing
Metered per token from the response’s prompt_tokens/completion_tokens, at the pinned (model, provider) pair’s rate — a pass-through of the provider’s own list price, no Hugging Face markup. An account can register its own Hugging Face token; while that’s active, calls bill to that token directly (bringing along that account’s own Hugging Face credits) instead of metering through the gateway balance.
Examples
Chat Completions (pinned default provider)
Chat Completions (explicit provider pin)
List the catalog
Responses arrive as the router’s JSON, untouched once a request clears the checks above. Field-level request and response detail lives in Hugging Face’s documentation.