Skip to content

API

SiaHub speaks the subset of the Hugging Face Hub API that the hf CLI + hf_xet actually hit. If you stick to those clients, you never need to touch the API directly.

Every write endpoint accepts an Authorization: Bearer <key> header. Three valid shapes:

  • SiaHub API key (opaque string from /keys — SHA-256’d server-side)
  • SiaHub-minted Xet JWT (short-lived, HS256, iss=hf.siahub.app)
  • Hugging Face Xet JWT, when traffic arrives through the hf-proxy shim (iss=huggingface.co)

Read endpoints on public repos accept anonymous callers.

MethodPathNotes
GET/api/whoami-v2Returns the caller’s profile
POST/api/repos/createIdempotent repo create
POST/api/models/{owner}/{repo}/preupload/{ref}Classifies files as lfs vs regular
GET/api/models/{owner}/{repo}/xet-write-token/{ref}Mints a write JWT + CAS URL
GET/api/models/{owner}/{repo}/xet-read-token/{ref}Mints a read JWT + CAS URL
POST/{owner}/{repo}.git/info/lfs/objects/batchClassic Git-LFS batch
POST/api/models/{owner}/{repo}/commit/{ref}Commit the manifest
POST/api/validate-yamlPermissive; always returns OK
MethodPathNotes
GET/api/modelsPublic repo list
GET/api/models/{owner}/{repo}Model info + download counters
GET/api/models/{owner}/{repo}/revision/{rev}Same but by SHA
GET/api/models/{owner}/{repo}/downloads/trendZero-filled 14-day trend
GET | HEAD/{owner}/{repo}/resolve/{rev}/{*path}Redirects to a byte URL
GET/xet/files/{hash}Xorb body (decompressed chunks)
GET | PUT/lfs/objects/{oid}Inline LFS content
MethodPathNotes
POST/v1/xorbs/{prefix}/{hash}Xorb upload
POST/shards + /v1/shardsShard upload
GET/v1/reconstructions/{file_id}V1 reconstruction
GET/v2/reconstructions/{file_id}V2 (behind a feature flag)

The /admin/* endpoints back the browser console and require a session cookie. Not part of the public API surface.