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

> Kling 3.0 v2 text-to-video, image-to-video, and task query API through AnyFast.

Kling 3.0 uses model-specific v2 paths. Do not send `model_name`, `mode`, or a top-level string `duration`.

> [tab] Text to video
>
> ## Create task
>
> `POST /kling/v2/text-to-video/kling-3.0`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/kling/v2/text-to-video/kling-3.0 \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "prompt": "A paper boat crosses a rain-covered street",
>     "settings": {"resolution": "720p", "duration": 3, "aspect_ratio": "16:9"}
>   }'
> ```
>
> ## Request body
>
> **prompt** `string` *required*
>
> Video description.
>
> **settings** `object`
>
> Output settings.
>
> **settings.resolution** `string`
>
> `720p`, `1080p`, or `4k`.
>
> **settings.duration** `integer`
>
> Numeric duration. Use 3–15 seconds.
>
> **settings.aspect\_ratio** `string`
>
> `16:9`, `9:16`, or `1:1`.
>
> ## 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 used by the shared query endpoint.
>
> **data.status** `string`
>
> `submitted`, `processing`, `succeeded`, or `failed`.

> [tab] Image to video
>
> ## Create task
>
> `POST /kling/v2/image-to-video/kling-3.0`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/kling/v2/image-to-video/kling-3.0 \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "contents": [
>       {"type": "prompt", "text": "The subject turns toward the window"},
>       {"type": "first_frame", "url": "https://example.com/frame.png"}
>     ],
>     "settings": {"resolution": "720p", "duration": 3}
>   }'
> ```
>
> ## Request body
>
> **contents** `object[]` *required*
>
> Include a `prompt` item and a `first_frame` item. Add supported middle or last frames when the model and workflow allow them.
>
> **contents\[].type** `string` *required*
>
> Content type such as `prompt`, `first_frame`, `middle_frame`, or `last_frame`.
>
> **contents\[].text** `string`
>
> Prompt text for a `prompt` item.
>
> **contents\[].url** `string`
>
> Public image URL or supported Base64 image content.
>
> **settings** `object`
>
> Output settings.
>
> ## 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 used by the shared query endpoint.
>
> **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*
>
> One or more system task IDs separated by commas.
>
> ```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, normally `video`.
>
> **data\[].outputs\[].url** `string`
>
> Temporary generated video URL.
>
> **data\[].outputs\[].duration** `string`
>
> Generated video duration in seconds.

> [tab] Motion control
>
> ## Create motion-control task
>
> Production motion control uses the v2 model-specific endpoint.
>
> `POST /kling/v2/motion-control/kling-3.0`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/kling/v2/motion-control/kling-3.0 \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "contents": [
>       {"type": "prompt", "text": "Preserve the character and reproduce the reference motion"},
>       {"type": "image", "url": "https://example.com/character.png"},
>       {"type": "video", "url": "https://example.com/motion.mp4"}
>     ],
>     "settings": {"character_orientation": "video", "audio": "off", "resolution": "720p"},
>     "options": {"external_task_id": "client-motion-task"}
>   }'
> ```
>
> ## Request body
>
> **contents** `object[]` *required*
>
> Prompt, appearance-reference image, and motion-reference video.
>
> **contents\[].type** `string` *required*
>
> Use `prompt`, `image`, or `video`.
>
> **contents\[].url** `string` *required*
>
> Public URL or supported raw Base64 for the image/video item.
>
> **settings.character\_orientation** `string` *required*
>
> Use `image` or `video`.
>
> **settings.audio** `string` (default: original)
>
> Use `original` or `off`.
>
> **settings.resolution** `string` (default: 720p)
>
> `720p` or `1080p`.
>
> **options.external\_task\_id** `string`
>
> Client task ID.
>
> **options.callback\_url** `string`
>
> HTTPS callback URL.
>
> ## Create response
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "",
>   "request_id": "REQUEST_ID",
>   "data": {
>     "id": "TASK_ID",
>     "status": "submitted",
>     "create_time": 1781080778802,
>     "update_time": 1781080778802,
>     "external_id": "client-motion-task"
>   }
> }
> ```
>
> **code** `integer`
>
> Response code; `0` indicates success.
>
> **message** `string`
>
> Response message.
>
> **request\_id** `string`
>
> AnyFast request ID.
>
> **data** `object`
>
> Submitted motion-control task.
>
> **data.id** `string`
>
> System task ID used by the task query endpoint.
>
> **data.status** `string`
>
> Initial task status, normally `submitted`.
>
> **data.create\_time** `integer`
>
> Task creation time in Unix milliseconds.
>
> **data.update\_time** `integer`
>
> Task update time in Unix milliseconds.
>
> **data.external\_id** `string`
>
> Client-defined task ID when supplied.
>
> ## Query response
>
> Query with `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'
> ```
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "",
>   "data": [
>     {
>       "id": "TASK_ID",
>       "status": "succeeded",
>       "create_time": 1781080778802,
>       "update_time": 1781080794151,
>       "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, normally `video`.
>
> **data\[].outputs\[].url** `string`
>
> Temporary generated video URL.
>
> **data\[].outputs\[].duration** `string`
>
> Generated video duration in seconds.

> [tab] Element management
>
> ## Reusable subjects
>
> | Operation | Endpoint |
> | - | - |
> | Create custom Element | `POST /kling/v2/general/advanced-custom-elements` |
> | Query Element task | `GET /kling/v2/general/advanced-custom-elements/{task_id}` |
> | List preset Elements (Legacy) | `GET /kling/v1/general/advanced-presets-elements` |
>
> Use the returned `element_id` in `element_list`. Element references and voice references cannot be combined in the same request.
>
> ## Create custom Element
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/kling/v2/general/advanced-custom-elements \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "element_name": "my-character",
>     "element_description": "A protagonist character",
>     "reference_type": "image_refer",
>     "element_image_list": {
>       "frontal_image": "https://example.com/front.jpg",
>       "refer_images": [{"image_url": "https://example.com/side.jpg"}]
>     },
>     "external_task_id": "client-element-task"
>   }'
> ```
>
> **element\_name** `string` *required*
>
> Element name.
>
> **element\_description** `string` *required*
>
> Description of the reusable subject.
>
> **reference\_type** `string` *required*
>
> Use `image_refer` for image references.
>
> **element\_image\_list** `object` *required*
>
> Reference images for the Element.
>
> **element\_image\_list.frontal\_image** `string` *required*
>
> Public frontal image URL.
>
> **element\_image\_list.refer\_images\[].image\_url** `string`
>
> Additional reference image URL.
>
> ## Create response
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "",
>   "data": {"task_id": "TASK_ID", "task_status": "submitted"}
> }
> ```
>
> **data.task\_id** `string`
>
> Element task ID.
>
> **data.task\_status** `string`
>
> Initial status, normally `submitted`.
>
> ## Query response
>
> Query with `GET /kling/v2/general/advanced-custom-elements/TASK_ID`.
>
> ```bash cURL theme={null}
> curl --request GET \
>   --url 'https://www.anyfast.ai/kling/v2/general/advanced-custom-elements/TASK_ID' \
>   --header 'Authorization: Bearer YOUR_API_KEY'
> ```
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "",
>   "data": {
>     "task_id": "TASK_ID",
>     "task_status": "succeed",
>     "task_result": {
>       "elements": [
>         {
>           "element_id": "ELEMENT_ID",
>           "element_name": "my-character",
>           "element_description": "A protagonist character",
>           "element_type": "image_refer"
>         }
>       ]
>     }
>   }
> }
> ```
>
> **data.task\_id** `string`
>
> Element task ID.
>
> **data.task\_status** `string`
>
> Element task status.
>
> **data.task\_result** `object`
>
> Completed Element result.
>
> **data.task\_result.elements\[]** `object[]`
>
> Reusable Element results.
>
> **data.task\_result.elements\[].element\_id** `string`
>
> Reusable Element ID returned after processing.
>
> **data.task\_result.elements\[].element\_name** `string`
>
> Element name.
>
> **data.task\_result.elements\[].element\_description** `string`
>
> Element description.
>
> **data.task\_result.elements\[].element\_type** `string`
>
> Reference type used to create the Element.

