Hugging Face Models API

Operations for managing and querying models on the Hub

Operations 7

GET /models List Models on the Hub #
GET /models/{repo_id} Get Model Information #
GET /models/{repo_id}/revision/{revision} Get Model Information at a Specific Revision #
GET /metrics List Available Metrics #
GET /models-tags-by-type List Model Tags Grouped by Type #
GET /v1/models List Available Models #
GET /v1/models/{model_id} Get Model Information #

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-models-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 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. See our Privacy Policy and Terms.

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

OpenAPI Specification

hugging-face-models-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hugging Face Models API
  version: 1.0.0
  contact:
    name: Hugging Face Support
    url: https://huggingface.co/support
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  termsOfService: https://huggingface.co/terms-of-service
  description: 'Operations tagged Models across 2 of this provider''s published API definitions: hugging-face-hub-api.yml, hugging-face-inference-providers-api.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://huggingface.co/api
  description: Hugging Face Hub API production server
- url: https://router.huggingface.co
  description: Hugging Face Inference Providers router
security:
- bearerAuth: []
tags:
- name: Models
  description: Operations for managing and querying models on the Hub
paths:
  /models:
    get:
      summary: List Models on the Hub
      description: List and search models hosted on the Hugging Face Hub. Supports filtering by author, task, library, tags, and full-text search.
      operationId: listModels
      tags:
      - Models
      security: []
      parameters:
      - name: search
        in: query
        description: Full-text search query to filter models
        schema:
          type: string
        example: example_value
      - name: author
        in: query
        description: Filter by model author or organization
        schema:
          type: string
        example: example_value
      - name: filter
        in: query
        description: Filter by tags (comma-separated)
        schema:
          type: string
        example: example_value
      - name: sort
        in: query
        description: Property to sort results by
        schema:
          type: string
          enum:
          - lastModified
          - downloads
          - likes
          - createdAt
        example: lastModified
      - name: direction
        in: query
        description: Sort direction
        schema:
          type: string
          enum:
          - '-1'
          - '1'
        example: '-1'
      - name: limit
        in: query
        description: Number of results to return (max 1000)
        schema:
          type: integer
          default: 30
          maximum: 1000
        example: 10
      - name: full
        in: query
        description: Whether to return full model information including card data
        schema:
          type: boolean
          default: false
        example: true
      - name: config
        in: query
        description: Whether to return the model config
        schema:
          type: boolean
          default: false
        example: true
      - name: pipeline_tag
        in: query
        description: Filter by pipeline task type
        schema:
          type: string
          enum:
          - text-generation
          - text-classification
          - token-classification
          - question-answering
          - summarization
          - translation
          - fill-mask
          - image-classification
          - object-detection
          - automatic-speech-recognition
          - text-to-image
          - feature-extraction
        example: text-generation
      - name: library
        in: query
        description: Filter by ML library
        schema:
          type: string
          enum:
          - transformers
          - pytorch
          - tensorflow
          - jax
          - diffusers
          - onnx
          - safetensors
        example: transformers
      responses:
        '200':
          description: List of models matching the query
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ModelSummary'
              examples:
                Listmodels200Example:
                  summary: Default listModels 200 response
                  x-microcks-default: true
                  value:
                  - _id: '500123'
                    id: abc123
                    modelId: '500123'
                    author: example_value
                    sha: example_value
                    lastModified: '2026-01-15T10:30:00Z'
                    private: true
                    disabled: true
                    gated: true
                    pipeline_tag: example_value
                    tags:
                    - example_value
                    downloads: 10
                    likes: 10
                    library_name: example_value
                    createdAt: '2026-01-15T10:30:00Z'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: https://huggingface.co/api
      description: Hugging Face Hub API production server
  /models/{repo_id}:
    get:
      summary: Get Model Information
      description: Get detailed information about a specific model by its repository ID.
      operationId: getModel
      tags:
      - Models
      security: []
      parameters:
      - name: repo_id
        in: path
        required: true
        description: The model repository ID (e.g., bert-base-uncased or organization/model-name)
        schema:
          type: string
        example: bert-base-uncased
      responses:
        '200':
          description: Detailed model information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelInfo'
              examples:
                Getmodel200Example:
                  summary: Default getModel 200 response
                  x-microcks-default: true
                  value: {}
        '401':
          description: Unauthorized - token required for private models
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Getmodel401Example:
                  summary: Default getModel 401 response
                  x-microcks-default: true
                  value:
                    error: example_value
                    statusCode: 10
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Getmodel404Example:
                  summary: Default getModel 404 response
                  x-microcks-default: true
                  value:
                    error: example_value
                    statusCode: 10
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: https://huggingface.co/api
      description: Hugging Face Hub API production server
  /models/{repo_id}/revision/{revision}:
    get:
      summary: Get Model Information at a Specific Revision
      description: Get detailed information about a model at a specific Git revision (branch, tag, or commit SHA).
      operationId: getModelRevision
      tags:
      - Models
      parameters:
      - name: repo_id
        in: path
        required: true
        schema:
          type: string
        example: '500123'
      - name: revision
        in: path
        required: true
        description: Git revision (branch name, tag, or commit SHA)
        schema:
          type: string
        example: example_value
      responses:
        '200':
          description: Model information at the specified revision
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelInfo'
              examples:
                Getmodelrevision200Example:
                  summary: Default getModelRevision 200 response
                  x-microcks-default: true
                  value: {}
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: https://huggingface.co/api
      description: Hugging Face Hub API production server
  /metrics:
    get:
      summary: List Available Metrics
      description: Get the list of available evaluation metrics on the Hub.
      operationId: listMetrics
      tags:
      - Models
      security: []
      responses:
        '200':
          description: List of available metrics
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    description:
                      type: string
              examples:
                Listmetrics200Example:
                  summary: Default listMetrics 200 response
                  x-microcks-default: true
                  value:
                  - id: abc123
                    description: A sample description.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: https://huggingface.co/api
      description: Hugging Face Hub API production server
  /models-tags-by-type:
    get:
      summary: List Model Tags Grouped by Type
      description: Get all available model tags organized by type (pipeline_tag, library, language, license, etc.).
      operationId: listModelTags
      tags:
      - Models
      security: []
      responses:
        '200':
          description: Tags grouped by type
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      label:
                        type: string
                      subType:
                        type: string
              examples:
                Listmodeltags200Example:
                  summary: Default listModelTags 200 response
                  x-microcks-default: true
                  value: {}
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: https://huggingface.co/api
      description: Hugging Face Hub API production server
  /v1/models:
    get:
      summary: List Available Models
      description: List models available through inference providers. Returns model IDs and basic metadata.
      operationId: listModels
      tags:
      - Models
      responses:
        '200':
          description: List of available models
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: list
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Model ID
                        object:
                          type: string
                          const: model
                        created:
                          type: integer
                          description: Unix timestamp of creation
                        owned_by:
                          type: string
                          description: Model owner
              examples:
                Listmodels200Example:
                  summary: Default listModels 200 response
                  x-microcks-default: true
                  value:
                    object: example_value
                    data:
                    - id: abc123
                      object: example_value
                      created: 10
                      owned_by: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: https://router.huggingface.co
      description: Hugging Face Inference Providers router
  /v1/models/{model_id}:
    get:
      summary: Get Model Information
      description: Get information about a specific model available through inference providers.
      operationId: getModel
      tags:
      - Models
      parameters:
      - name: model_id
        in: path
        required: true
        description: The model ID
        schema:
          type: string
        example: meta-llama/Llama-3-70b-chat-hf
      responses:
        '200':
          description: Model information
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  object:
                    type: string
                    const: model
                  created:
                    type: integer
                  owned_by:
                    type: string
              examples:
                Getmodel200Example:
                  summary: Default getModel 200 response
                  x-microcks-default: true
                  value:
                    id: abc123
                    object: example_value
                    created: 10
                    owned_by: example_value
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_2'
              examples:
                Getmodel404Example:
                  summary: Default getModel 404 response
                  x-microcks-default: true
                  value:
                    error:
                      message: example_value
                      type: example_value
                      code: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: https://router.huggingface.co
      description: Hugging Face Inference Providers router
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: example_value
        statusCode:
          type: integer
          description: HTTP status code
          example: 10
    ModelInfo:
      allOf:
      - $ref: '#/components/schemas/ModelSummary'
      - type: object
        properties:
          siblings:
            type: array
            items:
              type: object
              properties:
                rfilename:
                  type: string
                size:
                  type: integer
                lfs:
                  type: object
                  properties:
                    sha256:
                      type: string
                    size:
                      type: integer
                    pointerSize:
                      type: integer
            description: Files in the repository
          spaces:
            type: array
            items:
              type: string
            description: Spaces using this model
          safetensors:
            type: object
            properties:
              parameters:
                type: object
                additionalProperties:
                  type: integer
              total:
                type: integer
            description: Safetensors parameter information
          config:
            type: object
            description: Model configuration
          cardData:
            type: object
            description: Parsed model card metadata
          transformersInfo:
            type: object
            properties:
              auto_model:
                type: string
              pipeline_tag:
                type: string
              processor:
                type: string
    ModelSummary:
      type: object
      properties:
        _id:
          type: string
          description: Unique model identifier
          example: '500123'
        id:
          type: string
          description: Model repository ID (e.g., bert-base-uncased)
          example: abc123
        modelId:
          type: string
          description: Alias for id
          example: '500123'
        author:
          type: string
          description: Model author or organization
          example: example_value
        sha:
          type: string
          description: Latest commit SHA
          example: example_value
        lastModified:
          type: string
          format: date-time
          description: Last modification timestamp
          example: '2026-01-15T10:30:00Z'
        private:
          type: boolean
          description: Whether the model is private
          example: true
        disabled:
          type: boolean
          example: true
        gated:
          type: boolean
          description: Whether access is gated
          example: true
        pipeline_tag:
          type: string
          description: Pipeline task tag
          example: example_value
        tags:
          type: array
          items:
            type: string
          example: []
        downloads:
          type: integer
          description: Total download count
          example: 10
        likes:
          type: integer
          description: Total like count
          example: 10
        library_name:
          type: string
          description: Primary ML library
          example: example_value
        createdAt:
          type: string
          format: date-time
          example: '2026-01-15T10:30:00Z'
    Error_2:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Error message
            type:
              type: string
              description: Error type
            code:
              type: string
              description: Error code
          example: example_value
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: HF Token
      description: Hugging Face user access token. Generate from https://huggingface.co/settings/tokens
x-refined-from:
- hugging-face-hub-api.yml
- hugging-face-inference-providers-api.yml