Text-to-Video: create a video generation task from a text prompt
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "happyhorse-1.0-t2v",
"input": {
"prompt": "A cat running across a meadow, bright sunshine, camera following, cinematic lighting"
}
}
'{
"output": {
"task_id": "hh-12ab34cd-...",
"task_status": "PENDING"
},
"request_id": "..."
}HappyHorse1.0 Video Generation (Alibaba)
HappyHorse Text-to-Video API Reference
HappyHorse-1.0-t2v Text-to-Video API reference and online debugging: generate video from a pure text prompt, DashScope async passthrough endpoint.
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
Text-to-Video: create a video generation task from a text prompt
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "happyhorse-1.0-t2v",
"input": {
"prompt": "A cat running across a meadow, bright sunshine, camera following, cinematic lighting"
}
}
'{
"output": {
"task_id": "hh-12ab34cd-...",
"task_status": "PENDING"
},
"request_id": "..."
}Documentation Index
Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
Use this file to discover all available pages before exploring further.
You can debug directly in the Playground on the right: fill in Authorization with
Bearer sk-your-api-key, set model / input / parameters, then send the request. A successful submission returns a task_id; see below for polling and downloading.This page covers the create endpoint for
happyhorse-1.0-t2v (Text-to-Video) and needs only a text prompt. For the complete async flow, status table, and Python client, see the HappyHorse Overview.- The create request must go to
/wan/api/v1/services/aigc/video-generation/video-synthesiswith the request headerX-DashScope-Async: enable. Do not use/v1/videos. durationmust be an integer (5, not"5"); writeresolutionin uppercase720P.
Code Examples
curl -X POST "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis" \
-H "X-DashScope-Async: enable" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "happyhorse-1.0-t2v",
"input": {
"prompt": "A cat running across a meadow, bright sunshine, camera following, cinematic lighting"
},
"parameters": {
"resolution": "720P",
"duration": 5,
"prompt_extend": true,
"watermark": true
}
}'
Parameter Quick Reference
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
model | string | ✓ | — | Fixed to happyhorse-1.0-t2v |
input.prompt | string | ✓ | — | Text prompt; describe scene, camera movement, lighting, and style |
parameters.resolution | string | 720P | 720P / 1080P (uppercase) | |
parameters.duration | int | 5 | Integer of 2–15 seconds | |
parameters.prompt_extend | bool | true | Smart rewriting, recommended on | |
parameters.watermark | bool | false | ”AI Generated” watermark in the bottom-right corner | |
parameters.seed | int | random | 0–2147483647, fix for reproducibility |
Response Format
A successful creation returns atask_id (not the video itself):
{
"output": { "task_id": "...", "task_status": "PENDING" },
"request_id": "..."
}
After submission, you must poll
GET /v1/tasks/{task_id} until status: "completed", then download the mp4 from the result_url in the response. When downloading, do not include the Authorization header (it’s a signed OSS direct link), and result_url expires in 24 hours by default. See the full polling loop in HappyHorse Overview · Async Call Flow.Authorizations
The API Key obtained from the APIYI Console
Headers
Async processing switch, must be set to enable
Available options:
enable Body
application/json
Was this page helpful?
⌘I