> [tab] Voice management
>
> ## Reusable voices
>
> | Operation | Endpoint |
> | - | - |
> | Create custom voice (current) | `POST /kling/v2/general/custom-voices` |
> | Query custom voice (current) | `GET /kling/v2/general/custom-voices/{id}` |
> | Create custom voice (legacy) | `POST /kling/v1/general/custom-voices` |
> | Query custom voice (legacy) | `GET /kling/v1/general/custom-voices/{id}` |
> | List preset voices (legacy) | `GET /kling/v1/general/presets-voices?pageNum=1&pageSize=30` |
>
> > Preset voice listing remains on the provider's v1 endpoint. The v2 routes are for custom voice creation and query.
>
> Use the returned `voice_id` in `voice_list` and reference it as `<<<voice_1>>>` or `<<<voice_2>>>` in the prompt. Voice and Element references are mutually exclusive.
>
> ## Create custom voice
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/kling/v2/general/custom-voices \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{"voice_name":"Narrator","voice_url":"https://example.com/voice.mp3"}'
> ```
>
> **voice\_name** `string` *required*
>
> Custom voice name.
>
> **voice\_url** `string` *required*
>
> Public URL of the voice sample.
>
> ## Create response
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "data": {"task_id": "TASK_ID", "task_status": "submitted"}
> }
> ```
>
> **data.task\_id** `string`
>
> Custom voice task ID.
>
> **data.task\_status** `string`
>
> Initial status, normally `submitted`.
>
> ## Query response
>
> Query with `GET /kling/v2/general/custom-voices/TASK_ID`.
>
> ```bash cURL theme={null}
> curl --request GET \
>   --url 'https://www.anyfast.ai/kling/v2/general/custom-voices/TASK_ID' \
>   --header 'Authorization: Bearer YOUR_API_KEY'
> ```
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "data": {
>     "task_id": "TASK_ID",
>     "task_status": "succeed",
>     "task_result": {
>       "voices": [
>         {
>           "voice_id": "VOICE_ID",
>           "voice_name": "Narrator",
>           "trial_url": "https://example.com/trial.mp3",
>           "owned_by": "self",
>           "status": "succeed"
>         }
>       ]
>     }
>   }
> }
> ```
>
> **data.task\_id** `string`
>
> Custom voice task ID.
>
> **data.task\_status** `string`
>
> Custom voice task status.
>
> **data.task\_result** `object`
>
> Completed voice result.
>
> **data.task\_result.voices\[]** `object[]`
>
> Reusable voice results.
>
> **data.task\_result.voices\[].voice\_id** `string`
>
> Reusable voice ID.
>
> **data.task\_result.voices\[].voice\_name** `string`
>
> Voice name.
>
> **data.task\_result.voices\[].trial\_url** `string`
>
> Trial audio URL.
>
> **data.task\_result.voices\[].owned\_by** `string`
>
> Voice owner or provider.
>
> **data.task\_result.voices\[].status** `string`
>
> Voice processing status.
>
> Older integrations can use the v1 create and query routes listed above.
>
> ## Query preset voices
>
> ```bash cURL theme={null}
> curl --request GET \
>   --url 'https://www.anyfast.ai/kling/v1/general/presets-voices?pageNum=1&pageSize=30' \
>   --header 'Authorization: Bearer YOUR_API_KEY'
> ```
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "SUCCEED",
>   "request_id": "REQUEST_ID",
>   "data": [
>     {
>       "task_id": "PRESET_TASK_ID",
>       "task_status": "succeed",
>       "task_result": {
>         "voices": [
>           {
>             "voice_id": "PRESET_VOICE_ID",
>             "voice_name": "Warm narrator",
>             "trial_url": "https://example.com/preset.mp3",
>             "owned_by": "vod",
>             "status": "succeed"
>           }
>         ]
>       }
>     }
>   ]
> }
> ```
>
> **code** `integer`
>
> Response code; `0` indicates success.
>
> **message** `string`
>
> Response message.
>
> **request\_id** `string`
>
> AnyFast request ID.
>
> **data** `object[]`
>
> Preset voice task records.
>
> **data\[].task\_id** `string`
>
> Preset voice task ID.
>
> **data\[].task\_status** `string`
>
> Preset voice task status.
>
> **data\[].task\_result** `object`
>
> Preset voice result.
>
> **data\[].task\_result.voices\[]** `object[]`
>
> Preset voices returned by the task.
>
> **data\[].task\_result.voices\[].voice\_id** `string`
>
> Preset voice ID.
>
> **data\[].task\_result.voices\[].voice\_name** `string`
>
> Preset voice name.
>
> **data\[].task\_result.voices\[].trial\_url** `string`
>
> Trial audio URL.
>
> **data\[].task\_result.voices\[].owned\_by** `string`
>
> Voice owner or provider.
>
> **data\[].task\_result.voices\[].status** `string`
>
> Voice status.

