- Text to Video
- Image to Video
- Omni Video Generation
- Motion Control
- Element Management
- Voice Management
Create Task
POST /kling/v1/videos/text2videoGenerate video from text with model_name: "kling-3.0". Multi-shot storyboards, camera movement, sound, and voice references are supported.cURL
curl --request POST \
--url https://www.anyfast.ai/kling/v1/videos/text2video \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-3.0",
"prompt": "A rabbit wearing glasses reads a newspaper at a table",
"duration": "5",
"mode": "pro",
"sound": "on",
"aspect_ratio": "1:1"
}'
Create response
200
{
"id": "860260753860210752",
"task_id": "860260753860210752",
"object": "video",
"model": "kling-v3",
"status": "queued",
"progress": 0,
"created_at": 1773130665
}
Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Data exchange format. Use
application/json.Request parameters
string
required
Use
kling-3.0.string
Positive prompt, up to 2,500 characters; required for a single shot or intelligent storyboard.
string
Negative prompt, up to 2,500 characters.
boolean
default:false
Enable multi-shot generation.
string
With multi-shot, use
customize or intelligence.object[]
One to six custom shots whose durations add up to
duration.object[]
Up to two voice references.
string
default:"off"
Use
on or off; voice references require on.string
default:"std"
std for 720p, pro for 1080p, or 4k.string
default:"5"
Video duration from 3 to 15 seconds.
string
default:"16:9"
Use
16:9, 9:16, or 1:1.number
Prompt adherence from 0 to 1.
object
Preset or custom camera movement.
object
Platform watermark configuration through
enabled.Storyboards, voices, and camera movement
Whenmulti_shot is true, set shot_type to customize and supply multi_prompt, or use intelligence with prompt. Each custom shot contains index, prompt, and duration; each shot lasts at least 1 second and its prompt is at most 512 characters.Voice references use <<<voice_1>>> and <<<voice_2>>> in list order. Supply at most two voice_id values from voice management and set sound to on.camera_control.type supports simple, down_back, forward_up, right_turn_forward, and left_turn_forward. For simple, only one of horizontal, vertical, pan, tilt, roll, and zoom may be nonzero; every value ranges from -10 to 10.Interactive request parameters
Fill in and test the full Legacy request body.
Query task by ID
GET /kling/v1/videos/text2video/{task_id}Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Data exchange format. Use
application/json.Path parameters
string
required
Text-to-video task ID returned by the create endpoint.
cURL
curl --request GET \
--url https://www.anyfast.ai/kling/v1/videos/text2video/TASK_ID \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
200
{
"code": 0,
"data": {
"created_at": 1784720894000,
"task_id": "asyntask_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task_result": {
"videos": [{
"duration": "5",
"url": "https://example.com/generated-video.mp4"
}]
},
"task_status": "succeed",
"updated_at": 1784721103000
},
"message": ""
}
Response fields
integer
0 indicates that the query was accepted.string
Error information; empty for a successful query.
string
Queried task ID.
string
submitted, processing, succeed, or failed.string
Failure details when the task fails.
object[]
Generated videos, returned after success.
string
Temporary generated-video URL.
string
Actual duration in seconds.
integer
Creation Unix timestamp in milliseconds.
integer
Last update Unix timestamp in milliseconds.
Create Task
POST /kling/v1/videos/image2videoGenerate video from a first frame, an end frame, or both with model_name: "kling-3.0".cURL
curl --request POST \
--url https://www.anyfast.ai/kling/v1/videos/image2video \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-3.0",
"image": "https://example.com/first-frame.png",
"prompt": "The character turns and walks toward the window",
"duration": "5",
"mode": "pro",
"sound": "off"
}'
200
{"id":"860260753860210752","task_id":"860260753860210752","object":"video","model":"kling-v3","status":"queued","progress":0,"created_at":1773130665}
Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Data exchange format. Use
application/json.Request parameters
string
required
Use
kling-3.0.string
First frame as URL or raw Base64; at least one frame is required.
string
End frame; mutually exclusive with motion brush and camera control.
string
Positive prompt, up to 2,500 characters.
string
Negative prompt, up to 2,500 characters.
boolean
default:false
Enable multi-shot generation.
string
Use
customize or intelligence.object[]
One to six custom shots.
object[]
Up to three elements; mutually exclusive with
voice_list.object[]
Up to two voices; requires
sound: "on".string
Static motion-brush mask.
object[]
Up to six dynamic masks.
object
Preset or simple camera movement.
string
default:"std"
Use
std, pro, or 4k.string
default:"5"
Video duration from 3 to 15 seconds.
number
Prompt adherence from 0 to 1.
object
Platform watermark setting.
integer
required
Shot index, starting from 1.
string
required
Shot prompt, up to 512 characters.
string
required
Shot duration, at least 1 second; the sum must equal top-level
duration.integer
required
Element ID returned by element management.
string
required
Voice ID returned by voice management.
string
required
Dynamic mask URL or raw Base64.
object[]
required
Motion trajectory coordinates.
integer
required
Horizontal coordinate from the bottom-left origin.
integer
required
Vertical coordinate from the bottom-left origin.
string
required
simple or one of four preset compound movements.object
Simple movement configuration; only one of six values may be nonzero.
boolean
default:false
Add the platform watermark.
Create response
string
AnyFast task ID.
string
Task ID, equal to
id.string
Always
video.string
Model used by the task.
string
Initial task status.
integer
Initial progress.
integer
Creation Unix timestamp.
Image, storyboard, and motion-brush rules
image and image_tail accept a public URL or raw Base64 without a data URI prefix. Use JPG, JPEG, or PNG up to 10 MB, at least 300 px per side, with an aspect ratio from 1:2.5 to 2.5:1. At least one frame is required. An end frame, motion brush, and camera control are mutually exclusive.Dynamic motion brush supports up to 6 masks. Mask dimensions must match the input image and each other. For a 5-second video, each trajectory contains 2–77 coordinates measured from the bottom-left corner.Multi-shot, voice, and camera-control rules are the same as text-to-video. element_list and voice_list cannot be used together.Interactive request parameters
Fill in and test every first/end-frame, storyboard, brush, element, voice, and camera field.
Query task by ID
GET /kling/v1/videos/image2video/{task_id}Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Data exchange format. Use
application/json.Path parameters
string
required
Image-to-video task ID returned by the create endpoint.
cURL
curl --request GET \
--url https://www.anyfast.ai/kling/v1/videos/image2video/TASK_ID \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
200
{
"code": 0,
"data": {
"created_at": 1784720894000,
"task_id": "asyntask_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task_result": {
"videos": [{
"duration": "5",
"url": "https://example.com/generated-video.mp4"
}]
},
"task_status": "succeed",
"updated_at": 1784721103000
},
"message": ""
}
Response fields
integer
0 indicates that the query was accepted.string
Error information; empty for a successful query.
string
Queried task ID.
string
submitted, processing, succeed, or failed.string
Failure details when the task fails.
object[]
Generated videos, returned after success.
string
Temporary generated-video URL.
string
Actual duration in seconds.
integer
Creation Unix timestamp in milliseconds.
integer
Last update Unix timestamp in milliseconds.
Create Task
POST /kling/v1/videos/omni-videoUse model_name: "kling-3.0-omni" with text, images, video, and elements for generation or editing.cURL
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-3.0-omni",
"prompt": "The character in <<<image_1>>> walks into a rainy neon street",
"image_list": [{"image_url": "https://example.com/character.png"}],
"duration": "5",
"mode": "pro",
"aspect_ratio": "16:9"
}'
200
{"id":"860260753860210752","task_id":"860260753860210752","object":"video","model":"kling-v3-omni","status":"queued","progress":0,"created_at":1773130665}
Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Data exchange format. Use
application/json.Request parameters
string
required
Use
kling-3.0-omni.string
Up to 2,500 characters; reference media with the official placeholders.
object[]
Reference images and optional first/end frames.
object[]
At most one reference video, including
refer_type and keep_original_sound.object[]
Element count depends on whether a video is supplied.
boolean
default:false
Enable multi-shot generation.
string
Use
customize or intelligence.object[]
One to six custom shots.
string
default:"pro"
Use
std, pro, or 4k.string
Use
16:9, 9:16, or 1:1 when applicable.string
default:"5"
3–15 seconds; ignored for
refer_type: "base".string
default:"off"
Must be
off when video_list is present.object
Platform watermark setting.
string
required
Reference image URL or raw Base64.
string
first_frame or end_frame; an end frame requires a first frame.string
required
Reference video URL.
string
default:"base"
base edits the source video; feature references its characteristics.string
Use
yes or no.integer
required
Element ID from element management.
integer
required
Shot index.
string
required
Shot prompt, up to 512 characters.
string
required
Shot duration, at least 1 second.
boolean
default:false
Add the platform watermark.
Create response
string
AnyFast task ID.
string
Task ID, equal to
id.string
Always
video.string
kling-v3-omni.string
Initial task status.
integer
Initial progress.
integer
Creation Unix timestamp.
Media constraints
Images accept URL or raw Base64, JPG/JPEG/PNG, up to 10 MB, at least 300 px per side, and aspect ratio 1:2.5 to 2.5:1. An end frame requires a first frame. Without a reference video, images plus multi-image elements total at most 7 and video-character elements at most 3. With a reference video, those limits become 4 and 1.Reference video accepts MP4/MOV, 3–15.5 seconds, up to 200 MB, 24–60 fps, dimensions 700–4553 px, no more than 8,294,400 pixels, and aspect ratio 1:2.5 to 2.5:1.refer_type: "base" edits the original video, preserves its duration, and disables multi-shot and first/end-frame controls. refer_type: "feature" references content, motion, style, or camera movement and can use intelligent multi-shot. keep_original_sound controls source audio; new sound generation is unavailable whenever a reference video is present.Interactive request parameters
Fill in and test the complete Omni Legacy request body.
Query task by ID
GET /kling/v1/videos/omni-video/{task_id}Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Data exchange format. Use
application/json.Path parameters
string
required
Omni-video task ID returned by the create endpoint.
cURL
curl --request GET \
--url https://www.anyfast.ai/kling/v1/videos/omni-video/TASK_ID \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
200
{
"code": 0,
"data": {
"created_at": 1784516360000,
"task_id": "asyntask_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task_result": {
"videos": [{
"duration": "5",
"url": "https://example.com/generated-video.mp4"
}]
},
"task_status": "succeed",
"updated_at": 1784516573000
},
"message": ""
}
Response fields
integer
0 indicates that the query was accepted.string
Error information; empty for a successful query.
string
Queried task ID.
string
submitted, processing, succeed, or failed.string
Failure details when the task fails.
object[]
Generated videos, returned after success.
string
Temporary generated-video URL.
string
Actual duration in seconds.
integer
Creation Unix timestamp in milliseconds.
integer
Last update Unix timestamp in milliseconds.
Create Task
POST /kling/v1/videos/motion-controlTransfer movement from a reference video to a character image with model_name: "kling-3.0".cURL
curl --request POST \
--url https://www.anyfast.ai/kling/v1/videos/motion-control \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model_name": "kling-3.0",
"image_url": "https://example.com/character.png",
"video_url": "https://example.com/motion.mp4",
"prompt": "The character performs the reference action in a studio",
"keep_original_sound": "yes",
"character_orientation": "image",
"mode": "pro"
}'
200
{"id":"860260753860210752","task_id":"860260753860210752","object":"video","model":"kling-v3","status":"queued","progress":0,"created_at":1773130665}
Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Data exchange format. Use
application/json.Request parameters
string
required
Use
kling-3.0.string
required
Character image as URL or raw Base64.
string
required
Motion reference video URL.
string
Scene, motion, or camera guidance, up to 2,500 characters.
object[]
At most one element.
string
default:"yes"
Use
yes or no.string
required
Use
image or video.string
required
Use
std or pro.object
Platform watermark setting.
integer
required
Element ID from element management; at most one.
boolean
default:false
Add the platform watermark.
Create response
string
AnyFast task ID.
string
Task ID, equal to
id.string
Always
video.string
kling-v3.string
Initial task status.
integer
Initial progress.
integer
Creation Unix timestamp.
character_orientation: "image", the video may be 3–10 seconds; with video, it may be 3–30 seconds. Element references follow the video’s orientation.Complex or fast motion can produce a result shorter than the uploaded video because the model only extracts valid continuous action segments. Generation can proceed once at least 3 seconds of usable continuous motion is found. Credits consumed in this case are non-refundable, so reduce the motion complexity or speed when necessary.
Interactive request parameters
Fill in and test the complete motion-control request body.
Query task by ID
GET /kling/v1/videos/motion-control/{task_id}Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Data exchange format. Use
application/json.Path parameters
string
required
Motion-control task ID returned by the create endpoint.
cURL
curl --request GET \
--url https://www.anyfast.ai/kling/v1/videos/motion-control/TASK_ID \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
200
{
"code": 0,
"data": {
"created_at": 1784720894000,
"task_id": "asyntask_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task_result": {
"videos": [{
"duration": "5",
"url": "https://example.com/generated-video.mp4"
}]
},
"task_status": "succeed",
"updated_at": 1784721103000
},
"message": ""
}
Response fields
integer
0 indicates that the query was accepted.string
Error information; empty for a successful query.
string
Queried task ID.
string
submitted, processing, succeed, or failed.string
Failure details when the task fails.
object[]
Generated videos, returned after success.
string
Temporary generated-video URL.
string
Actual duration in seconds.
integer
Creation Unix timestamp in milliseconds.
integer
Last update Unix timestamp in milliseconds.
Element APIs
| Operation | Method and path |
|---|---|
| Create custom element | POST /kling/v1/general/advanced-custom-elements |
| Query custom element | GET /kling/v1/general/advanced-custom-elements/{task_id} |
| List preset elements | GET /kling/v1/general/advanced-presets-elements |
Create a custom element
cURL
curl --request POST \
--url https://www.anyfast.ai/kling/v1/general/advanced-custom-elements \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"element_name": "my-character",
"element_description": "The lead character",
"reference_type": "image_refer",
"element_image_list": {
"frontal_image": "https://example.com/front.png",
"refer_images": [
{"image_url": "https://example.com/side.png"}
]
},
"tag_list": [{"tag_id": "o_102"}]
}'
200
{
"id": "863121016086724692",
"task_id": "863121016086724692",
"object": "video",
"model": "kling-element",
"status": "queued",
"progress": 0,
"created_at": 1773812605
}
Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Use
application/json.Request body
string
required
Element name, up to 20 characters.
string
required
Element description, up to 100 characters.
string
required
image_refer for image references or video_refer for one reference video.object
Required when
reference_type is image_refer.string
Front-view image URL or raw Base64 without a data URI prefix.
object[]
One to three alternate-angle or close-up images.
string
Reference image URL or raw Base64.
object
Required when
reference_type is video_refer.object[]
Exactly one reference video.
string
Public MP4 or MOV URL. The video must be 3–8 seconds, 1080p, 16:9 or 9:16, and no larger than 200 MB.
string
Optional voice ID to bind to the element.
object[]
Element tags.
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.Create response
string
AnyFast task ID.
string
Task ID, identical to
id.string
Object type; currently
video.string
Fixed value
kling-element.string
Initial task status, normally
queued.integer
Task progress from 0 to 100.
integer
Creation Unix timestamp.
Query a custom element
GET /kling/v1/general/advanced-custom-elements/{task_id}cURL
curl --request GET \
--url https://www.anyfast.ai/kling/v1/general/advanced-custom-elements/TASK_ID \
--header 'Authorization: Bearer YOUR_API_KEY'
string
required
Task ID returned by the create endpoint.
data.task_status (submitted, processing, succeed, or failed). After success, read data.task_result.elements[]; each item includes element_id, name, description, reference media, optional voice information, tags, ownership, and status.List preset elements
GET /kling/v1/general/advanced-presets-elements?pageNum=1&pageSize=30cURL
curl --request GET \
--url 'https://www.anyfast.ai/kling/v1/general/advanced-presets-elements?pageNum=1&pageSize=30' \
--header 'Authorization: Bearer YOUR_API_KEY'
integer
default:1
Page number from 1 to 1,000.
integer
default:30
Items per page from 1 to 500.
data[]. Read each record’s preset elements from task_result.elements[]. Current preset elements return owned_by: "vod".This page strictly documents the Kling Legacy element API.
Voice APIs
| Operation | Method and path |
|---|---|
| Create custom voice | POST /kling/v1/general/custom-voices |
| Query custom voice | GET /kling/v1/general/custom-voices/{id} |
| List preset voices | GET /kling/v1/general/presets-voices |
Create and query
voice_name is at most 20 characters. Supply at least one of voice_url or video_id. A voice URL may point to MP3, WAV, MP4, or MOV containing one clean speaker for 5–30 seconds. A qualifying historical generated video can be supplied through video_id under the same audio constraints.cURL
curl --request POST \
--url https://www.anyfast.ai/kling/v1/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"
}'
200
{"id":"850087542757535834","task_id":"850087542757535834","object":"video","model":"kling-voices","status":"queued","progress":0,"created_at":1773812605}
Request headers
string
required
Bearer authentication in the form
Bearer YOUR_API_KEY.string
default:"application/json"
required
Data exchange format. Use
application/json.Request parameters
string
required
Custom voice name, up to 20 characters.
string
Public MP3, WAV, MP4, or MOV URL; at least one source is required.
string
Eligible historical generated-video ID; at least one source is required.
Create response
string
AnyFast task ID.
string
Task ID, identical to
id.string
Object type; currently
video.string
Fixed value
kling-voices.string
Initial task status, normally
queued.integer
Task progress from 0 to 100.
integer
Creation Unix timestamp.
Query custom voice
GET /kling/v1/general/custom-voices/{id}cURL
curl --request GET \
--url https://www.anyfast.ai/kling/v1/general/custom-voices/TASK_ID \
--header 'Authorization: Bearer YOUR_API_KEY'
string
required
Task ID returned by voice creation.
data.task_status. After success, data.task_result.voices[] contains voice_id, voice_name, trial_url, owned_by, and status.List preset voices
GET /kling/v1/general/presets-voices?pageNum=1&pageSize=30cURL
curl --request GET \
--url 'https://www.anyfast.ai/kling/v1/general/presets-voices?pageNum=1&pageSize=30' \
--header 'Authorization: Bearer YOUR_API_KEY'
integer
default:1
Page number, 1–1000.
integer
default:30
Items per page, 1–1000.
data[]; read voices from task_result.voices[]. Current preset voices return owned_by: "vod".Voice Management APIs
Open the interactive reference for each voice operation.
These references use Kling’s Legacy request structures. AnyFast adds the
/kling route prefix while retaining the Legacy endpoint names and request fields.