Hugging Face Repos API

General repository management operations

Documentation

Specifications

SDKs

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/hugging-face-repos-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

hugging-face-repos-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Hugging Face Dataset Viewer Audio Repos API
  description: Query and visualize datasets stored on the Hugging Face Hub through a lightweight REST API. Get dataset splits, preview rows, search and filter data, access Parquet files, retrieve size statistics, and obtain Croissant metadata - all without downloading the entire dataset.
  version: 1.0.0
  termsOfService: https://huggingface.co/terms-of-service
  contact:
    name: Hugging Face Support
    url: https://huggingface.co/support
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://datasets-server.huggingface.co
  description: Hugging Face Dataset Viewer production server
security:
- {}
- bearerAuth: []
tags:
- name: Repos
  description: General repository management operations
paths:
  /repos/create:
    post:
      summary: Create a New Repository
      description: Create a new model, dataset, or Space repository on the Hugging Face Hub.
      operationId: createRepo
      tags:
      - Repos
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRepoRequest'
            examples:
              CreaterepoRequestExample:
                summary: Default createRepo request
                x-microcks-default: true
                value:
                  name: Example Title
                  type: model
                  organization: example_value
                  private: true
                  sdk: gradio
      responses:
        '200':
          description: Repository created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepoUrl'
              examples:
                Createrepo200Example:
                  summary: Default createRepo 200 response
                  x-microcks-default: true
                  value:
                    url: https://www.example.com
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Createrepo401Example:
                  summary: Default createRepo 401 response
                  x-microcks-default: true
                  value:
                    error: example_value
                    statusCode: 10
        '409':
          description: Repository already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Createrepo409Example:
                  summary: Default createRepo 409 response
                  x-microcks-default: true
                  value:
                    error: example_value
                    statusCode: 10
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/delete:
    delete:
      summary: Delete a Repository
      description: Delete a model, dataset, or Space repository from the Hub.
      operationId: deleteRepo
      tags:
      - Repos
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - type
              properties:
                name:
                  type: string
                  description: Full repository name (e.g., username/repo-name)
                type:
                  type: string
                  enum:
                  - model
                  - dataset
                  - space
                organization:
                  type: string
                  description: Organization name if applicable
            examples:
              DeleterepoRequestExample:
                summary: Default deleteRepo request
                x-microcks-default: true
                value:
                  name: Example Title
                  type: model
                  organization: example_value
      responses:
        '200':
          description: Repository deleted successfully
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Deleterepo401Example:
                  summary: Default deleteRepo 401 response
                  x-microcks-default: true
                  value:
                    error: example_value
                    statusCode: 10
        '403':
          description: Forbidden - insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Deleterepo403Example:
                  summary: Default deleteRepo 403 response
                  x-microcks-default: true
                  value:
                    error: example_value
                    statusCode: 10
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{repo_type}/{repo_id}/settings:
    put:
      summary: Update Repository Settings
      description: Update the settings (visibility, etc.) for a repository.
      operationId: updateRepoSettings
      tags:
      - Repos
      parameters:
      - name: repo_type
        in: path
        required: true
        schema:
          type: string
          enum:
          - models
          - datasets
          - spaces
        example: models
      - name: repo_id
        in: path
        required: true
        schema:
          type: string
        example: '500123'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                private:
                  type: boolean
                  description: Whether the repository should be private
                gated:
                  type: string
                  enum:
                  - auto
                  - manual
                  - 'false'
                  description: Access gating configuration
            examples:
              UpdatereposettingsRequestExample:
                summary: Default updateRepoSettings request
                x-microcks-default: true
                value:
                  private: true
                  gated: auto
      responses:
        '200':
          description: Settings updated successfully
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Updatereposettings401Example:
                  summary: Default updateRepoSettings 401 response
                  x-microcks-default: true
                  value:
                    error: example_value
                    statusCode: 10
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    RepoUrl:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: Full URL of the created repository
          example: https://www.example.com
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: example_value
        statusCode:
          type: integer
          description: HTTP status code
          example: 10
    CreateRepoRequest:
      type: object
      required:
      - name
      - type
      properties:
        name:
          type: string
          description: Repository name
          example: my-awesome-model
        type:
          type: string
          description: Repository type
          enum:
          - model
          - dataset
          - space
          example: model
        organization:
          type: string
          description: Organization to create the repo under
          example: example_value
        private:
          type: boolean
          description: Whether the repo should be private
          default: false
          example: true
        sdk:
          type: string
          description: SDK for Spaces (required when type is space)
          enum:
          - gradio
          - streamlit
          - docker
          - static
          example: gradio
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: HF Token
      description: Optional Hugging Face API token. Required for private and gated datasets.