## Extended capability parameters

**negative\_prompt** `string`

Content to avoid, up to 2,500 characters.

**multi\_shot** `boolean`

Enable a one-to-six-shot storyboard when supported by the selected channel.

**shot\_type** `string`

`customize` uses `multi_prompt`; `intelligence` plans shots from the main prompt.

**multi\_prompt\[].index** `integer`

Shot index, starting at 1.

**multi\_prompt\[].prompt** `string`

Shot description, up to 512 characters.

**multi\_prompt\[].duration** `integer`

Shot duration in seconds, at least 1 second. Shot durations must add up to `settings.duration`.

**voice\_list\[].voice\_id** `string`

Voice ID from Voice Management. Up to two voices can be used and must be referenced in prompt order.

**settings.sound** `string`

Native audio switch for channels that expose sound. Set it to the supported enabled value when using voices.

**settings.cfg\_scale** `number`

Prompt adherence value from 0 to 1 when exposed by the selected channel.

**camera\_control.type** `string`

`simple`, `down_back`, `forward_up`, `right_turn_forward`, or `left_turn_forward`.

**camera\_control.config** `object`

For `simple`, set one nonzero value among `horizontal`, `vertical`, `pan`, `tilt`, `roll`, and `zoom`; each ranges from -10 to 10.

**dynamic\_masks\[].mask** `string`

Motion-brush mask URL or supported raw Base64.

**dynamic\_masks\[].trajectories** `object[]`

Motion trajectory points; a 5-second output accepts 2–77 points per mask.

**element\_list\[].element\_id** `string`

Element ID from Element Management. Element references and voice references are mutually exclusive in the same image-to-video request.

### Input and combination rules

Image-to-video requires a first-frame image. JPG, JPEG, and PNG inputs can be supplied by public URL or supported raw Base64. End-frame input cannot be combined with motion brush or camera control. Motion control uses one character image and one MP4 or MOV reference video; the reference video is at least 3 seconds and can be up to 10 seconds with image orientation or 30 seconds with video orientation.


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