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

# kling-3.0-turbo

> Kling upgraded APIs for Kling 3.0 Turbo text-to-video and image-to-video generation.

Kling 3.0 Turbo uses Kling's upgraded model-specific API. The model name is part of the endpoint path; do not send `model_name` in the request body.

<Tabs>
  <Tab title="Text to Video">
    ## Create task

    `POST /kling/v2/text-to-video/kling-3.0-turbo`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/kling/v2/text-to-video/kling-3.0-turbo \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "prompt": "A girl sits on a train and looks out the window as the carriage gently sways",
          "settings": {
            "resolution": "1080p",
            "aspect_ratio": "16:9",
            "duration": 5
          },
          "options": {
            "watermark_info": {
              "enabled": false
            }
          }
        }'
      ```

      ```json 200 theme={null}
      {
        "code": 0,
        "message": "string",
        "request_id": "string",
        "data": {
          "id": "893605946402811985",
          "status": "submitted",
          "create_time": 1781080778802,
          "update_time": 1781080794151,
          "external_id": ""
        }
      }
      ```
    </div>

    ## Request headers

    <ParamField header="Authorization" type="string" required>Bearer authentication in the form `Bearer YOUR_API_KEY`.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Data exchange format.</ParamField>

    ## Request body

    <ParamField body="prompt" type="string" required>
      Positive and negative text descriptions. The maximum length is 3,072 characters; prompts under 2,500 characters are recommended.
    </ParamField>

    <ParamField body="settings" type="object">
      Output resolution, aspect ratio, and duration.
    </ParamField>

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

    <ParamField body="settings.aspect_ratio" type="string" default="16:9">
      Output aspect ratio. Supported values: `16:9`, `9:16`, `1:1`.
    </ParamField>

    <ParamField body="settings.duration" type="integer" default={5}>
      Video duration in seconds. Supported integer values: 3 through 15.
    </ParamField>

    <ParamField body="options" type="object">
      General generation options.
    </ParamField>

    <ParamField body="options.watermark_info" type="object">
      Platform watermark configuration.
    </ParamField>

    <ParamField body="options.watermark_info.enabled" type="boolean" default={false}>
      Set to `true` to generate an additional watermarked result.
    </ParamField>

    ### Multi-shot prompt format

    A prompt can define one to six shots with the format `Shot n, m, words;`. `n` is the shot number, `m` is the shot duration in seconds, and `words` is the shot description. Each shot must last at least one second, the durations must add up to `settings.duration`, and each shot description can contain up to 512 characters.

    ## Create response

    <ResponseField name="code" type="integer">Error code. `0` indicates that the request was accepted.</ResponseField>
    <ResponseField name="message" type="string">Error or status message.</ResponseField>
    <ResponseField name="request_id" type="string">System-generated request ID for tracing and troubleshooting.</ResponseField>
    <ResponseField name="data" type="object">Created asynchronous task.</ResponseField>
    <ResponseField name="data.id" type="string">System-generated task ID.</ResponseField>
    <ResponseField name="data.status" type="string">Task status: `submitted`, `processing`, `succeeded`, or `failed`.</ResponseField>
    <ResponseField name="data.create_time" type="integer">Creation time as a Unix timestamp in milliseconds.</ResponseField>
    <ResponseField name="data.update_time" type="integer">Last update time as a Unix timestamp in milliseconds.</ResponseField>
    <ResponseField name="data.external_id" type="string">External task ID when present.</ResponseField>
  </Tab>

  <Tab title="Image to Video">
    ## Create task

    `POST /kling/v2/image-to-video/kling-3.0-turbo`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/kling/v2/image-to-video/kling-3.0-turbo \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "contents": [
            {
              "type": "prompt",
              "text": "The character turns toward the window while the background moves naturally"
            },
            {
              "type": "first_frame",
              "url": "https://example.com/first-frame.png"
            }
          ],
          "settings": {
            "resolution": "1080p",
            "duration": 5
          },
          "options": {
            "watermark_info": {
              "enabled": false
            }
          }
        }'
      ```

      ```json 200 theme={null}
      {
        "code": 0,
        "message": "string",
        "request_id": "string",
        "data": {
          "id": "893605946402811985",
          "status": "submitted",
          "create_time": 1781080778802,
          "update_time": 1781080794151,
          "external_id": ""
        }
      }
      ```
    </div>

    ## Request headers

    <ParamField header="Authorization" type="string" required>Bearer authentication in the form `Bearer YOUR_API_KEY`.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Data exchange format.</ParamField>

    ## Request body

    <ParamField body="contents" type="object[]" required>
      Input materials. Supply a prompt item and a first-frame item in the same array.
    </ParamField>

    <ParamField body="contents[].type" type="string" required>
      Material type. Supported values: `prompt`, `first_frame`.
    </ParamField>

    <ParamField body="contents[].text" type="string">
      Required when `type` is `prompt`. The prompt can include positive and negative descriptions and can contain up to 2,500 characters.
    </ParamField>

    <ParamField body="contents[].url" type="string">
      Required when `type` is `first_frame`. Provide a public URL or Base64 image content.
    </ParamField>

    <ParamField body="settings" type="object">
      Output resolution and duration.
    </ParamField>

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

    <ParamField body="settings.duration" type="integer" default={5}>
      Video duration in seconds. Supported integer values: 3 through 15.
    </ParamField>

    <ParamField body="options" type="object">
      General generation options.
    </ParamField>

    <ParamField body="options.watermark_info" type="object">
      Platform watermark configuration.
    </ParamField>

    <ParamField body="options.watermark_info.enabled" type="boolean" default={false}>
      Set to `true` to generate an additional watermarked result.
    </ParamField>

    ### First-frame requirements

    Use JPG, JPEG, or PNG up to 50 MB. Both dimensions must be at least 300 px and the aspect ratio must be from 1:2.5 to 2.5:1. Kling 3.0 Turbo supports a first frame only; an end frame and first-plus-end-frame input are not supported.

    ### Multi-shot prompt format

    The `prompt` item can define one to six shots with the format `Shot n, m, words;`. Each shot must last at least one second, total duration must equal `settings.duration`, and each shot description can contain up to 512 characters.

    ## Create response

    <ResponseField name="code" type="integer">Error code. `0` indicates that the request was accepted.</ResponseField>
    <ResponseField name="message" type="string">Error or status message.</ResponseField>
    <ResponseField name="request_id" type="string">System-generated request ID.</ResponseField>
    <ResponseField name="data.id" type="string">System-generated task ID.</ResponseField>
    <ResponseField name="data.status" type="string">Task status: `submitted`, `processing`, `succeeded`, or `failed`.</ResponseField>
    <ResponseField name="data.create_time" type="integer">Creation Unix timestamp in milliseconds.</ResponseField>
    <ResponseField name="data.update_time" type="integer">Last update Unix timestamp in milliseconds.</ResponseField>
    <ResponseField name="data.external_id" type="string">External task ID when present.</ResponseField>
  </Tab>
