> ## 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.

# Kling 2.5 Turbo Pro

> Fast high-quality video generation with text-to-video, image-to-video, and tail-frame control

## Overview

Kling 2.5 Turbo Pro is a Kuaishou video model for fast text-to-video and image-to-video generation. Use this page when you are ready to call the API after trying the model in the APIXO playground.

| Capability         | Value                                                   |
| ------------------ | ------------------------------------------------------- |
| Model ID           | `kling-2-5-turbo-pro`                                   |
| Modes              | `text-to-video`, `image-to-video`                       |
| Prompt length      | 1-2500 characters                                       |
| Duration           | `5` or `10` seconds                                     |
| Reference images   | 1-2 URLs for `image-to-video`                           |
| Tail-frame control | The second `image_urls` item is used as the final frame |
| Aspect ratios      | `16:9`, `9:16`, `1:1` for `text-to-video`               |
| Negative prompt    | Up to 2500 characters                                   |
| CFG scale          | `0` to `1`, step `0.1`                                  |
| Output             | MP4 video URLs in `resultJson.resultUrls`               |

## Endpoint and authentication

Base URL:

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

| Method | Endpoint                                          | Purpose                               |
| ------ | ------------------------------------------------- | ------------------------------------- |
| `POST` | `/generateTask/kling-2-5-turbo-pro`               | Submit a generation task              |
| `GET`  | `/statusTask/kling-2-5-turbo-pro?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/kling-2-5-turbo-pro" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a cinematic drone shot over snowy mountains at sunrise",
      "duration": 5,
      "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/kling-2-5-turbo-pro?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/xxx.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 the upstream content 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 cinematic drone shot over snowy mountains at sunrise",
    "duration": 10,
    "aspect_ratio": "16:9",
    "negative_prompt": "low quality, jitter, blur",
    "cfg_scale": 0.6
  }
}
```

### Image-to-video

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "prompt": "smooth camera transition from the first frame to the final frame",
    "duration": 5,
    "image_urls": [
      "https://example.com/start.jpg",
      "https://example.com/end.jpg"
    ],
    "negative_prompt": "distortion, low quality",
    "cfg_scale": 0.4
  }
}
```

## 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 URL that can receive the final task payload. See [Webhooks](/api-reference/webhooks).
</ParamField>

<ParamField body="input" type="object" required>
  Kling 2.5 Turbo Pro input parameters.

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

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

    <ParamField body="duration" type="integer | string" required>
      Output duration in seconds. Supported values: `5`, `10`. Numeric strings such as `"5"` are also accepted.
    </ParamField>

    <ParamField body="image_urls" type="string[]">
      Required for `image-to-video`. Supports 1-2 public image URLs. The first image is the start frame; the second image, when provided, is the tail frame.
    </ParamField>

    <ParamField body="aspect_ratio" type="string" default="16:9">
      Output aspect ratio for `text-to-video`. Supported values: `16:9`, `9:16`, `1:1`. This field is not forwarded for `image-to-video`.
    </ParamField>

    <ParamField body="negative_prompt" type="string">
      Negative prompt describing content to avoid. Supports up to 2500 characters. Blank values are ignored.
    </ParamField>

    <ParamField body="cfg_scale" type="number | string">
      Prompt guidance scale. Supported values are `0` through `1` in `0.1` steps, for example `0`, `0.4`, `0.7`, or `1`. Numeric strings are accepted.
    </ParamField>
  </Expandable>
</ParamField>

## Response format

### Submit task response

`POST /generateTask/kling-2-5-turbo-pro` 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 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. Present after successful completion when available.
</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/kling-2-5-turbo-pro" \
  -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": "image-to-video",
      "prompt": "make the subject turn toward camera with smooth natural motion",
      "duration": 5,
      "image_urls": [
        "https://example.com/start.jpg"
      ],
      "cfg_scale": 0.5
    }
  }'
```

Webhook delivery uses the same final task payload shape as the status response. See [Webhooks](/api-reference/webhooks) for delivery requirements and retry behavior.

## Billing

Kling 2.5 Turbo Pro is billed by video duration. The public APIXO pricing page lists this model with a starting APIXO price of `$0.06 / second`.

| Duration     | Starting APIXO price |
| ------------ | -------------------- |
| `5` seconds  | `$0.30 / video`      |
| `10` seconds | `$0.60 / video`      |

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

## Latency and polling

Actual latency may vary by prompt complexity, input images, selected route, and current queue load.

| Duration     | Typical generation time | Recommended first poll  | Poll interval |
| ------------ | ----------------------- | ----------------------- | ------------- |
| `5` seconds  | 30s-45s                 | 30s after task creation | 5s-10s        |
| `10` seconds | 45s-60s                 | 30s after task creation | 5s-10s        |

<Tip>
  For production video workloads, use callback mode to avoid frequent polling. Download and store important output URLs promptly after completion.
</Tip>

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](/api-reference/system).

## Errors and troubleshooting

### HTTP errors

| Code  | Meaning                                                         | What to do                                       |
| ----- | --------------------------------------------------------------- | ------------------------------------------------ |
| `400` | Invalid request body, mode, parameter value, or image URL shape | 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, or content was rejected   | Check permissions and adjust input               |
| `404` | Task ID or route not found                                      | Check the model endpoint and `taskId`            |
| `429` | Rate limit or concurrency limit reached                         | Retry with exponential backoff                   |
| `500` | Server or upstream error                                        | Retry with backoff                               |
| `503` | Service temporarily unavailable                                 | Retry with backoff                               |
| `504` | Upstream timeout                                                | Retry or use callback mode for long-running jobs |

### Parameter validation

| Field                   | Rule                                                                          |
| ----------------------- | ----------------------------------------------------------------------------- |
| `input.mode`            | Required. Must be `text-to-video` or `image-to-video`.                        |
| `input.prompt`          | Required string, non-empty after trimming, max 2500 characters.               |
| `input.duration`        | Required. Must be `5` or `10`; integer and numeric string are accepted.       |
| `input.image_urls`      | Required for `image-to-video`; must be an array of 1-2 strings.               |
| `input.aspect_ratio`    | Optional for `text-to-video`; must be `16:9`, `9:16`, or `1:1` when provided. |
| `input.negative_prompt` | Optional string, max 2500 characters.                                         |
| `input.cfg_scale`       | Optional number or numeric string from `0` to `1`, step `0.1`.                |

### Task failure codes

| Fail code              | Meaning                                                                       | What to do                                           |
| ---------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------- |
| `SensitiveContent`     | Prompt, input image, or generated output violated the upstream content policy | Change the prompt or image                           |
| `PromptInvalid`        | Prompt was rejected or malformed                                              | Rewrite the prompt with clearer safe content         |
| `PromptLengthExceeded` | Prompt exceeded model limits                                                  | Shorten the prompt                                   |
| `ImageFormatIncorrect` | Input image format could not be processed                                     | Use a public JPG, PNG, or WebP URL                   |
| `Upload error`         | Image upload failed or exceeded size limits                                   | Compress the image and retry with a direct URL       |
| `RateLimited`          | The upstream route rate limited the task                                      | Retry later with backoff                             |
| `Timeout`              | The upstream route did not finish in time                                     | Retry, reduce input complexity, or use callback mode |
| `Unknown error`        | The upstream route returned an unmapped failure                               | Retry with backoff; contact support if it persists   |

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

## Related links

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