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

# LTX 2 19B

> Lightricks video generation API for text-to-video, image-to-video, and LoRA workflows

## Overview

LTX 2 19B is a Lightricks video generation model for text-to-video and image-to-video workflows. It also supports LoRA-conditioned variants when you need custom styles, characters, or structural guidance.

Use this page when you are ready to call the API after trying the model in the APIXO playground.

| Capability       | Value                                                                          |
| ---------------- | ------------------------------------------------------------------------------ |
| Model ID         | `ltx-2-19b`                                                                    |
| Modes            | `text-to-video`, `image-to-video`, `text-to-video-LoRA`, `image-to-video-LoRA` |
| Prompt length    | 1-5000 characters                                                              |
| Reference images | Exactly 1 URL for `image-to-video` and `image-to-video-LoRA`                   |
| Aspect ratios    | `16:9`, `9:16` for text-to-video modes                                         |
| Resolution tiers | `480p`, `720p`, `1080p`                                                        |
| Duration         | 5-20 seconds                                                                   |
| LoRA controls    | Up to 3 LoRA items, each with `path` and `scale`                               |
| Seed             | `-1`, or `1` through `2147483647`                                              |

## Endpoint and authentication

Base URL:

```text theme={null}
https://api.apixo.ai/api/v1
```

| Method | Endpoint                                | Purpose                               |
| ------ | --------------------------------------- | ------------------------------------- |
| `POST` | `/generateTask/ltx-2-19b`               | Submit a generation task              |
| `GET`  | `/statusTask/ltx-2-19b?taskId={taskId}` | Poll task status and retrieve results |

All requests require your APIXO API key:

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

Submit requests also require:

```http theme={null}
Content-Type: application/json
```

## Copy-paste async quickstart

This minimal request submits a text-to-video task and returns a `taskId`.

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/ltx-2-19b" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a cinematic shot of a small robot walking through a rainy neon street",
      "resolution": "720p",
      "duration": 10,
      "aspect_ratio": "16:9"
    }
  }'
```

Successful response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
```

Save the `taskId`; you need it to poll for the final result.

## Poll for result

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/ltx-2-19b?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Processing response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
```

Success response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
```

Failed response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "SensitiveContent",
    "failMsg": "Content violates provider policy, please adjust the prompt",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
```

Parse `resultJson` after `state` becomes `success`:

```javascript theme={null}
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;
```

## Request body

### Text-to-video

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a futuristic city with flying cars at sunset",
    "resolution": "1080p",
    "duration": 10,
    "aspect_ratio": "16:9",
    "seed": 54248617
  }
}
```

### Image-to-video

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "prompt": "make the scene cinematic with a slow camera push and soft motion",
    "image_urls": [
      "https://example.com/source.jpg"
    ],
    "resolution": "720p",
    "duration": 8
  }
}
```

### Image-to-video with LoRA

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-video-LoRA",
    "prompt": "animate this character in a stylized studio lighting setup",
    "image_urls": [
      "https://example.com/source.jpg"
    ],
    "resolution": "720p",
    "duration": 8,
    "loras": [
      {
        "path": "https://huggingface.co/username/model.safetensors?download=true",
        "scale": 1.2
      }
    ]
  }
}
```

## Parameters

<ParamField body="request_type" type="string" required default="async">
  Result delivery mode. Use `async` for polling with `statusTask`, or `callback` for webhook delivery.
</ParamField>

<ParamField body="callback_url" type="string">
  Required when `request_type` is `callback`. Must be a public HTTPS endpoint that can receive the final task payload. See [Webhooks](/docs/api-reference/webhooks).
</ParamField>

<ParamField body="input" type="object" required>
  LTX 2 19B input parameters.

  <Expandable title="properties">
    <ParamField body="mode" type="string" required>
      Generation mode. Supported values: `text-to-video`, `image-to-video`, `text-to-video-LoRA`, `image-to-video-LoRA`.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Text prompt describing the desired video. Must be non-empty and no longer than 5000 characters.
    </ParamField>

    <ParamField body="resolution" type="string" required>
      Output resolution tier. Supported values: `480p`, `720p`, `1080p`.
    </ParamField>

    <ParamField body="duration" type="integer" required>
      Video duration in seconds. Must be a JSON integer from `5` through `20`.
    </ParamField>

    <ParamField body="image_urls" type="string[]">
      Required for `image-to-video` and `image-to-video-LoRA`. Provide exactly 1 public, directly accessible image URL.
    </ParamField>

    <ParamField body="aspect_ratio" type="string" default="16:9">
      Applies to text-to-video modes only. Supported values: `16:9`, `9:16`. If omitted for text-to-video, the backend sends `16:9`.
    </ParamField>

    <ParamField body="seed" type="integer">
      Optional seed. Use `-1` to let the provider choose a random seed, or send an integer from `1` through `2147483647`.
    </ParamField>

    <ParamField body="loras" type="array">
      Optional LoRA array, intended for LoRA modes. Supports up to 3 items.

      <Expandable title="item properties">
        <ParamField body="path" type="string" required>
          Publicly downloadable LoRA model URL. The value must be a non-empty string.
        </ParamField>

        <ParamField body="scale" type="number" required>
          LoRA strength. Must be a number from `0.0` through `4.0`.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Response format

### Submit task response

`POST /generateTask/ltx-2-19b` returns a task ID when the task is accepted:

<ResponseField name="code" type="integer">
  API status code. `200` means the task was accepted.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable status message.
</ResponseField>

<ResponseField name="data.taskId" type="string">
  Unique task identifier used with the status endpoint.
</ResponseField>

### Status response fields

<ResponseField name="taskId" type="string">
  Unique task identifier.
</ResponseField>

<ResponseField name="state" type="string">
  Current task state: `pending`, `processing`, `success`, or `failed`.
</ResponseField>

<ResponseField name="resultJson" type="string">
  JSON string containing the generated video URLs in `resultUrls`. Present when `state` is `success`.
</ResponseField>

<ResponseField name="failCode" type="string">
  Machine-readable failure code. Present when `state` is `failed`.
</ResponseField>

<ResponseField name="failMsg" type="string">
  Human-readable failure message. Present when `state` is `failed`.
</ResponseField>

<ResponseField name="createTime" type="integer">
  Task creation timestamp in Unix milliseconds.
</ResponseField>

<ResponseField name="completeTime" type="integer">
  Task completion timestamp in Unix milliseconds. Present after completion.
</ResponseField>

<ResponseField name="costTime" type="integer">
  Processing duration in milliseconds when available. Present after completion.
</ResponseField>

## Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/ltx-2-19b" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "text-to-video",
      "prompt": "a clean product reveal video with a slow camera push-in",
      "resolution": "720p",
      "duration": 10,
      "aspect_ratio": "16:9"
    }
  }'
