Hugging Face Transformers Repos API
The following endpoints manage repository settings like creating and deleting a repository.
The following endpoints manage repository settings like creating and deleting a repository.
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/hugging-face-transformers:hugging-face-transformers-repos-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: Hub API Endpoints Repos API
version: 0.0.1
description: We have open endpoints that you can use to retrieve information from the Hub as well as perform certain actions such as creating model, dataset or Space repos.
servers:
- url: https://huggingface.co
description: Hub
security:
- bearerAuth: []
tags:
- name: Repos
x-displayName: Repositories
description: The following endpoints manage repository settings like creating and deleting a repository.
paths:
/api/{repoType}/{namespace}/{repo}/duplicate:
post:
summary: Duplicate a repository
tags:
- Repos
requestBody:
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
repository:
type: string
private:
type: boolean
visibility:
enum:
- private
- public
- protected
resourceGroupId:
anyOf:
- anyOf:
- type: string
minLength: 24
maxLength: 24
pattern: ^[0-9a-fA-F]{24}$
- type: 'null'
- type: 'null'
hardware:
default: ''
enum:
- cpu-basic
- cpu-upgrade
- cpu-performance
- cpu-xl
- sprx8
- zero-a10g
- t4-small
- t4-medium
- l4x1
- l4x4
- l40sx1
- l40sx4
- l40sx8
- a10g-small
- a10g-large
- a10g-largex2
- a10g-largex4
- a100-large
- a100x4
- a100x8
- h200
- h200x2
- h200x4
- h200x8
- rtx-pro-6000
- rtx-pro-6000x2
- rtx-pro-6000x4
- rtx-pro-6000x8
- inf2x6
- ''
sleepTimeSeconds:
anyOf:
- type: integer
exclusiveMinimum: 0
maximum: 9007199254740991
- const: -1
secrets:
default: []
type: array
items:
type: object
properties:
key:
type: string
pattern: ^[a-zA-Z][_a-zA-Z0-9]*$
description:
type: string
value:
type: string
required:
- key
- value
variables:
default: []
type: array
items:
type: object
properties:
key:
type: string
pattern: ^[a-zA-Z][_a-zA-Z0-9]*$
description:
type: string
value:
type: string
required:
- key
- value
volumes:
description: HuggingFace Buckets or Repos to mount as volumes in the duplicated Space.
type: array
items:
type: object
properties:
type:
enum:
- bucket
- model
- dataset
- space
source:
description: Source identifier, e.g. 'username/my-bucket' or 'username/my-model'
type: string
mountPath:
description: Mount path inside the container, e.g. '/data'
type: string
pattern: ^\/.*
revision:
description: Git revision (only for repos, defaults to 'main')
type: string
readOnly:
description: Read-only mount (true for repos, false default for buckets)
type: boolean
path:
description: Subfolder prefix inside the bucket/repo to mount, e.g. 'path/to/dir'
type: string
required:
- type
- source
- mountPath
required:
- repository
responses:
'200':
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
url:
type: string
required:
- url
additionalProperties: false
description: Repository created, url is given
parameters:
- name: repoType
in: path
required: true
schema:
type: string
enum:
- spaces
- name: namespace
in: path
required: true
schema:
type: string
- name: repo
in: path
required: true
schema:
type: string
operationId: postApiByRepoTypeByNamespaceByRepoDuplicate
x-operation-id-source: derived
/api/repos/create:
post:
summary: Create a new repository
tags:
- Repos
requestBody:
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
allOf:
- type: object
properties:
name:
type: string
organization:
anyOf:
- type: string
- type: 'null'
region:
description: The region where the repository is hosted.
enum:
- us
- eu
license:
description: The license of the repository. You can select 'Other' if your license is not in the list
enum:
- apache-2.0
- mit
- openrail
- bigscience-openrail-m
- creativeml-openrail-m
- bigscience-bloom-rail-1.0
- bigcode-openrail-m
- afl-3.0
- artistic-2.0
- bsl-1.0
- bsd
- bsd-2-clause
- bsd-3-clause
- bsd-3-clause-clear
- c-uda
- cc
- cc0-1.0
- cc-by-2.0
- cc-by-2.5
- cc-by-3.0
- cc-by-4.0
- cc-by-sa-3.0
- cc-by-sa-4.0
- cc-by-nc-2.0
- cc-by-nc-3.0
- cc-by-nc-4.0
- cc-by-nd-4.0
- cc-by-nc-nd-3.0
- cc-by-nc-nd-4.0
- cc-by-nc-sa-2.0
- cc-by-nc-sa-3.0
- cc-by-nc-sa-4.0
- cdla-sharing-1.0
- cdla-permissive-1.0
- cdla-permissive-2.0
- wtfpl
- ecl-2.0
- epl-1.0
- epl-2.0
- etalab-2.0
- eupl-1.1
- eupl-1.2
- agpl-3.0
- gfdl
- gpl
- gpl-2.0
- gpl-3.0
- lgpl
- lgpl-2.1
- lgpl-3.0
- isc
- h-research
- intel-research
- lppl-1.3c
- ms-pl
- apple-ascl
- apple-amlr
- mpl-2.0
- odc-by
- odbl
- openmdw-1.0
- openrail++
- osl-3.0
- postgresql
- ofl-1.1
- ncsa
- unlicense
- zlib
- pddl
- lgpl-lr
- deepfloyd-if-license
- fair-noncommercial-research-license
- llama2
- llama3
- llama3.1
- llama3.2
- llama3.3
- llama4
- grok2-community
- gemma
- unknown
- other
license_name:
type: string
pattern: ^[a-z0-9-.]+$
license_link:
anyOf:
- const: LICENSE
- const: LICENSE.md
- type: string
format: uri
private:
description: Repository visibility. Defaults to public. Cannot be specified along with visibility.
anyOf:
- type: boolean
- type: 'null'
visibility:
description: Repository visibility. `protected` is only supported for Spaces. Cannot be specified along with private.
enum:
- private
- public
- protected
resourceGroupId:
anyOf:
- type: string
minLength: 24
maxLength: 24
pattern: ^[0-9a-fA-F]{24}$
- type: 'null'
files:
type: array
items:
type: object
properties:
content:
type: string
path:
type: string
encoding:
enum:
- utf-8
- base64
required:
- content
- path
required:
- name
- anyOf:
- type: object
properties:
type:
const: dataset
required:
- type
- type: object
properties:
type:
default: model
const: model
- type: object
properties:
type:
const: kernel
required:
- type
- type: object
properties:
type:
const: space
template:
type: string
short_description:
type: string
maxLength: 60
hardware:
description: The hardware flavor of the space. If you select 'zero-a10g' or 'zerogpu', the SDK must be Gradio.
enum:
- cpu-basic
- cpu-upgrade
- cpu-performance
- cpu-xl
- sprx8
- zero-a10g
- t4-small
- t4-medium
- l4x1
- l4x4
- l40sx1
- l40sx4
- l40sx8
- a10g-small
- a10g-large
- a10g-largex2
- a10g-largex4
- a100-large
- a100x4
- a100x8
- h200
- h200x2
- h200x4
- h200x8
- rtx-pro-6000
- rtx-pro-6000x2
- rtx-pro-6000x4
- rtx-pro-6000x8
- inf2x6
- zerogpu
secrets:
default: []
type: array
items:
type: object
properties:
key:
type: string
pattern: ^[a-zA-Z][_a-zA-Z0-9]*$
description:
type: string
value:
type: string
required:
- key
- value
variables:
default: []
type: array
items:
type: object
properties:
key:
type: string
pattern: ^[a-zA-Z][_a-zA-Z0-9]*$
description:
type: string
value:
type: string
required:
- key
- value
sleepTimeSeconds:
anyOf:
- type: integer
exclusiveMinimum: 0
maximum: 9007199254740991
- const: -1
volumes:
description: HuggingFace Buckets or Repos to mount as volumes in the Space container.
type: array
items:
type: object
properties:
type:
enum:
- bucket
- model
- dataset
- space
source:
description: Source identifier, e.g. 'username/my-bucket' or 'username/my-model'
type: string
mountPath:
description: Mount path inside the container, e.g. '/data'
type: string
pattern: ^\/.*
revision:
description: Git revision (only for repos, defaults to 'main')
type: string
readOnly:
description: Read-only mount (true for repos, false default for buckets)
type: boolean
path:
description: Subfolder prefix inside the bucket/repo to mount, e.g. 'path/to/dir'
type: string
required:
- type
- source
- mountPath
sdk:
enum:
- gradio
- docker
- static
sdkVersion:
anyOf:
- type: string
- type: 'null'
devModeEnabled:
type: boolean
required:
- type
- sdk
responses:
'200':
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
url:
type: string
name:
type: string
id:
type: string
minLength: 24
maxLength: 24
pattern: ^[0-9a-f]{24}$
required:
- url
- name
- id
additionalProperties: false
description: Repository created, url is given
'409':
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
error:
type: string
url:
type: string
required:
- error
- url
additionalProperties: false
description: Repository already exists, url is given
operationId: postApiReposCreate
x-operation-id-source: derived
/api/repos/move:
post:
description: Move or rename a repo
summary: Move repo
tags:
- Repos
requestBody:
content:
application/json:
schema:
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
fromRepo:
examples:
- black-forest-labs/FLUX.1-dev
type: string
toRepo:
type: string
type:
default: model
enum:
- dataset
- model
- space
- bucket
- kernel
required:
- fromRepo
- toRepo
operationId: postApiReposMove
x-operation-id-source: derived
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer