Text-to-Video
/api/v1/video/generationHeader Parameters
Format: Authorization: Bearer sk-xxxxxx
Request Body
application/json
Model names, supported: kling-v1-6 kling-v2 kling-v2-1-master kling-v2-5-turbo kling-v2-6
Fixed value t2v
Prompt, maximum length 2500 characters
Negative Prompt
Video duration, in seconds, supported values: 5, 10
Aspect ratio, default 16:9, supported: 9:16, 16:9, 1:1
Degree of freedom, default 0.5, range [0, 1]; the higher the value, the lower the model's degree of freedom and the stronger the relevance to the prompt.
Generation mode (supported by kling-v1-6 and kling-v2, not supported by other models), default: std, supported values: std, pro
Mode (only supported by kling-v2-5-turbo and kling-v2-6), default: pro, supported: pro
Audio switch (only supported by kling-v2-6), default: off, supported values: off, on
Response Body
application/json
Success
TypeScript Definitions
Use the response body type in TypeScript.
Status Code
Data Object
Result Set
Usage Information
Number of Images
Video Duration in Seconds
Input Token Count
Total Tokens
Output Token Count
Validity Period
Task ID
Task Status
Status Information
Request ID
curl -X POST "https://api.ygw.ai/api/v1/video/generation" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "_action": "string" }'{
"code": 0,
"data": {
"urls": [
"string"
],
"usage": {
"images": 0,
"seconds": 0,
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0
},
"expired": "string",
"task_id": "string",
"task_status": "string"
},
"message": "string",
"request_id": "string"
}