> 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/apis/api-overview.md). Agents can also search and read this documentation through its [MCP server](https://docs.unitlab.ai/~gitbook/mcp).

# API overview

Base URL, authentication, request and response conventions of the Unitlab HTTP API, and an index of its routes.

The HTTP API is what the Python SDK and CLI use. Call it directly from any language when Python is not an option. For Python, prefer the SDK: it handles uploads in parts, waiting and retries.

|                |                                                                             |
| -------------- | --------------------------------------------------------------------------- |
| Base URL       | `https://api.unitlab.ai/api/sdk/` (a dedicated deployment has its own host) |
| Authentication | `Authorization: Api-Key YOUR_API_KEY`                                       |
| Format         | JSON request and response bodies; uploads use `multipart/form-data`         |
| IDs            | UUIDs                                                                       |
| Trailing slash | Required on every route                                                     |
| Rate limit     | 20,000 requests per hour per key                                            |

```bash
export UNITLAB_API_KEY="YOUR_API_KEY"
curl -s https://api.unitlab.ai/api/sdk/projects/ \
  -H "Authorization: Api-Key $UNITLAB_API_KEY"
```

## Conventions

| Topic               | Rule                                                                                                                                         |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Lists               | Most lists are paged with `limit` and `offset` (default 50, maximum 300). Projects, releases and attached sources return a plain array.      |
| Errors              | JSON with `detail`, and `code` where a client must tell cases apart. Validation errors list fields: `{"name": ["This field is required."]}`. |
| Background work     | Uploads, cloud imports, attaches and releases answer at once. Poll their status route.                                                       |
| Request ID          | Every response has `X-Request-ID`. Log it; the audit log can be filtered by it.                                                              |
| Read-only workspace | Writes answer 403 with `code` `workspace_read_only`, `workspace_payment_past_due` or `workspace_license_required`                            |

Details: [Errors, rate limits and pagination](https://docs.unitlab.ai/api-sdk-cli/apis/errors-rate-limits-and-pagination.md).

## Routes

| Area                     | Routes under `/api/sdk/`                                                                                            | Page                                                                                                           |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| Projects                 | `projects/`, `projects/{id}/`                                                                                       | [Projects](https://docs.unitlab.ai/api-sdk-cli/apis/projects-api.md)                                           |
| Uploads and Batch Queues | `projects/{id}/upload-data/`, `upload-sessions/`, `data-units/`, `attach-data/`, `attached-sources/`                | [Project data and Batch Queues](https://docs.unitlab.ai/api-sdk-cli/apis/project-data-and-batch-queues-api.md) |
| Library                  | `data-assets/upload/`, `data-assets/assets/`, `data-assets/folders/`                                                | [Assets and folders](https://docs.unitlab.ai/api-sdk-cli/apis/assets-and-folders-api.md)                       |
| Cloud storage            | `cloud-storages/`, `projects/{id}/cloud-storages/{storage}/import/`                                                 | [Cloud storage](https://docs.unitlab.ai/api-sdk-cli/apis/cloud-storage-api.md)                                 |
| Datasets                 | `datasets/`                                                                                                         | [Datasets](https://docs.unitlab.ai/api-sdk-cli/apis/datasets-api.md)                                           |
| Ontologies               | `ontologies/`                                                                                                       | [Ontologies](https://docs.unitlab.ai/api-sdk-cli/apis/ontologies-api.md)                                       |
| Workflow and labels      | `projects/{id}/workflow/`, `workflow-tasks/{id}/`, `projects/{id}/annotation-imports/`, `projects/{id}/benchmarks/` | [Annotations and workflow](https://docs.unitlab.ai/api-sdk-cli/apis/annotations-and-workflow-api.md)           |
| Releases                 | `projects/{id}/releases/`, `releases/`                                                                              | [Releases](https://docs.unitlab.ai/api-sdk-cli/apis/releases-api.md)                                           |
| Embeddings               | `embedding-spaces/`                                                                                                 | [Embeddings](https://docs.unitlab.ai/api-sdk-cli/apis/embedding-spaces-api.md)                                 |

Each route needs a key permission; see [Authentication and API keys](https://docs.unitlab.ai/api-sdk-cli/get-started/authentication-and-api-keys.md).

## Stability

There is one live version with no version prefix. Routes and fields are added without breaking existing clients. Ignore fields you do not know. See [Versioning and changelog](https://docs.unitlab.ai/api-sdk-cli/get-started/versioning-and-changelog.md).

## Related

[API authentication](https://docs.unitlab.ai/api-sdk-cli/apis/api-authentication.md) · [Annotation JSON reference](https://docs.unitlab.ai/api-sdk-cli/apis/annotation-json-reference.md) · [Python SDK quickstart](https://docs.unitlab.ai/api-sdk-cli/get-started/python-sdk-quickstart.md)
