Kling video (native format)
Generate Kling videos using Kling's own request format.
/kling/v1/videos/text2video
Use these endpoints if your code already speaks the official Kling API. The request body uses Kling's field names; RuToken forwards them to Kling and returns a task ID. For new integrations, the unified video API is simpler and works with every provider.
| Method | Path | Purpose |
|---|---|---|
POST |
/kling/v1/videos/text2video |
Text-to-video. |
POST |
/kling/v1/videos/image2video |
Image-to-video. |
GET |
/kling/v1/videos/text2video/{task_id} |
Query a text-to-video task. |
GET |
/kling/v1/videos/image2video/{task_id} |
Query an image-to-video task. |
Authentication
Send your RuToken key in the Authorization: Bearer sk-xxxx header. You do not need Kling access keys or JWT signing — the gateway handles that.
Request body
Content type: application/json. Fields not listed below are also passed through to Kling.
| Parameter | Type | Required | Description |
|---|---|---|---|
model_name |
string | Yes | Kling model, e.g. kling-v1, kling-v1-6, kling-v2-master. model is accepted as an alias. |
prompt |
string | Yes | Positive prompt, up to 2500 characters. Required by the gateway for both text-to-video and image-to-video. |
negative_prompt |
string | No | What to avoid in the video. |
image |
string | Image-to-video | First frame as a URL or Base64 string (without the data: prefix). When present, the task is image-to-video. |
image_tail |
string | No | Last frame as a URL or Base64 string. |
mode |
string | No | std (default) or pro. |
duration |
string | No | "5" (default) or "10". Must be a string. |
aspect_ratio |
string | No | 16:9, 9:16 or 1:1. Text-to-video only. |
cfg_scale |
number | No | Prompt adherence from 0 to 1. Default 0.5. |
camera_control |
object | No | Camera movement, as defined by Kling (type, config). |
static_mask / dynamic_masks |
string / array | No | Motion brush masks for image-to-video. |
external_task_id |
string | No | Your own task ID, stored by Kling. |
Request example
curl https://rutoken.ai/kling/v1/videos/text2video \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model_name": "kling-v1",
"prompt": "A red fox running through a snowy forest, slow motion",
"negative_prompt": "blurry",
"mode": "std",
"duration": "5",
"aspect_ratio": "16:9"
}'
Image-to-video:
curl https://rutoken.ai/kling/v1/videos/image2video \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model_name": "kling-v1",
"image": "https://example.com/portrait.jpg",
"prompt": "The person smiles and waves at the camera",
"duration": "5"
}'
Response
{
"id": "task_6Fh2kVb0mQ9xYzA1pL3sT8uWcR4nE7dJ",
"task_id": "task_6Fh2kVb0mQ9xYzA1pL3sT8uWcR4nE7dJ",
"object": "video",
"model": "kling-v1",
"status": "queued",
"progress": 0,
"created_at": 1760000000
}
Use task_id to query the task. It is a RuToken task ID, not the Kling task ID.
Query a task
curl https://rutoken.ai/kling/v1/videos/text2video/task_6Fh2kVb0mQ9xYzA1pL3sT8uWcR4nE7dJ \
-H "Authorization: Bearer $API_KEY"
{
"code": "success",
"message": "",
"data": {
"task_id": "task_6Fh2kVb0mQ9xYzA1pL3sT8uWcR4nE7dJ",
"action": "textGenerate",
"status": "SUCCESS",
"progress": "100%",
"fail_reason": "",
"result_url": "https://example.com/kling/output.mp4",
"submit_time": 1760000000,
"finish_time": 1760000150,
"data": { "code": 0, "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://example.com/kling/output.mp4", "duration": "5" } ] } } }
}
}
The response format and status values (SUBMITTED, QUEUED, IN_PROGRESS, SUCCESS, FAILURE) are the same as for GET /v1/video/generations/{task_id}; data.data contains Kling's original task response. The task can also be queried through GET /v1/video/generations/{task_id} or GET /v1/videos/{task_id}.
See also: Errors.