Text-to-Video
Ali Bailian text-to-video API for generating videos from text prompts.
Overview
- Method:
POST - Path:
/task/bailian/text2video - Content-Type:
application/json - Category: Video Models (Video) / Ali Bailian
Authentication
- Header:
Authorization: Bearer <token>
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name, supports wan2.6-t2v, wan2.5-t2v-preview |
| input.prompt | string | Yes | Text prompt describing expected video elements and visual characteristics |
| input.audio_url | string | No | Audio file URL, supports wav/mp3, duration 3-30 seconds, file size up to 15MB |
| input.negative_prompt | string | No | Negative prompt describing undesired content |
| parameters.size | string | Yes | Video resolution in width*height format, default 1920*1080, available values depend on model |
| parameters.prompt_extend | boolean | No | Whether to enable prompt rewriting, default true |
| parameters.duration | integer | Yes | Video duration in seconds, available options depend on model |
| parameters.shot_type | string | No | Shot type, single or multi, only effective when prompt_extend=true |
| parameters.seed | integer | No | Random seed, range [0, 2147483647] |
Request Example
curl Example
bash
curl -X POST "https://api.gpt.ge/task/bailian/text2video" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN" \
-d '{
"model": "wan2.6-t2v",
"input": {
"prompt": "An epic cute scene. A small adorable cartoon kitten general wearing detailed golden armor and a slightly oversized helmet bravely stands on a cliff. Riding a small but courageous warhorse, it recites: The Qinghai clouds darken the snowy mountains, the lonely city overlooks the Jade Gate Pass. After hundreds of battles in yellow sand, the golden armor will not return without breaking Loulan. Below the cliff, a massive army of mice charges forward with makeshift weapons. This is a dramatic large-scale battle scene inspired by ancient Chinese war epics. Snowy mountains rise in the distance, clouds roll across the sky without blocking the sunlight. The atmosphere is a humorous yet epic blend of cute and majestic.",
"audio_url": "https://example.com/audio.mp3"
},
"parameters": {
"size": "1280*720",
"prompt_extend": true,
"duration": 5,
"shot_type": "single"
}
}'JavaScript (fetch) Example
javascript
fetch('https://api.gpt.ge/task/bailian/text2video', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
model: 'wan2.6-t2v',
input: {
prompt: 'An epic cute scene. A small adorable cartoon kitten general wearing detailed golden armor and a slightly oversized helmet bravely stands on a cliff. Riding a small but courageous warhorse, it recites: "The Qinghai clouds darken the snowy mountains, the lonely city overlooks the Jade Gate Pass. After hundreds of battles in yellow sand, the golden armor will not return without breaking Loulan." Below the cliff, a massive army of mice charges forward with makeshift weapons. This is a dramatic large-scale battle scene inspired by ancient Chinese war epics. Snowy mountains rise in the distance, clouds roll across the sky without blocking the sunlight. The atmosphere is a humorous yet epic blend of cute and majestic.',
audio_url: 'https://example.com/audio.mp3'
},
parameters: {
size: '1280*720',
prompt_extend: true,
duration: 5,
shot_type: 'single'
}
})
})
.then(res => res.json())
.then(console.log)Python (requests) Example
python
import requests
payload = {
'model': 'wan2.6-t2v',
'input': {
'prompt': 'An epic cute scene. A small adorable cartoon kitten general wearing detailed golden armor and a slightly oversized helmet bravely stands on a cliff. Riding a small but courageous warhorse, it recites: "The Qinghai clouds darken the snowy mountains, the lonely city overlooks the Jade Gate Pass. After hundreds of battles in yellow sand, the golden armor will not return without breaking Loulan." Below the cliff, a massive army of mice charges forward with makeshift weapons. This is a dramatic large-scale battle scene inspired by ancient Chinese war epics. Snowy mountains rise in the distance, clouds roll across the sky without blocking the sunlight. The atmosphere is a humorous yet epic blend of cute and majestic.',
'audio_url': 'https://example.com/audio.mp3'
},
'parameters': {
'size': '1280*720',
'prompt_extend': True,
'duration': 5,
'shot_type': 'single'
}
}
resp = requests.post(
'https://api.gpt.ge/task/bailian/text2video',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
json=payload
)
print(resp.json())Response Fields
| Field | Type | Description |
|---|---|---|
| request_id | string | Request ID |
| output | object | Output task information |
| output.task_id | string | Task ID |
| output.task_status | string | Task status |
Response Example (200)
json
{
"request_id": "9f829e8a-6db3-4998-8515-134223f0fc11",
"output": {
"task_id": "ac22cbc8-3fb3-45b6-9091-d8a7b41650bc",
"task_status": "PENDING"
}
}