# Text-to-Video Generation V4 NEW

## 1. Task Submission
- https://api-gateway.skyreels.ai/api/v1/video/text2video/submit

Request Parameters
Parameter Name	Type	Required	Description	Default Value	Constraints
api_key	string	Yes	Used for account authentication and rate limiting.	N/A	-
prompt	string	Yes	The prompt describing the video to generate.	N/A	Max length: 1280 tokens.
duration	int	No	Duration of the generated video.	5	Minimum: 3 seconds, Maximum: 15 seconds.
aspect_ratio	string	No	Aspect ratio of the generated video.	16:9	Supported values: "16:9", "4:3", "1:1", "9:16", "3:4".
sound	bool	No	Whether the generated video includes sound effects.	False	-
mode	string	No	The quality/performance mode.	std	Supported values: "fast", "std", and "pro". "fast" offers faster generation, "std" balances speed and quality, and "pro" delivers higher quality. All modes output at 1080p. Currently, only "std" is supported; "fast" and "pro" support will be added later.
Response Parameters
Field Name	Type	Description
task_id	string	The task ID, used for subsequent queries.
msg	string	A message describing the result.
code	int	Status code (200 for success, 422 for parameter error, 500 for server error).
status	string	Status identifier ("ok" indicates success).
data	object	Response data, null on successful submission.
trace_id	string	Request trace ID.
Request Example
curl -X POST "https://api-gateway.skyreels.ai/api/v1/video/text2video/submit"   -H "Content-Type: application/json"   -d '{
    "api_key": "YOUR_API_KEY",
    "prompt": "A serene forest scene at sunset, with golden light filtering through the trees. Birds are chirping and a gentle breeze rustles the leaves.",
    "aspect_ratio": "16:9",
    "duration": 5,
    "sound": true,
    "mode": "std"
  }'



## 2. Task Query
- https://api-gateway.skyreels.ai/api/v1/video/text2video/task/{task_id}

Response Parameters
Field Name	Type	Description
task_id	string	The task ID.
msg	string	Status message (contains error info on failure).
code	int	Status code (200 for success, 422 for parameter error, 500 for server error).
status	string	Task status, includes: "submitted", "pending", "running", "failed", "unknown".
data	object	Contains video data on success, null for other statuses.
trace_id	string	Request trace ID.
Data Field Details (when status is "success"):
Field Name	Type	Description
video_url	string	URL of the generated video.
duration	int	Video duration in seconds.
resolution	string	Video resolution.
Request Example
curl -X GET "https://api-gateway.skyreels.ai/api/v1/video/text2video/task/{task_id}"
