Label Studio Subpackage Ml API

The subpackage_ml API from Label Studio — 6 operation(s) for subpackage_ml.

Business capability
Artificial Intelligence Management BC-610.60

Operations 9

GET /api/ml/ List ML backends #
POST /api/ml/ Add ML Backend #
GET /api/ml/{id} Get ML Backend #
DELETE /api/ml/{id} Remove ML Backend #
PATCH /api/ml/{id} Update ML Backend #
POST /api/ml/{id}/interactive-annotating Request Interactive Annotation #
POST /api/ml/{id}/predict ✨ Create predictions for all tasks #
POST /api/ml/{id}/train Train #
GET /api/ml/{id}/versions Get model versions #

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/label-studio-subpackage-ml-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

label-studio-subpackage-ml-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Reference Subpackage Ml API
  version: 1.0.0
servers:
- url: http://localhost:8000
tags:
- name: subpackage_ml
paths:
  /api/ml/:
    get:
      operationId: list
      summary: List ML backends
      description: 'List all configured ML backends for a specific project by ID.

        Use the following cURL command:

        ```bash

        curl http://localhost:8000/api/ml?project={project_id} -H ''Authorization: Token abc123'''
      tags:
      - subpackage_ml
      parameters:
      - name: project
        in: query
        description: Project ID
        required: false
        schema:
          type: integer
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MLBackend'
    post:
      operationId: create
      summary: Add ML Backend
      description: 'Add an ML backend to a project using the Label Studio UI or by sending a POST request using the following cURL

        command:

        ```bash

        curl -X POST -H ''Content-type: application/json'' http://localhost:8000/api/ml -H ''Authorization: Token abc123''\

        --data ''{"url": "http://localhost:9090", "project": {project_id}}'''
      tags:
      - subpackage_ml
      parameters:
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MLBackend'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auth_method:
                  $ref: '#/components/schemas/ApiMlPostRequestBodyContentApplicationJsonSchemaAuthMethod'
                  description: Auth method
                basic_auth_pass:
                  type: string
                  description: Basic auth password
                basic_auth_user:
                  type: string
                  description: Basic auth user
                description:
                  type: string
                  description: Description
                extra_params:
                  $ref: '#/components/schemas/ApiMlPostRequestBodyContentApplicationJsonSchemaExtraParams'
                  description: Extra parameters
                is_interactive:
                  type: boolean
                  description: Is interactive
                project:
                  type: integer
                  description: Project ID
                timeout:
                  type: integer
                  description: Response model timeout
                title:
                  type: string
                  description: Title
                url:
                  type: string
                  description: ML backend URL
  /api/ml/{id}:
    get:
      operationId: get
      summary: Get ML Backend
      description: 'Get details about a specific ML backend connection by ID. For example, make a GET request using the

        following cURL command:

        ```bash

        curl http://localhost:8000/api/ml/{ml_backend_ID} -H ''Authorization: Token abc123'''
      tags:
      - subpackage_ml
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MLBackend'
    delete:
      operationId: delete
      summary: Remove ML Backend
      description: 'Remove an existing ML backend connection by ID. For example, use the

        following cURL command:

        ```bash

        curl -X DELETE http://localhost:8000/api/ml/{ml_backend_ID} -H ''Authorization: Token abc123'''
      tags:
      - subpackage_ml
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
    patch:
      operationId: update
      summary: Update ML Backend
      description: 'Update ML backend parameters using the Label Studio UI or by sending a PATCH request using the following cURL command:

        ```bash

        curl -X PATCH -H ''Content-type: application/json'' http://localhost:8000/api/ml/{ml_backend_ID} -H ''Authorization: Token abc123''\

        --data ''{"url": "http://localhost:9091"}'''
      tags:
      - subpackage_ml
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MLBackend'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auth_method:
                  $ref: '#/components/schemas/ApiMlIdPatchRequestBodyContentApplicationJsonSchemaAuthMethod'
                  description: Auth method
                basic_auth_pass:
                  type: string
                  description: Basic auth password
                basic_auth_user:
                  type: string
                  description: Basic auth user
                description:
                  type: string
                  description: Description
                extra_params:
                  $ref: '#/components/schemas/ApiMlIdPatchRequestBodyContentApplicationJsonSchemaExtraParams'
                  description: Extra parameters
                is_interactive:
                  type: boolean
                  description: Is interactive
                project:
                  type: integer
                  description: Project ID
                timeout:
                  type: integer
                  description: Response model timeout
                title:
                  type: string
                  description: Title
                url:
                  type: string
                  description: ML backend URL
  /api/ml/{id}/interactive-annotating:
    post:
      operationId: predict-interactive
      summary: Request Interactive Annotation
      description: 'Send a request to the machine learning backend set up to be used for interactive preannotations to retrieve a

        predicted region based on annotator input.

        See set up machine learning for more.'
      tags:
      - subpackage_ml
      parameters:
      - name: id
        in: path
        description: A unique integer value identifying this ML backend.
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Interactive annotation has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ml_predict_interactive_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MLInteractiveAnnotatingRequestRequest'
  /api/ml/{id}/predict:
    post:
      operationId: predict-all-tasks
      summary: ✨ Create predictions for all tasks
      description: 'This endpoint is not available in Label Studio Community Edition. Learn more about Label Studio Enterprise


        Create predictions for all tasks using a specific ML backend so that you can set up an active learning strategy based on the confidence or uncertainty scores associated with the predictions. Creating predictions requires a Label Studio ML backend set up and configured for your project.


        See Set up machine learning for more details about a Label Studio ML backend.


        Reference the ML backend ID in the path of this API call. Get the ML backend ID by listing the ML backends for a project.'
      tags:
      - subpackage_ml
      parameters:
      - name: id
        in: path
        description: A unique integer value identifying this ML backend.
        required: true
        schema:
          type: integer
      - name: batch_size
        in: query
        description: Computed number of tasks without predictions that the ML backend needs to predict.
        required: false
        schema:
          type: integer
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Predictions have successfully started.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ml_predict_all_tasks_Response_200'
  /api/ml/{id}/train:
    post:
      operationId: train
      summary: Train
      description: 'After you add an ML backend, call this API with the ML backend ID to start training with

        already-labeled tasks.


        Get the ML backend ID by listing the ML backends for a project.'
      tags:
      - subpackage_ml
      parameters:
      - name: id
        in: path
        description: A unique integer value identifying this ML backend.
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Training has successfully started.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ml_train_Response_200'
        '500':
          description: Training error
          content:
            application/json:
              schema:
                type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                use_ground_truth:
                  type: boolean
                  description: Whether to include ground truth annotations in training
  /api/ml/{id}/versions:
    get:
      operationId: list-model-versions
      summary: Get model versions
      description: Get available versions of the model.
      tags:
      - subpackage_ml
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: List of available versions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ml_list_model_versions_Response_200'
components:
  schemas:
    ApiMlIdPatchRequestBodyContentApplicationJsonSchemaExtraParams:
      type: object
      properties: {}
      description: Extra parameters
      title: ApiMlIdPatchRequestBodyContentApplicationJsonSchemaExtraParams
    ApiMlIdPatchRequestBodyContentApplicationJsonSchemaAuthMethod:
      type: string
      enum:
      - NONE
      - BASIC_AUTH
      description: Auth method
      title: ApiMlIdPatchRequestBodyContentApplicationJsonSchemaAuthMethod
    ApiMlPostRequestBodyContentApplicationJsonSchemaExtraParams:
      type: object
      properties: {}
      description: Extra parameters
      title: ApiMlPostRequestBodyContentApplicationJsonSchemaExtraParams
    AuthMethodEnum:
      type: string
      enum:
      - NONE
      - BASIC_AUTH
      description: '* `NONE` - None

        * `BASIC_AUTH` - Basic Auth'
      title: AuthMethodEnum
    ml_train_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: ml_train_Response_200
    ml_predict_all_tasks_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: ml_predict_all_tasks_Response_200
    MLInteractiveAnnotatingRequestRequest:
      type: object
      properties:
        context:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Context for ML model
        task:
          type: integer
          description: ID of task to annotate
      required:
      - task
      description: Serializer for ML interactive annotating request.
      title: MLInteractiveAnnotatingRequestRequest
    ml_predict_interactive_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: ml_predict_interactive_Response_200
    ml_list_model_versions_Response_200:
      type: object
      properties:
        message:
          type: string
        versions:
          type: array
          items:
            type: string
      title: ml_list_model_versions_Response_200
    ApiMlPostRequestBodyContentApplicationJsonSchemaAuthMethod:
      type: string
      enum:
      - NONE
      - BASIC_AUTH
      description: Auth method
      title: ApiMlPostRequestBodyContentApplicationJsonSchemaAuthMethod
    StateEnum:
      type: string
      enum:
      - CO
      - DI
      - ER
      - TR
      - PR
      description: '* `CO` - Connected

        * `DI` - Disconnected

        * `ER` - Error

        * `TR` - Training

        * `PR` - Predicting'
      title: StateEnum
    MLBackend:
      type: object
      properties:
        auth_method:
          $ref: '#/components/schemas/AuthMethodEnum'
        auto_update:
          type: boolean
          description: If false, model version is set by the user, if true - getting latest version from backend.
        basic_auth_pass_is_set:
          type: boolean
        basic_auth_user:
          type:
          - string
          - 'null'
          description: HTTP Basic Auth user
        created_at:
          type: string
          format: date-time
        description:
          type:
          - string
          - 'null'
          description: Description for the machine learning backend
        error_message:
          type:
          - string
          - 'null'
          description: Error message in error state
        extra_params:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Any extra parameters passed to the ML Backend during the setup
        id:
          type: integer
        is_interactive:
          type: boolean
          description: Used to interactively annotate tasks. If true, model returns one list with results
        model_version:
          type:
          - string
          - 'null'
          description: Current model version associated with this machine learning backend
        project:
          type: integer
        readable_state:
          type: string
        state:
          $ref: '#/components/schemas/StateEnum'
        timeout:
          type: number
          format: double
          description: Response model timeout
        title:
          type:
          - string
          - 'null'
          description: Name of the machine learning backend
        updated_at:
          type: string
          format: date-time
        url:
          type: string
          description: URL for the machine learning model server
      required:
      - basic_auth_pass_is_set
      - created_at
      - id
      - project
      - readable_state
      - updated_at
      - url
      description: Serializer for MLBackend model.
      title: MLBackend
  securitySchemes:
    Token:
      type: apiKey
      in: header
      name: Authorization
      description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'