AI Video Generation
Generate a 1–15 second video from a text description, optionally with one reference image, optionally keeping the model-generated sound (ambience, effects, etc.).
- Billed per second, in two tiers: 768p and 480p. The duration is pre-charged when the task is created and fully refunded if generation fails.
- Result videos carry the implicit AI-generated content label (
TC260:AIGC in file metadata). See AI-Generated Content Labeling.
- One clip usually takes a few minutes.
Create Task
Basics
| Item | Value |
|---|
| Method | POST |
| Path | /task/video_generate |
| Content-Type | application/json |
| Auth | Authorization header (the API key itself) |
Request Body
| Name | Type | Required | Default | Description |
|---|
prompt | string | Yes | — | What to show: scene, motion, camera movement and sound. 1–5000 characters after trimming |
image_file_id | string | No | — | Reference image: the file ID of an uploaded image (png / jpg / jpeg / webp). See Reference image |
duration | integer | No | 5 | Length in seconds, 1–15 |
resolution | string | No | 768p | 768p / 480p; sets the price, see Pricing |
aspect_ratio | string | No | see note | 16:9 / 9:16. If omitted: the closest match to the reference image when one is given, otherwise 16:9 |
audio | boolean | No | true | Keep the model-generated sound; false removes the audio track |
engine | string | No | h3 | Engine; currently only h3 |
Request Examples
Text only:
curl -X POST https://api.ai-mcn.tv:10000/task/video_generate \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "A paper boat drifting down a rainy street at night, slow dolly in, soft rain sound", "duration": 5}'
With a reference image (upload it first via File Upload to get its file_id):
curl -X POST https://api.ai-mcn.tv:10000/task/video_generate \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "The bronze statue stands among green trees, a breeze moves the leaves, the camera slowly pushes in", "image_file_id": "537489015178246", "duration": 6, "resolution": "480p"}'
Success Response
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"task_type": "video_generate",
"status": "queued"
}
}
With resolution set to 480p the task_type is video_generate_480p; both tiers use the same query endpoint.
Query Task Result
Basics
| Item | Value |
|---|
| Method | GET |
| Path | /task/video_generate/{task_id} |
| Auth | Authorization header (the API key itself) |
Response Fields (output_result)
| Name | Type | Description |
|---|
file_id | string | Video file ID |
download_url | string | Video download path (mp4) |
duration | number | Measured length in seconds |
width / height | integer | Measured size |
has_audio | boolean | Whether the video has an audio track |
engine | string | Engine used |
resolution | string | Resolution used |
aspect_ratio | string | Aspect ratio actually used (the default, or the one derived from the reference image) |
Success Response
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"status": "completed",
"progress": 100,
"output_result": {
"file_id": "537489015178248",
"download_url": "/download/a1/output.mp4",
"duration": 5.04,
"width": 1344,
"height": 768,
"has_audio": true,
"engine": "h3",
"resolution": "768p",
"aspect_ratio": "16:9"
},
"create_time": "2026-11-11T08:00:00Z",
"update_time": "2026-11-11T08:04:10Z"
}
}
Reference Image
- The reference image sets the subject, composition and style. Write the prompt to match the image (describe only the motion, camera movement and sound that start from that frame) and the first frame will show the same picture, though not pixel-identical.
- If the prompt describes a scene that conflicts with the image, the prompt wins and the first frame may look nothing like the image.
- Use a reference image with the same aspect ratio as
aspect_ratio (16:9 or 9:16); otherwise it is cropped.
Pricing
| Resolution | Price | One 5-second clip |
|---|
768p | 90 credits per second | 450 credits |
480p | 60 credits per second | 300 credits |
- The billing unit is seconds; the price list shows the same per-second prices as above.
duration is pre-charged on creation; failed generations (including moderation rejections) are fully refunded.
- No free quota and no bundle; charged from the balance only.
Data Handling
Prompts and reference images are processed by a third-party video generation model service in mainland China.
Error Codes
| Code | HTTP | Meaning | What to do |
|---|
6016 | 400 | Invalid value (empty or too long prompt; duration / resolution / aspect_ratio / audio / engine out of range; image_file_id not a string) | No task is created and nothing is charged; fix the parameter |
FILE_NOT_FOUND | 400 | The reference image does not exist | No task, no charge |
TYPE_NOT_MATCH | 400 | The reference image is not png / jpg / jpeg / webp | No task, no charge |
6065 | — | The prompt or reference image was rejected by the model service's content moderation (returned when the task fails) | Fully refunded; adjust the prompt or image and retry |
Usage Restrictions
- Do not generate content that impersonates others, infringes on others' rights, or violates laws and regulations.
- When publishing generated videos, label them as AI-generated as required by the platform.