Skip to content

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

FieldTypeRequiredDescription
modelstringYesModel name, supports wan2.6-t2v, wan2.5-t2v-preview
input.promptstringYesText prompt describing expected video elements and visual characteristics
input.audio_urlstringNoAudio file URL, supports wav/mp3, duration 3-30 seconds, file size up to 15MB
input.negative_promptstringNoNegative prompt describing undesired content
parameters.sizestringYesVideo resolution in width*height format, default 1920*1080, available values depend on model
parameters.prompt_extendbooleanNoWhether to enable prompt rewriting, default true
parameters.durationintegerYesVideo duration in seconds, available options depend on model
parameters.shot_typestringNoShot type, single or multi, only effective when prompt_extend=true
parameters.seedintegerNoRandom 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

FieldTypeDescription
request_idstringRequest ID
outputobjectOutput task information
output.task_idstringTask ID
output.task_statusstringTask status

Response Example (200)

json
{
  "request_id": "9f829e8a-6db3-4998-8515-134223f0fc11",
  "output": {
    "task_id": "ac22cbc8-3fb3-45b6-9091-d8a7b41650bc",
    "task_status": "PENDING"
  }
}