> ## 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-video-o1

> Kling O1 Legacy Omni Video generation, editing, and task query API.

Kling O1 uses the **Kling Legacy Omni Video API**. One endpoint supports text-to-video, image and element references, video editing, video continuation, and first/end-frame generation.

<Note>
  Set `model_name` to `kling-o1`. It supports 3–10 seconds, 720p (`std`), and 1080p (`pro`). Multi-shot generation, 4K, and native audio generation are not supported.
</Note>

<Tabs>
  <Tab title="Video Generation">
    ## Create Task

    `POST /kling/v1/videos/omni-video`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/kling/v1/videos/omni-video \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model_name": "kling-o1",
          "prompt": "The person in <<<image_1>>> walks into a rain-soaked neon street with a cinematic tracking shot",
          "image_list": [
            {"image_url": "https://example.com/character.png"}
          ],
          "mode": "pro",
          "aspect_ratio": "16:9",
          "duration": "7",
          "sound": "off"
        }'
      ```

      ```json 200 theme={null}
      {
        "id": "860260753860210752",
        "task_id": "860260753860210752",
        "object": "video",
        "model": "kling-video-o1",
        "status": "",
        "progress": 0,
        "created_at": 1773130665
      }
      ```
    </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. Use `application/json`.
    </ParamField>

    ## Request parameters

    <ParamField body="model_name" type="string" required>
      Model name. Use `kling-o1`.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Generation or editing instruction, up to 2,500 characters. Reference media with `<<<image_1>>>`, `<<<element_1>>>`, and `<<<video_1>>>`.
    </ParamField>

    <ParamField body="image_list" type="object[]">
      Reference images, including optional first and end frames.
    </ParamField>

    <ParamField body="image_list[].image_url" type="string" required>
      Image URL or raw Base64 without the `data:image/...;base64,` prefix.
    </ParamField>

    <ParamField body="image_list[].type" type="string">
      Frame type: `first_frame` or `end_frame`. An end frame requires a first frame.
    </ParamField>

    <ParamField body="element_list" type="object[]">
      Legacy elements. Reference them in list order with `<<<element_1>>>`, `<<<element_2>>>`, and so on.
    </ParamField>

    <ParamField body="element_list[].element_id" type="integer" required>
      Element ID returned by the Legacy Element Management API.
    </ParamField>

    <ParamField body="video_list" type="object[]">
      At most one reference video for source-video editing or for content, motion, style, and camera reference.
    </ParamField>

    <ParamField body="video_list[].video_url" type="string" required>
      Publicly accessible video URL. Base64 video input is not supported.
    </ParamField>

    <ParamField body="video_list[].refer_type" type="string" default="base">
      `base` edits the source video. `feature` uses the source as a generation reference.
    </ParamField>

    <ParamField body="video_list[].keep_original_sound" type="string" default="no">
      Preserve source audio with `yes`, or discard it with `no`.
    </ParamField>

    <ParamField body="mode" type="string" default="std">
      Output mode. `std` is 720p and `pro` is 1080p. Kling O1 does not support `4k`.
    </ParamField>

    <ParamField body="aspect_ratio" type="string" default="16:9">
      `16:9`, `9:16`, or `1:1`. Required without a first-frame or video reference; not supported for source-video editing.
    </ParamField>

    <ParamField body="duration" type="string" default="5">
      Duration from 3 to 10 seconds. Ignored when `refer_type` is `base`; output follows the source-video duration.
    </ParamField>

    <ParamField body="sound" type="string" default="off">
      Kling O1 does not support native audio generation. Use `off`; it is required whenever `video_list` is present.
    </ParamField>

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

    <ParamField body="watermark_info.enabled" type="boolean" default={false}>
      Add the platform watermark.
    </ParamField>

    ## Parameter rules

    ### Multimodal references

    * Reference images, elements, and videos with `<<<image_N>>>`, `<<<element_N>>>`, and `<<<video_N>>>`. Numbering starts at 1 and follows array order.
    * Kling O1 is single-shot only. It does not support `multi_shot`, `shot_type`, or `multi_prompt`.
    * First/end-frame mode accepts at most two images. An end frame requires a first frame, and this mode cannot use elements.

    ### Image requirements

    * JPG, JPEG, or PNG, up to 10 MB per image.
    * At least 300 px on each side, with an aspect ratio from 1:2.5 to 2.5:1.
    * Public URL or raw Base64 without a data URI prefix.

    ### Video requirements

    * MP4 or MOV, at most one video up to 200 MB.
    * At least 3 seconds, dimensions from 720 to 2160 px, 24–60 fps, and aspect ratio from 1:2.5 to 2.5:1.
    * `refer_type: "base"` edits the source video. It cannot use first/end frames, and `duration` is ignored.
    * `refer_type: "feature"` references content, action, style, or camera movement and can generate a previous or next shot.
    * Set `sound` to `off` with video input. Use `keep_original_sound` to preserve or remove the source audio.

    ### Media counts

    | Scenario                                          | Limit                                                                                           |
    | ------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
    | No reference video, multi-image elements only     | Reference images plus element images: at most 7                                                 |
    | No reference video, video-character elements only | At most 3 video-character elements                                                              |
    | No reference video, both element types            | At most 3 video-character elements; reference images plus multi-image element images: at most 4 |
    | Reference video, multi-image elements only        | Reference images plus element images: at most 4                                                 |
    | Reference video, video-character elements only    | At most 1 video-character element                                                               |

    ## Create response

    <ResponseField name="id" type="string">AnyFast task ID.</ResponseField>
    <ResponseField name="task_id" type="string">Task ID, equal to `id`.</ResponseField>
    <ResponseField name="object" type="string">Always `video`.</ResponseField>
    <ResponseField name="model" type="string">Model used for the task.</ResponseField>
    <ResponseField name="status" type="string">Initial task status.</ResponseField>
    <ResponseField name="progress" type="integer">Initial progress.</ResponseField>
    <ResponseField name="created_at" type="integer">Creation Unix timestamp.</ResponseField>

    ## Scenario Invocation Examples

    ### Text to video

    ```json theme={null}
    {
      "model_name": "kling-o1",
      "prompt": "A sailboat crosses golden morning fog as an aerial camera slowly moves forward",
      "mode": "pro",
      "aspect_ratio": "16:9",
      "duration": "6",
      "sound": "off"
    }
    ```

    ### Image and element reference

    ```json theme={null}
    {
      "model_name": "kling-o1",
      "prompt": "The person in <<<image_1>>> wears the outfit from <<<element_1>>> and enters a cafe",
      "image_list": [
        {"image_url": "https://example.com/character.png"}
      ],
      "element_list": [
        {"element_id": 123456789}
      ],
      "mode": "pro",
      "aspect_ratio": "16:9",
      "duration": "5",
      "sound": "off"
    }
    ```

    ### Video editing

    ```json theme={null}
    {
      "model_name": "kling-o1",
      "prompt": "Change the weather in <<<video_1>>> to snow and apply a cinematic color grade",
      "video_list": [
        {
          "video_url": "https://example.com/source.mp4",
          "refer_type": "base",
          "keep_original_sound": "yes"
        }
      ],
      "mode": "pro",
      "sound": "off"
    }
    ```

    ### Video reference and continuation

    ```json theme={null}
    {
      "model_name": "kling-o1",
      "prompt": "Use the action and camera movement from <<<video_1>>> to generate the immediately following shot",
      "video_list": [
        {
          "video_url": "https://example.com/reference.mp4",
          "refer_type": "feature",
          "keep_original_sound": "no"
        }
      ],
      "mode": "pro",
      "aspect_ratio": "16:9",
      "duration": "5",
      "sound": "off"
    }
    ```

    ### First and end frames

    ```json theme={null}
    {
      "model_name": "kling-o1",
      "prompt": "Transition naturally from morning to night while preserving the building structure",
      "image_list": [
        {"image_url": "https://example.com/first.png", "type": "first_frame"},
        {"image_url": "https://example.com/end.png", "type": "end_frame"}
      ],
      "mode": "pro",
      "duration": "6",
      "sound": "off"
    }
    ```

    ## FAQ

    ### What input media is supported?

    * Up to 7 JPG/JPEG/PNG images, at least 300 px per side and no more than 10 MB each.
    * At most one MP4/MOV video, at least 3 seconds, up to 2K and 200 MB.
    * A multi-image element can be built from up to 4 different views.
    * With a reference video, images and elements total at most 4; without video, they total at most 7.

    ### How do prompts reference media?

    Use `<<<image_1>>>`, `<<<element_1>>>`, and `<<<video_1>>>` in array order. The numbering must match the corresponding list.

    ### What restrictions apply to frames and video editing?

    End-frame-only generation is not supported. An end frame requires a first frame, and first/end-frame mode cannot use elements. Source-video editing with `refer_type: "base"` also cannot use frames, and its output duration follows the source.

    ### Which resolutions and durations are supported?

    `std` is 720p and `pro` is 1080p; 4K is not supported. Output duration is 3–10 seconds except for source-video editing.

    ## Query Task (Single)

    `GET /kling/v1/videos/omni-video/{task_id}`

    ```bash cURL theme={null}
    curl --request GET \
      --url https://www.anyfast.ai/kling/v1/videos/omni-video/860260753860210752 \
      --header 'Authorization: Bearer YOUR_API_KEY'
    ```

    <ParamField path="task_id" type="string" required>
      Task ID returned by the create endpoint.
    </ParamField>

    ### Response fields

    <ResponseField name="code" type="integer">Business status code; `0` indicates success.</ResponseField>
    <ResponseField name="message" type="string">Response message.</ResponseField>
    <ResponseField name="request_id" type="string">Request trace ID.</ResponseField>
    <ResponseField name="data.task_id" type="string">Task ID.</ResponseField>
    <ResponseField name="data.task_status" type="string">`submitted`, `processing`, `succeed`, or `failed`.</ResponseField>
    <ResponseField name="data.task_status_msg" type="string">Failure reason or status details.</ResponseField>
    <ResponseField name="data.task_result.videos" type="object[]">Generated videos.</ResponseField>
    <ResponseField name="data.task_result.videos[].id" type="string">Video ID.</ResponseField>
    <ResponseField name="data.task_result.videos[].url" type="string">Video URL without a watermark.</ResponseField>
    <ResponseField name="data.task_result.videos[].watermark_url" type="string">Watermarked video URL.</ResponseField>
    <ResponseField name="data.task_result.videos[].duration" type="string">Actual video duration.</ResponseField>
    <ResponseField name="data.watermark_info.enabled" type="boolean">Whether the platform watermark is enabled.</ResponseField>
    <ResponseField name="data.final_unit_deduction" type="string">Final resource-unit deduction.</ResponseField>
    <ResponseField name="data.final_balance_deduction.quota" type="string">Final balance quota deduction.</ResponseField>
    <ResponseField name="data.created_at" type="integer">Creation timestamp in milliseconds.</ResponseField>
    <ResponseField name="data.updated_at" type="integer">Update timestamp in milliseconds.</ResponseField>

    ```json 200 theme={null}
    {
      "code": 0,
      "message": "SUCCEED",
      "request_id": "req_123456789",
      "data": {
        "task_id": "860260753860210752",
        "task_status": "succeed",
        "task_status_msg": "",
        "task_result": {
          "videos": [
            {
              "id": "video_123456789",
              "url": "https://example.com/generated.mp4",
              "watermark_url": "https://example.com/generated-watermark.mp4",
              "duration": "7"
            }
          ]
        },
        "watermark_info": {"enabled": false},
        "final_unit_deduction": "1",
        "final_balance_deduction": {"quota": "0"},
        "created_at": 1773130665000,
        "updated_at": 1773130765000
      }
    }
    ```

    <Warning>
      Kling removes image and video URLs from task results after 30 days. Download and save generated media before the URLs expire.
    </Warning>
  </Tab>

  <Tab title="Element Management">
    ## Element APIs

    | Operation             | Method and path                          |
    | --------------------- | ---------------------------------------- |
    | Create custom element | `POST /kling/v1/general/custom-elements` |
    | List custom elements  | `GET /kling/v1/general/custom-elements`  |
    | List preset elements  | `GET /kling/v1/general/presets-elements` |
    | Delete custom element | `POST /kling/v1/general/delete-elements` |

    <Note>This section strictly documents the Kling Legacy Element API.</Note>

    ## Create Element

    `POST /kling/v1/general/custom-elements`

    <div className="kling-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/kling/v1/general/custom-elements \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "element_name": "series-character",
          "element_description": "The lead character",
          "element_frontal_image": "https://example.com/front.png",
          "element_refer_list": [
            {"image_url": "https://example.com/side.png"},
            {"image_url": "https://example.com/close-up.png"}
          ],
          "tag_list": [{"tag_id": "o_102"}]
        }'
      ```

      ```json 200 theme={null}
      {
        "code": 0,
        "message": "SUCCEED",
        "request_id": "request-id",
        "data": {
          "element_id": 863121023120580662,
          "element_name": "series-character",
          "element_description": "The lead character",
          "element_frontal_image": "https://example.com/front.png",
          "element_refer_list": [
            {"image_url": "https://example.com/side.png"}
          ],
          "tag_list": [
            {"id": "o_102", "name": "Character", "description": "string"}
          ],
          "owned_by": "creator-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>Use `application/json`.</ParamField>

    ### Request body

    <ParamField body="element_name" type="string" required>Element name, up to 20 characters.</ParamField>
    <ParamField body="element_description" type="string" required>Element description, up to 100 characters.</ParamField>
    <ParamField body="element_frontal_image" type="string" required>Front-view image URL or raw Base64 without a data URI prefix.</ParamField>
    <ParamField body="element_refer_list" type="object[]" required>One to three alternate-angle or close-up images.</ParamField>
    <ParamField body="element_refer_list[].image_url" type="string" required>Reference image URL or raw Base64.</ParamField>
    <ParamField body="tag_list" type="object[]">Element tags.</ParamField>
    <ParamField body="tag_list[].tag_id" type="string" required>`o_101` trend, `o_102` character, `o_103` animal, `o_104` item, `o_105` costume, `o_106` scene, `o_107` effect, or `o_108` other.</ParamField>

    Images support JPG, JPEG, and PNG, up to 10 MB each. Both dimensions must be at least 300 px and the aspect ratio must be from 1:2.5 to 2.5:1.

    ### Create response

    <ResponseField name="code" type="integer">`0` indicates success.</ResponseField>
    <ResponseField name="message" type="string">Response message.</ResponseField>
    <ResponseField name="request_id" type="string">Request trace ID.</ResponseField>
    <ResponseField name="data.element_id" type="integer">Element ID used in O1 `element_list`.</ResponseField>
    <ResponseField name="data.element_name" type="string">Element name.</ResponseField>
    <ResponseField name="data.element_description" type="string">Element description.</ResponseField>
    <ResponseField name="data.element_frontal_image" type="string">Front-view image.</ResponseField>
    <ResponseField name="data.element_refer_list" type="object[]">Alternate-angle reference images.</ResponseField>
    <ResponseField name="data.tag_list" type="object[]">Element tags.</ResponseField>
    <ResponseField name="data.owned_by" type="string">Element owner; `kling` identifies an official preset.</ResponseField>

    ## Query Custom Element (List)

    `GET /kling/v1/general/custom-elements?pageNum=1&pageSize=30`

    ```bash cURL theme={null}
    curl --request GET \
      --url 'https://www.anyfast.ai/kling/v1/general/custom-elements?pageNum=1&pageSize=30' \
      --header 'Authorization: Bearer YOUR_API_KEY'
    ```

    <ParamField query="pageNum" type="integer" default={1}>Page number from 1 to 1,000.</ParamField>
    <ParamField query="pageSize" type="integer" default={30}>Items per page from 1 to 500.</ParamField>

    The response contains `code`, `message`, `request_id`, and `data[]`. Each item includes the create-response element fields and `final_unit_deduction`.

    ## Query Preset Element (List)

    `GET /kling/v1/general/presets-elements?pageNum=1&pageSize=30`

    ```bash cURL theme={null}
    curl --request GET \
      --url 'https://www.anyfast.ai/kling/v1/general/presets-elements?pageNum=1&pageSize=30' \
      --header 'Authorization: Bearer YOUR_API_KEY'
    ```

    <ParamField query="pageNum" type="integer" default={1}>Page number from 1 to 1,000.</ParamField>
    <ParamField query="pageSize" type="integer" default={30}>Items per page from 1 to 500.</ParamField>

    The response matches the custom-element list without `final_unit_deduction`. Official presets use `owned_by: "kling"`.

    ## Delete Custom Element

    `POST /kling/v1/general/delete-elements`

    ```bash cURL theme={null}
    curl --request POST \
      --url https://www.anyfast.ai/kling/v1/general/delete-elements \
      --header 'Authorization: Bearer YOUR_API_KEY' \
      --header 'Content-Type: application/json' \
      --data '{"element_id": "863121023120580662"}'
    ```

    <ParamField body="element_id" type="string" required>Custom element ID to delete. Official preset elements cannot be deleted.</ParamField>

    ```json 200 theme={null}
    {
      "code": 0,
      "message": "SUCCEED",
      "request_id": "request-id"
    }
    ```
  </Tab>
</Tabs>

<Card title="Kling O1 Guide" icon="book-open" href="/guides/model-api/kuaishou/kling-video-o1">
  Review model capabilities, media constraints, and usage guidance.
</Card>

<script src="/feedback.js" />
