Kling 3.0
Endpoint
POST /videos/generations
Full URL: https://modelfold.ai/v1/videos/generations
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.
Input parameters for the generation task
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name. Must be kling-3.0/video. Default:"kling-3.0/video"。 Allowed values:kling-3.0/video。 Example:kling-3.0/video。 |
prompt | string | Yes | Prompt required by the ModelFold gateway; at most 2000 characters. Required when multi_shots is false. Up to 2,500 characters. maxLength: 2000. Example:In a bright rehearsal room, sunlight streams through the window@element_dog。 |
image_urls | array<string> | No | First and last frame image URLs. Optional; not required when using kling_elements. When multi_shots is false: if length is 2, index 0 is the first frame and index 1 is the last frame; if length is 1, the array item serves as the first frame. When multi_shots is true: only the first frame is supported. |
sound | boolean | Yes | Required. Whether to generate audio (speech, sound effects, ambience) with the video. Affects price. Example:true。 |
duration | string | Yes | Required. Video duration in seconds, 3–15 (string, e.g. "5"). In multi-shot mode, output length and billing follow the sum of multi_prompt[].duration (3–15 s); set duration to the same total. Allowed values:3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15。 Example:5。 |
aspect_ratio | string | No | Optional when image_urls is provided (the output follows the first frame's aspect ratio). For text-to-video, set it explicitly: 16:9, 9:16 or 1:1. Allowed values:16:9 / 9:16 / 1:1。 Example:16:9。 |
mode | string | Yes | Required. Generation mode. std has standard resolution, pro has higher resolution, 4K has 4K resolution. Resolution mapping: - std mode: 16:9 (1280×720), 9:16 (720×1280), 1:1 (720×720) - pro mode: 16:9 (1920×1080), 9:16 (1080×1920), 1:1 (1080×1080) - 4K mode: 16:9 (3840×2160), 9:16 (2160×3840), 1:1 (2160×2160) Allowed values: std / pro / 4K。 Example:pro。 |
multi_shots | boolean | Yes | Required. Whether to use multi-shot mode. true enables multi-shot mode, false enables single-shot mode. Example:false。 |
multi_prompt | array<object> | No | Shot prompts. Takes effect when multi_shots is true. Used to describe the text and duration of each shot. Supports up to 5 shots. Each shot duration is 1-12 seconds. If you need to use elements, add them after the prompt. |
multi_prompt[].prompt | string | Yes | Prompt text for this shot, a maximum of 500 characters per shot. Each @element will occupy 37 characters. maxLength: 500. Example:a happy dog in running@element_cat。 |
multi_prompt[].duration | integer | Yes | Duration of this shot in seconds. Range: 1-12. minimum: 1. maximum: 12. Example:3。 |
kling_elements | array<object> | No | Referenced elements. Detailed information about elements referenced in the prompt. A single task can reference a maximum of three elements. maxItems: 3. |
kling_elements[].name | string | Yes | Element name, used in prompt with @ prefix (e.g., @element_dog) Example:element_dog。 |
kling_elements[].description | string | Yes | Element description Example:dog。 |
kling_elements[].element_input_urls | array<string> | Yes | Either 2–4 images (JPG/PNG, up to 10 MB each) or 1 video (MP4/MOV). |
kling_elements[].element_input_audio_urls | array<string> | No | Optional. List of audio material URLs for characters. The audio duration must be between 5 and 30 seconds. |
kling_elements[].start_time | integer | No | Start time for video character material capture (in milliseconds). Only effective when uploading videos through element_input_urls. If not uploaded, it defaults to 0. |
kling_elements[].end_time | integer | No | End time for video character material capture (in milliseconds). Only effective when uploading videos through element_input_urls. Must be greater than start_time, and the difference between end_time and start_time must be within 3000 to 8000 milliseconds. |
Request Example
bash
curl -X POST "https://modelfold.ai/v1/videos/generations" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-3.0/video",
"sound": true,
"duration": "5",
"mode": "pro",
"multi_shots": false,
"prompt": "In a bright rehearsal room, sunlight streams through the window@element_dog"
}'json
{
"model": "kling-3.0/video",
"sound": true,
"duration": "5",
"mode": "pro",
"multi_shots": false,
"prompt": "In a bright rehearsal room, sunlight streams through the window@element_dog"
}Response
200 — Generation completed. usage contains actual billing details; result URLs are illustrative.
json
{
"ok": true,
"created": 1792134000,
"data": [
{
"url": "https://modelfold.ai/uploads/outputs/result.mp4"
}
],
"usage": {}
}