> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runcomfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

## What is the Trainer API?

The **Trainer API** lets you:

* Create and upload **training datasets**
* Submit **AI Toolkit LoRA training jobs**
* Poll **status/results** and download training artifacts (checkpoints, config yaml, samples)

***

## Base URL

`https://trainer-api.runcomfy.net`

***

## Authentication

All requests require a Bearer token:

`Authorization: Bearer <token>`

Get your token from your [Profile](https://www.runcomfy.com/profile) page.

***

## Minimum working flow

1. **Create a dataset** (metadata)
2. **Upload dataset files** (direct upload for small files, or signed URLs for large files)
3. **Wait until the dataset becomes `READY`**
4. **Submit a training job** with your AI Toolkit YAML config
5. Poll `status` and fetch `result` artifacts

***

## Example

### 1) Create a dataset

```bash theme={null}
curl --request POST \
  --url "https://trainer-api.runcomfy.net/prod/v1/trainers/datasets" \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer <token>" \
  --data '{
    "name": "<YOUR_DATASET_NAME>"
  }'
```

Save the returned `dataset_id` (you’ll use it in upload and status calls).

### 2) Upload files

For small dataset files (≤150MB), upload directly:

```bash theme={null}
curl --request POST \
  --url "https://trainer-api.runcomfy.net/prod/v1/trainers/datasets/{dataset_id}/upload" \
  --header "Authorization: Bearer <token>" \
  --form "file=@./dog_01.jpg"
```

For larger uploads, request signed upload URLs and `PUT` the bytes to object storage. See **[Get signed upload URLs](/trainer-apis/async-queue-endpoints-datasets)**.

### 3) Wait until the dataset is READY

```bash theme={null}
curl --request GET \
  --url "https://trainer-api.runcomfy.net/prod/v1/trainers/datasets/{dataset_id}/status" \
  --header "Authorization: Bearer <token>"
```

Typical dataset lifecycle:

`DRAFT` → `UPLOADING` → `READY` (or `FAILED`)

### 4) Submit a training job

```bash theme={null}
curl --request POST \
  --url "https://trainer-api.runcomfy.net/prod/v1/trainers/ai-toolkit/jobs" \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer <token>" \
  --data '{
    "config_file_format": "yaml",
    "config_file": "<YOUR_AI_TOOLKIT_YAML_AS_A_JSON_STRING>",
    "gpu_type": "ADA_80_PLUS"
  }'
```

Because `config_file` is a multiline YAML file, you’ll usually want to JSON-escape it with `jq` and pipe to `curl`. See **[Submit a training job](/trainer-apis/async-queue-endpoints-training-jobs#submit-a-training-job)**.

### 6) Poll status and fetch results

```bash theme={null}
curl --request GET \
  --url "https://trainer-api.runcomfy.net/prod/v1/trainers/ai-toolkit/jobs/{job_id}/status" \
  --header "Authorization: Bearer <token>"

curl --request GET \
  --url "https://trainer-api.runcomfy.net/prod/v1/trainers/ai-toolkit/jobs/{job_id}/result" \
  --header "Authorization: Bearer <token>"
```
