---
title: "Add ML Backend"
method: POST
path: "/api/ml/"
tags: ["Machine Learning"]
---

# Add ML Backend

`POST /api/ml/`

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}}'

## Request body

- MLBackendRequestRequest — OpenAPI/SDK request body for ML backend create/update. Runtime still uses MLBackendSerializer.
  - `auth_method` 'NONE' | 'BASIC_AUTH' — * `NONE` - None * `BASIC_AUTH` - Basic Auth
  - `auto_update` boolean — If false, model version is set by the user, if true - getting latest version from backend.
  - `basic_auth_pass` string, nullable
  - `basic_auth_user` string, nullable — HTTP Basic Auth user
  - `description` string, nullable — Description for the machine learning backend
  - `extra_params` unknown
  - `is_interactive` boolean — Used to interactively annotate tasks. If true, model returns one list with results
  - `model_version` string, nullable — Current model version associated with this machine learning backend
  - `project` integer, required
  - `timeout` number, double — Response model timeout
  - `title` string, nullable — Name of the machine learning backend
  - `url` string, required — URL for the machine learning model server

## Response `201`

- MLBackend — Serializer for MLBackend model.
  - `auth_method` 'NONE' | 'BASIC_AUTH' — * `NONE` - None * `BASIC_AUTH` - Basic Auth
  - `auto_update` boolean — If false, model version is set by the user, if true - getting latest version from backend.
  - `basic_auth_pass_is_set` boolean, required
  - `basic_auth_user` string, nullable — HTTP Basic Auth user
  - `created_at` string, date-time, required
  - `description` string, nullable — Description for the machine learning backend
  - `error_message` string, nullable — Error message in error state
  - `extra_params` unknown
  - `id` integer, required
  - `is_interactive` boolean — Used to interactively annotate tasks. If true, model returns one list with results
  - `model_version` string, nullable — Current model version associated with this machine learning backend
  - `project` integer, required
  - `readable_state` string, required
  - `state` 'CO' | 'DI' | 'ER' | 'TR' | 'PR' — * `CO` - Connected * `DI` - Disconnected * `ER` - Error * `TR` - Training * `PR` - Predicting
  - `timeout` number, double — Response model timeout
  - `title` string, nullable — Name of the machine learning backend
  - `updated_at` string, date-time, required
  - `url` string, required — URL for the machine learning model server

---

[API](https://skmtc.net/humansignal/apis/label-studio-api.md) · [All operations](https://skmtc.net/humansignal/apis/label-studio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/humansignal/label-studio-api/revisions/1d13f90af57a/schema)