</Tabs>

## Query task by ID

`GET /kling/v2/tasks?task_ids=TASK_ID`

```bash cURL theme={null}
curl --request GET \
  --url 'https://www.anyfast.ai/kling/v2/tasks?task_ids=TASK_ID' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json'
```

<ParamField query="task_ids" type="string" required>
  One or more system-generated task IDs. Separate multiple IDs with commas.
</ParamField>

```json 200 theme={null}
{
  "code": 0,
  "message": "string",
  "request_id": "string",
  "data": [
    {
      "id": "893605946402811985",
      "status": "succeeded",
      "message": "string",
      "create_time": 1781080778802,
      "update_time": 1781080794151,
      "external_id": "",
      "outputs": [
        {
          "type": "video",
          "id": "string",
          "url": "https://example.com/generated-video.mp4",
          "watermark_url": "string",
          "duration": "5"
        }
      ],
      "billing": [
        {
          "charge_type": "string",
          "amount": "string",
          "package_type": "video",
          "list_price": "string"
        }
      ]
    }
  ]
}
```

## Task result fields

<ResponseField name="data[]" type="object[]">Matched asynchronous tasks.</ResponseField>
<ResponseField name="data[].id" type="string">System-generated task ID.</ResponseField>
<ResponseField name="data[].status" type="string">`submitted`, `processing`, `succeeded`, or `failed`.</ResponseField>
<ResponseField name="data[].message" type="string">Task status details or the failure reason.</ResponseField>
<ResponseField name="data[].create_time" type="integer">Creation Unix timestamp in milliseconds.</ResponseField>
<ResponseField name="data[].update_time" type="integer">Last update Unix timestamp in milliseconds.</ResponseField>
<ResponseField name="data[].external_id" type="string">External task ID when present.</ResponseField>
<ResponseField name="data[].outputs" type="object[]">Generated outputs.</ResponseField>
<ResponseField name="data[].outputs[].type" type="string">For this model, `video`.</ResponseField>
<ResponseField name="data[].outputs[].id" type="string">Generated video ID.</ResponseField>
<ResponseField name="data[].outputs[].url" type="string">Temporary generated video URL.</ResponseField>
<ResponseField name="data[].outputs[].watermark_url" type="string">Watermarked video URL when requested.</ResponseField>
<ResponseField name="data[].outputs[].duration" type="string">Generated video duration in seconds.</ResponseField>
<ResponseField name="data[].billing" type="object[]">Billing deductions for the task.</ResponseField>
<ResponseField name="data[].billing[].charge_type" type="string">`cash` for balance deduction or `unit` for resource-package deduction.</ResponseField>
<ResponseField name="data[].billing[].amount" type="string">Deducted balance or resource-package units.</ResponseField>
<ResponseField name="data[].billing[].package_type" type="string">Resource-package type; `video` for this model.</ResponseField>
<ResponseField name="data[].billing[].list_price" type="string">List-price deduction when `charge_type` is `cash`.</ResponseField>

<Warning>
  Generated image and video URLs are cleared after 30 days. Download and store successful results promptly.
</Warning>
