> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/get-started/developer-overview.md). Agents can also search and read this documentation through its [MCP server](https://docs.unitlab.ai/~gitbook/mcp).

# Developer overview

How the Unitlab SDK, CLI, HTTP API and MCP fit together, and the objects you work with in code.

Unitlab has four automation surfaces. All of them act inside one workspace and see the same projects, data and releases as the web app.

| Surface                                          | Authenticates with        | Acts as                                                    |
| ------------------------------------------------ | ------------------------- | ---------------------------------------------------------- |
| Python SDK (`from unitlab import UnitlabClient`) | Workspace API key         | The workspace, limited by the key's permissions            |
| CLI (`unitlab ...`)                              | Workspace API key         | Same as the SDK; the CLI is built on it                    |
| HTTP API (`/api/sdk/...`)                        | Workspace API key         | Same as the SDK                                            |
| MCP (`https://api.unitlab.ai/mcp`)               | OAuth sign-in, no API key | You, limited by your role and the connection's permissions |

Use the SDK or CLI for repeatable jobs. Use MCP when a person works through an AI assistant. See [Unitlab MCP](https://docs.unitlab.ai/api-sdk-cli/mcp/overview.md) for the assistant setup.

## Key concepts

| Term                              | Meaning in code                                                                                                          |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **Workspace**                     | The organization an API key belongs to. A key never reaches another workspace.                                           |
| **Project**                       | Where data is labeled. `client.projects`                                                                                 |
| **Batch Queue**                   | One upload or import into a project. Server processing is tracked per Batch Queue. `project.batch_queue(id)`             |
| **Data Unit**                     | One work item in a project: a single file (`kind="datasource"`) or a Data Group (`kind="group"`). `project.data_units()` |
| **Asset** and **Folder**          | Files in the workspace library (the **Assets** page). `client.assets`                                                    |
| **Dataset** and **version**       | A curated set of Assets. You publish immutable versions and attach them to projects. `client.datasets`                   |
| **Data Group**                    | Several related files (cameras, sensors, documents) labeled as one item.                                                 |
| **Ontology**                      | Classes, properties and classifications. `client.ontologies`                                                             |
| **Workflow**, **Stage**, **Task** | The project's labeling pipeline. Each item moves through stages as a task. `project.workflow`                            |
| **Release**                       | An exported, versioned snapshot of labels in a chosen format. `client.releases`                                          |
| **Embedding space**               | Your own vectors for similarity search. `client.embedding_spaces`                                                        |

## How the SDK is organized

```python
from unitlab import UnitlabClient

client = UnitlabClient()          # reads UNITLAB_API_KEY
client.projects                   # Projects, uploads, Batch Queues, workflow, imports
client.assets                     # Library folders and files, Data Groups
client.datasets                   # Datasets and published versions
client.ontologies                 # Workspace ontologies
client.releases                   # Exports and downloads
client.cloud_storages             # Saved S3, GCS, Azure and S3-compatible connections
client.embedding_spaces           # Custom vectors and search
```

Each namespace returns typed handles, such as `Project` or `Release`, with methods for the next step. Every handle keeps the server's full response in `.raw`. See [UnitlabClient and resource namespaces](https://docs.unitlab.ai/api-sdk-cli/sdks/unitlabclient-and-resource-namespaces.md).

## Asynchronous work

Uploads, imports, releases and tiled files are processed on the server after your request returns.

| Operation                                        | You get back             | Wait with                                    |
| ------------------------------------------------ | ------------------------ | -------------------------------------------- |
| Upload or cloud import                           | Batch Queue ID           | `batch.wait()` or `unitlab batch-queue wait` |
| Library upload of large rasters, slides or lidar | Asset ID                 | `asset.wait()`                               |
| Release                                          | Release ID               | `release.wait()` or `unitlab release wait`   |
| Annotation import                                | Import ID with a preview | `batch.refresh()`, then `batch.commit()`     |

A finished wait can still report failed items. Always check the `failed` count.

## Related

[Install the SDK and CLI](https://docs.unitlab.ai/api-sdk-cli/get-started/install-the-python-sdk-and-cli.md) · [Authentication and API keys](https://docs.unitlab.ai/api-sdk-cli/get-started/authentication-and-api-keys.md) · [Upload, label and export](https://docs.unitlab.ai/api-sdk-cli/get-started/upload-label-and-export.md)