```

The callback `data` object uses the same terminal fields as the status response. See [Webhooks](/docs/api-reference/webhooks) for delivery requirements and retry behavior.

## Billing

LTX 2 19B is billed per second. The backend selects the unit price by `resolution` and base vs LoRA mode, then multiplies that unit price by the submitted `duration`.

| Resolution | Base modes price  | LoRA modes price  | Minimum 5s cost             |
| ---------- | ----------------- | ----------------- | --------------------------- |
| `480p`     | `$0.012 / second` | `$0.015 / second` | Base `$0.06`; LoRA `$0.075` |
| `720p`     | `$0.016 / second` | `$0.02 / second`  | Base `$0.08`; LoRA `$0.10`  |
| `1080p`    | `$0.024 / second` | `$0.03 / second`  | Base `$0.12`; LoRA `$0.15`  |

Formula:

```text theme={null}
total cost = duration * selected per-second unit price
```

For current route and market comparison pricing, see [Pricing](https://apixo.ai/pricing).

## Latency and polling

Actual latency may vary by prompt complexity, duration, resolution, LoRA loading, provider queue load, and storage transfer time.

| Workload   | Typical generation time | Recommended first poll               | Poll interval |
| ---------- | ----------------------- | ------------------------------------ | ------------- |
| `480p`     | 40s-60s                 | 40s after task creation              | 5s            |
| `720p`     | 60s-90s                 | 60s after task creation              | 5s            |
| `1080p`    | 90s-120s                | 90s after task creation              | 5s            |
| LoRA modes | Add about 10s-20s       | Add about 10s to the base first poll | 5s            |

<Tip>
  For production video workloads, use callback mode to avoid frequent polling while generation is still running.
</Tip>

Result URLs are normally stored for 15 days. Download and store important outputs promptly.

For image-to-video modes, provide exactly one source image. Public image URLs should be directly accessible by APIXO; JPG, PNG, or WebP files are the safest choice.

For LoRA workflows, use public downloadable model URLs such as Hugging Face or Civitai download links. Each LoRA item must include both `path` and `scale`, even if you want a neutral scale like `1.0`.

Rate limits and concurrency can vary by account, API key, and route. If you receive `429`, slow down requests and retry with backoff. For account-level details, see [System APIs](/docs/api-reference/system).

## Errors and troubleshooting

### HTTP errors

| Code  | Meaning                                                                                                                                                                     | What to do                                       |
| ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| `400` | Invalid request body, missing `input`, missing `mode`, missing `prompt`, invalid `resolution`, invalid `duration`, invalid `seed`, invalid `image_urls`, or invalid `loras` | Fix the request before retrying                  |
| `401` | Missing or invalid API key                                                                                                                                                  | Check the `Authorization` header                 |
| `402` | Insufficient balance or quota                                                                                                                                               | Add balance or switch account/key                |
| `403` | Key or route cannot access the model                                                                                                                                        | Check permissions and route strategy             |
| `404` | Task not found when polling                                                                                                                                                 | Check the `taskId` and model endpoint            |
| `429` | Rate limit or concurrency limit reached                                                                                                                                     | Retry with exponential backoff                   |
| `500` | Server error or unknown upstream failure                                                                                                                                    | Retry with backoff                               |
| `502` | Upstream provider or network error                                                                                                                                          | Retry with backoff                               |
| `503` | Service temporarily unavailable or async queue is full                                                                                                                      | Retry later                                      |
| `504` | Upstream timeout                                                                                                                                                            | Retry or use callback mode for long-running jobs |

### Validation notes

| Parameter             | Backend behavior                                                                                                     |
| --------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `input.mode`          | Required for routing. Must be one of `text-to-video`, `image-to-video`, `text-to-video-LoRA`, `image-to-video-LoRA`. |
| `input.prompt`        | Required string. Must not be empty and cannot exceed 5000 characters.                                                |
| `input.resolution`    | Required string. Must be `480p`, `720p`, or `1080p`.                                                                 |
| `input.duration`      | Required JSON integer. Must be from `5` through `20`; quoted strings are not valid.                                  |
| `input.image_urls`    | Required for image-to-video modes. Must be an array with exactly 1 string URL.                                       |
| `input.aspect_ratio`  | Optional for text-to-video modes. Must be `16:9` or `9:16`; defaults to `16:9` when omitted.                         |
| `input.seed`          | Optional JSON integer. Must be `-1`, or from `1` through `2147483647`.                                               |
| `input.loras`         | Optional array. If present, it cannot contain more than 3 items.                                                     |
| `input.loras[].path`  | Required for each LoRA item. Must be a non-empty string.                                                             |
| `input.loras[].scale` | Required for each LoRA item. Must be numeric and from `0.0` through `4.0`.                                           |

### Task failure codes

| Fail code                                                  | Meaning                                                      | What to do                                                 |
| ---------------------------------------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------- |
| `SensitiveContent` / `InputOutputSensitiveContentDetected` | Prompt, input image, or output failed provider safety checks | Change the prompt or input image                           |
| `PromptInvalid`                                            | Prompt was rejected or malformed                             | Adjust the prompt and retry                                |
| `ImageFormatIncorrect` / `InvalidImageSize`                | Input image failed upstream image validation                 | Use a public, direct JPG, PNG, or WebP URL                 |
| `ImageNotAccess`                                           | APIXO could not fetch an input URL                           | Use a public HTTP or HTTPS URL that returns `200` or `206` |
| `RateLimited`                                              | Provider-side rate limit                                     | Retry with exponential backoff                             |
| `Timeout`                                                  | Provider-side timeout                                        | Retry, simplify the request, or use callback mode          |
| `Unknown error`                                            | Provider returned an unmapped failure                        | Retry with backoff or contact support with the `taskId`    |

See [Error Codes](/docs/api-reference/errors) for the full error reference.

## Related links

* [Generation API Overview](/docs/models)
* [Generate Task](/docs/api-reference/generate-task)
* [Status Task](/docs/api-reference/status-task)
* [Webhooks](/docs/api-reference/webhooks)
* [Error Codes](/docs/api-reference/errors)
* [Parameter Specification](/docs/api-reference/parameters)
* [Routing Strategies](/docs/concepts/routing-strategies)
* [Pricing](https://apixo.ai/pricing)
