NativePort Hugging Face API
The huggingFace API from NativePort — 1 operation(s) for huggingface.
The huggingFace API from NativePort — 1 operation(s) for huggingface.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/nativeport-ai:nativeport-ai-huggingface-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Reference Hugging Face API
version: 1.0.0
servers:
- url: https://api.nativeport.ai
description: NativePort production
- url: http://localhost:8787
description: Local development (wrangler dev)
tags:
- name: huggingFace
paths:
/huggingface/{path}:
get:
operationId: huggingFace_huggingfaceGet
summary: List the catalog, or look up one model
description: '`GET /v1/models` and `GET /v1/models/{owner}/{repo}` both answer locally from the gateway''s
catalog, in the same shape as the live router''s own model-list response (each admitted
provider''s `pricing`, the gateway''s 5.5% fee included, with the pinned default listed
first) — nothing is proxied to Hugging Face for a `GET`.'
tags:
- huggingFace
parameters:
- name: path
in: path
description: 'The path to call on Hugging Face''s Inference Providers router, any further `/` segments
included — all of it after `/huggingface/` is passed to `https://router.huggingface.co/`
when the gateway''s `(model, provider)` catalog admits the request (see the Hugging Face tag
description above). Only two forms are admitted: `v1/chat/completions` and
`v1/models[/{owner}/{repo}]`.
'
required: true
schema:
type: string
responses:
'200':
description: 'Whatever the upstream answered, relayed as-is (status, headers, body). Rendered here as
JSON; the true shape is the upstream provider''s to define.
'
content:
application/json:
schema:
type: object
additionalProperties:
description: Any type
'401':
description: 'The bearer token was missing, unknown, or revoked. The reply body is the JSON `{ "error": "Unauthorized." }`.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'No route matched the path, or the matched route disallows that method (an unlisted
`/serper/<endpoint>`, for instance). The body lists every mounted route, verbatim as the
gateway sends it. A path on one of the four model-inference routes also `404`s this way when
the specific endpoint or model isn''t on that provider''s allowlist; an unsupported model
addressed through `/inference` gets that endpoint''s own `400` instead (see the Inference tag).
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security:
- bearerAuth: []
post:
operationId: huggingFace_huggingfacePost
summary: Run chat completion inference
description: 'The only admitted `POST`. A bare `model` id is rewritten to its pinned default serving
provider; an explicit `model:provider` suffix is honored only if that exact pairing is
cataloged, and the router''s own `:fastest`/`:cheapest`/`:preferred` policy suffixes are
rejected outright (see the Hugging Face tag description above). `tools[]` items must be
`type: "function"`. The client-suppliable `X-HF-Bill-To` header is always removed.'
tags:
- huggingFace
parameters:
- name: path
in: path
description: 'The path to call on Hugging Face''s Inference Providers router, any further `/` segments
included — all of it after `/huggingface/` is passed to `https://router.huggingface.co/`
when the gateway''s `(model, provider)` catalog admits the request (see the Hugging Face tag
description above). Only two forms are admitted: `v1/chat/completions` and
`v1/models[/{owner}/{repo}]`.
'
required: true
schema:
type: string
responses:
'200':
description: 'Whatever the upstream answered, relayed as-is (status, headers, body). Rendered here as
JSON; the true shape is the upstream provider''s to define.
'
content:
application/json:
schema:
type: object
additionalProperties:
description: Any type
'400':
description: 'The gateway''s own request-policy check rejected the call before it reached the upstream —
an unrecognized `model`, a disallowed body field, an unapproved `anthropic-beta` flag, or
similar. Shaped like the upstream''s own error envelope (OpenAI/Grok/Hugging Face style) so
official SDKs render it without special-casing; the `code` value (`gateway_*`) names the
specific rejection reason and isn''t part of the upstream''s own documented set of codes.
'
content:
application/json:
schema:
type: object
additionalProperties:
description: Any type
'401':
description: 'The bearer token was missing, unknown, or revoked. The reply body is the JSON `{ "error": "Unauthorized." }`.
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'No route matched the path, or the matched route disallows that method (an unlisted
`/serper/<endpoint>`, for instance). The body lists every mounted route, verbatim as the
gateway sends it. A path on one of the four model-inference routes also `404`s this way when
the specific endpoint or model isn''t on that provider''s allowlist; an unsupported model
addressed through `/inference` gets that endpoint''s own `400` instead (see the Inference tag).
'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
requestBody:
content:
application/json:
schema:
type: object
additionalProperties:
description: Any type
security:
- bearerAuth: []
components:
schemas:
Error:
type: object
properties:
error:
type: string
description: Explanatory message meant for humans.
required:
- error
title: Error
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'Your per-client bearer token — the API key the gateway issued to you. Present it in
`Authorization: Bearer <token>` form. A token that is missing, unknown, or revoked draws a
`401`. Before the call is sent upstream the token is removed (stripped, or swapped for the
upstream''s own credential); it never makes it past the gateway.
'