Hugging Face Computer Vision API

Image classification, object detection, and segmentation tasks

Operations 2

POST /models/{model_id}/image-classification Image Classification Inference #
POST /models/{model_id}/object-detection Object Detection Inference #

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-computer-vision-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-computer-vision-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hugging Face Inference Computer Vision API
  description: Run inference on 200,000+ machine learning models hosted on the Hugging Face Hub with a simple HTTP request. Supports text generation, image classification, object detection, speech recognition, and many more tasks.
  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://api-inference.huggingface.co
  description: Hugging Face Inference API production server
security:
- bearerAuth: []
tags:
- name: Computer Vision
  description: Image classification, object detection, and segmentation tasks
paths:
  /models/{model_id}/image-classification:
    post:
      summary: Image Classification Inference
      description: Classify an image into predefined categories.
      operationId: imageClassification
      tags:
      - Computer Vision
      parameters:
      - name: model_id
        in: path
        required: true
        schema:
          type: string
        example: google/vit-base-patch16-224
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
            examples:
              ImageclassificationRequestExample:
                summary: Default imageClassification request
                x-microcks-default: true
                value: example_value
          application/json:
            schema:
              type: object
              properties:
                inputs:
                  type: string
                  description: URL of the image to classify
            examples:
              ImageclassificationRequestExample:
                summary: Default imageClassification request
                x-microcks-default: true
                value:
                  inputs: example_value
      responses:
        '200':
          description: Classification results
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ClassificationResult'
              examples:
                Imageclassification200Example:
                  summary: Default imageClassification 200 response
                  x-microcks-default: true
                  value:
                  - label: Example Title
                    score: 42.5
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /models/{model_id}/object-detection:
    post:
      summary: Object Detection Inference
      description: Detect objects in an image and return bounding boxes with labels.
      operationId: objectDetection
      tags:
      - Computer Vision
      parameters:
      - name: model_id
        in: path
        required: true
        schema:
          type: string
        example: facebook/detr-resnet-50
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
            examples:
              ObjectdetectionRequestExample:
                summary: Default objectDetection request
                x-microcks-default: true
                value: example_value
      responses:
        '200':
          description: Detected objects with bounding boxes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ObjectDetectionResult'
              examples:
                Objectdetection200Example:
                  summary: Default objectDetection 200 response
                  x-microcks-default: true
                  value:
                  - label: Example Title
                    score: 42.5
                    box:
                      xmin: 10
                      ymin: 10
                      xmax: 10
                      ymax: 10
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    ObjectDetectionResult:
      type: object
      properties:
        label:
          type: string
          description: Detected object label
          example: Example Title
        score:
          type: number
          format: float
          description: Detection confidence score
          example: 42.5
        box:
          type: object
          properties:
            xmin:
              type: integer
            ymin:
              type: integer
            xmax:
              type: integer
            ymax:
              type: integer
          example: example_value
    ClassificationResult:
      type: object
      properties:
        label:
          type: string
          description: The predicted label
          example: POSITIVE
        score:
          type: number
          format: float
          description: Confidence score for the label
          example: 0.9998
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: HF Token
      description: Hugging Face API token. Generate one from https://huggingface.co/settings/tokens