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

# Training Status

> Check the progress of a training run and get the request that runs your trained LoRA.

Returns the status of a training run. Poll it every minute or two. After the run completes, keep polling until `data.inference.status` is `ready`; the response then contains the exact request to generate with your LoRA.

## Request

Make a `POST` request to the endpoint below, with the training `id` from [Start Training](https://docs.modelslab.com/image-generation/train-model/start-training.md) in the path.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
POST https://modelslab.com/api/v6/trainer/status/{training_id}
```

### Body

```json json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "key": "your_api_key"
}
```

## Status values

| `message` / `data.status` | Meaning |
| :- | :- |
| `training_started` | Queued or training. |
| `training_completed` | Training finished, or you stopped the run. |
| `training_cancelled` | Training failed. `data.response_dump` holds the reason. |

## Response

### While training

```json json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "status": "success",
    "message": "training_started",
    "data": {
        "id": "9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
        "status": "training_started",
        "request_dump": {
            "trainer_id": "flux_lora_trainer",
            "trigger_word": "pinkpanda",
            "hf_username": "your_hf_username",
            "training_steps": 750
        },
        "response_dump": {
            "status": "queued"
        },
        "model_link": null,
        "inference": null
    },
    "id": "9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
    "fetch_result": "https://modelslab.com/api/v6/trainer/status/9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b"
}
```

### Completed and ready to generate

```json json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    "status": "success",
    "message": "training_completed",
    "data": {
        "id": "9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
        "status": "training_completed",
        "request_dump": {
            "trainer_id": "flux_lora_trainer",
            "trigger_word": "pinkpanda",
            "hf_username": "your_hf_username",
            "training_steps": 750
        },
        "response_dump": {
            "status": "training_completed"
        },
        "model_link": "https://huggingface.co/your_hf_username/9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
        "inference": {
            "status": "ready",
            "message": "Your model is ready. Use the trigger word in your prompt.",
            "model_id": "tm-3f9a1c2b7d4e5f6a8b9c0d1e",
            "base_model_id": "fluxdev",
            "trigger_word": "pinkpanda",
            "playground_url": "https://modelslab.com/models/modelslab/fluxdev?model_id=fluxdev&lora_model=tm-3f9a1c2b7d4e5f6a8b9c0d1e",
            "api": {
                "url": "https://modelslab.com/api/v6/images/text2img",
                "body": {
                    "key": "YOUR_API_KEY",
                    "model_id": "fluxdev",
                    "lora_model": "tm-3f9a1c2b7d4e5f6a8b9c0d1e",
                    "lora_strength": 1,
                    "prompt": "pinkpanda, a portrait photo",
                    "width": 1024,
                    "height": 1024,
                    "samples": 1
                }
            }
        }
    },
    "id": "9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b",
    "fetch_result": "https://modelslab.com/api/v6/trainer/status/9b2f6c1e-4d3a-4f8e-a1b2-3c4d5e6f7a8b"
}
```

> [!NOTE]
>
> `data.inference` is `null` until training completes. For FLUX.2 Klein 9B, FLUX.3 Klein and MOSS Image runs it reports `failed` with `This training cannot be prepared for inference.`, because those LoRAs are not loaded on ModelsLab. Download them from your Hugging Face repo instead.


## OpenAPI

````yaml image-generation/train-model/openapi.json POST /status/{training_id}
openapi: 3.1.0
info:
  title: ModelsLab Train Model API
  description: >-
    Train your own LoRA on Flux, FLUX.2 Klein 9B, FLUX.3 Klein, Z-Image Turbo,
    Stable Diffusion (SDXL / SD 1.5) and MOSS Image, then check its progress or
    stop it.
  license:
    name: MIT
  version: 6.0.0
servers:
  - url: https://modelslab.com/api/v6/trainer
    description: LoRA training endpoints
security: []
paths:
  /status/{training_id}:
    post:
      summary: Training Status
      description: >-
        Returns the current status of a training run. Once the run completes,
        `data.inference` tells you when the LoRA is ready to generate with and
        gives the exact API call to use.
      parameters:
        - name: training_id
          in: path
          required: true
          description: The `id` returned by the Start Training endpoint.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KeyRequest'
      responses:
        '200':
          description: Current state of the training run.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/StatusResponse'
                  - $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/StandardErrorResponse'
        '404':
          $ref: '#/components/responses/StandardErrorResponse'
components:
  schemas:
    KeyRequest:
      type: object
      required:
        - key
      properties:
        key:
          $ref: '#/components/schemas/Key'
    StatusResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
        message:
          $ref: '#/components/schemas/TrainingStatus'
        data:
          type: object
          properties:
            id:
              type: string
              format: uuid
            status:
              $ref: '#/components/schemas/TrainingStatus'
            request_dump:
              type: object
              additionalProperties: true
              description: The fields you sent, without your Hugging Face token.
            response_dump:
              oneOf:
                - type: object
                  additionalProperties: true
                - type: 'null'
              description: >-
                The trainer's last report, including the error if the run
                failed.
            model_link:
              oneOf:
                - type: string
                  format: uri
                - type: 'null'
              description: Where the trainer uploaded the LoRA.
            inference:
              oneOf:
                - $ref: '#/components/schemas/Inference'
                - type: 'null'
        id:
          type: string
          format: uuid
        fetch_result:
          type: string
          format: uri
    ErrorResponse:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
    Key:
      type: string
      description: Your API key. Get one from https://modelslab.com/dashboard/api-keys.
    TrainingStatus:
      type: string
      enum:
        - training_started
        - training_completed
        - training_cancelled
      description: >-
        `training_started`: queued or training. `training_completed`: finished
        or stopped. `training_cancelled`: failed.
    Inference:
      type: object
      description: >-
        Present once training completes, for Flux LoRA, Z-Image Turbo and Stable
        Diffusion runs. `null` while training.
      properties:
        status:
          type: string
          enum:
            - preparing
            - ready
            - failed
        message:
          type: string
        model_id:
          type: string
          description: Pass this as `lora_model` when you generate.
        base_model_id:
          type: string
          description: Pass this as `model_id` when you generate.
        trigger_word:
          type: string
        playground_url:
          type: string
          format: uri
        api:
          type: object
          properties:
            url:
              type: string
              format: uri
            body:
              type: object
              additionalProperties: true
  responses:
    StandardErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.