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

> Kling O1 v2 Omni generation, editing, and task query API through AnyFast.

Kling O1 uses the v2 Omni Video endpoint. The model is selected in the path; put prompts and references in `contents`.

> [tab] Omni generation or editing
>
> ## Create task
>
> `POST /kling/v2/omni-video/kling-o1`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/kling/v2/omni-video/kling-o1 \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "contents": [{"type": "prompt", "text": "A traveler walks through a rain-soaked city street"}],
>     "settings": {"resolution": "720p", "aspect_ratio": "16:9", "duration": 3}
>   }'
> ```
>
> ## Request body
>
> **contents** `object[]` *required*
>
> Include one `prompt` item and optional `refer_image`, `feature_video`, `first_frame`, `last_frame`, or `base_video` items.
>
> **contents\[].type** `string` *required*
>
> Content role. Use `@id` in the prompt to reference an item with an ID.
>
> **contents\[].text** `string`
>
> Prompt text for the `prompt` item.
>
> **contents\[].url** `string`
>
> Public image or video URL.
>
> **settings** `object`
>
> Output resolution, duration, and aspect ratio.
>
> ## Create response
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "",
>   "request_id": "REQUEST_ID",
>   "data": {"id": "TASK_ID", "status": "submitted"}
> }
> ```
>
> **data.id** `string`
>
> System task ID.
>
> **data.status** `string`
>
> Initial task status.

> [tab] Query task
>
> ## Query tasks
>
> `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'
> ```
>
> **task\_ids** `string` *required*
>
> System task ID or comma-separated IDs.
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "",
>   "data": [{
>     "id": "TASK_ID",
>     "status": "succeeded",
>     "outputs": [{"type": "video", "url": "https://example.com/video.mp4", "duration": "5.041"}]
>   }]
> }
> ```
>
> **data\[].id** `string`
>
> System task ID.
>
> **data\[].status** `string`
>
> `submitted`, `processing`, `succeeded`, or `failed`.
>
> **data\[].create\_time** `integer`
>
> Task creation time in Unix milliseconds.
>
> **data\[].update\_time** `integer`
>
> Task update time in Unix milliseconds.
>
> **data\[].outputs** `object[]`
>
> Generated outputs.
>
> **data\[].outputs\[].type** `string`
>
> Output type.
>
> **data\[].outputs\[].url** `string`
>
> Temporary generated media URL.
>
> **data\[].outputs\[].duration** `string`
>
> Generated media duration in seconds.

## Workflow and parameter reference

**contents\[].type** `string`

Use `prompt`, `refer_image`, `feature_video`, `base_video`, `first_frame`, or `last_frame`.

**contents\[].id** `string`

Unique content ID. Reference the item with `@id` in the prompt.

**contents\[].url** `string`

Public JPG, JPEG, or PNG image URL, public MP4 or MOV video URL, or supported raw Base64 image content.

**contents\[].refer\_type** `string`

For a video item, `base` edits the source video and `feature` uses its content, motion, style, or camera movement as a reference.

**contents\[].keep\_original\_sound** `string`

For a source video, use `yes` to preserve its audio or `no` to discard it.

**settings.duration** `integer`

Output duration from 3 to 10 seconds. A `base_video` edit follows the source duration when omitted.

**settings.resolution** `string`

`720p` or `1080p`.

**settings.aspect\_ratio** `string`

`16:9`, `9:16`, or `1:1`; required when no first frame or source video determines the composition.

**settings.sound** `string`

Kling O1 does not generate native audio. Keep the audio setting disabled; source-video audio is controlled with `keep_original_sound`.

**settings.watermark\_info.enabled** `boolean`

Request a watermarked result in addition to the standard output.

### Reference and editing rules

Use at most one source video in a request. A `base_video` item is the editing workflow and keeps the source duration when no duration is supplied. A `feature_video` item guides a new generation and can provide content, action, style, camera movement, or shot continuation. First/end-frame workflows require a first frame; an end frame cannot be used by itself and cannot be combined with incompatible element references.

Images use JPG, JPEG, and PNG with both sides at least 300 px and an aspect ratio from 1:2.5 to 2.5:1. Videos use accessible MP4 or MOV URLs, at least 3 seconds, 720–2160 px, 24–60 FPS, and the same aspect-ratio range. Multi-shot and 4K output are not available for Kling O1.


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