Light Mode
Generate Video
POST
/api/v1/taskHailuo API provides video generation services with various models supporting text-to-video and image-to-video conversions.
Pricing
Model | Price (USD) | Special Requirements |
---|---|---|
t2v-01 | $0.20 | None |
i2v-01 | $0.20 | None |
i2v-01-live | $0.20 | None |
s2v-01 | $0.30 | Must detect human face in input image |
Model Requirements
Text-to-Video (t2v-01, t2v-01-director)
- Required fields:
prompt
- Optional fields:
expand_prompt
image_url
should not be provided
Image-to-Video (i2v-01, i2v-01-live)
- Required fields:
image_url
- Optional fields:
prompt
,expand_prompt
Subject Reference Video (s2v-01)
- Required fields:
prompt
,image_url
- Optional fields:
expand_prompt
- Input image must contain detectable human face
- Higher pricing tier ($0.30 per generation)
Input Constraints
Text Prompt (prompt
)
- Maximum length: 2000 characters
- Required for: t2v-01, s2v-01
- Optional for: i2v-01, i2v-01-live
Image Requirements (image_url
)
- File formats: JPG, PNG only
- Size limit: 10MB maximum
- Dimensions:
- Minimum: 300px (width or height)
- Maximum: 4096px (width or height)
- Aspect ratio: Must be between 2:5 and 5:2
- Required for: i2v-01, i2v-01-live, s2v-01
Configuration Options
Service Mode
- Currently only supports
"public"
mode (or Pay-As-You-Go)
Important Notes
For s2v-01 model:
- Face detection is mandatory in the input image
- Failed face detection will result in task failure
- Higher price ($0.30 vs $0.20 for other models)
Image processing:
- All dimensions must be within 300px to 4096px range
- Aspect ratio must be between 2:5 and 5:2
- Only JPG and PNG formats are accepted
- Images larger than 10MB will be rejected
Billing:
- Cost is calculated per generation
- Charges are applied upon successful task completion only
Request
Header Params
x-api-key
string
optional
Body Params application/json
model
enum<string>
required
Model name, currently only supports 'hailuo'
Allowed value:
hailuo
task_type
enum<string>
required
Task type, currently only supports 'video_generation'
Allowed value:
video_generation
input
object
required
prompt
string
optional
Required for t2v-01,t2v-01-director and s2v-01 models. Text prompt for video generation.
<= 2000 characters
model
enum<string>
required
Model type for video generation
Allowed values:
i2v-01i2v-01-livet2v-01s2v-01t2v-01-director
image_url
string <uri>
optional
Required for i2v-01, i2v-01-live, and s2v-01 models. Image URL must be jpg/png, 300px-4096px, aspect ratio between 2:5 and 5:2, max 10MB
expand_prompt
boolean
optional
Whether to expand the input prompt
config
object
required
service_mode
enum<string>
required
Service mode for the request
Allowed value:
public
webhook_config
object
optional
Example
{
"model": "hailuo",
"task_type": "video_generation",
"input": {
"prompt": "string",
"model": "i2v-01",
"image_url": "http://example.com",
"expand_prompt": true
},
"config": {
"service_mode": "public",
"webhook_config": {
"endpoint": "http://example.com",
"secret": "string"
}
}
}
Request samples
Responses
OK(200)
HTTP Code: 200
Content Type : JSONapplication/json
Successful response
Data Schema
code
enum<integer>
required
Response status code
Allowed value:
200
message
string
required
Response message
data
object
required
task_id
string <uuid>
required
Unique task identifier
model
string
required
Model used for generation
task_type
string
required
Type of task performed
status
string
required
Current status of the task
config
object
optional
input
object
required
output
object
required
meta
object
required
error
object
optional
Example
{
"code": 200,
"message": "string",
"data": {
"task_id": "736fde4d-9029-4915-8189-01353d6982cb",
"model": "string",
"task_type": "string",
"status": "string",
"config": {},
"input": {},
"output": {
"percent": 0,
"cover_url": "http://example.com",
"video_url": "http://example.com",
"download_url": "http://example.com",
"desc": "string",
"prompt_img_url": "string",
"status": 0,
"user_origin_prompt": true,
"width": 0,
"height": 0,
"model_id": "string",
"message": "string"
},
"meta": {
"created_at": "2019-08-24T14:15:22.123Z",
"started_at": "2019-08-24T14:15:22.123Z",
"ended_at": "2019-08-24T14:15:22.123Z",
"usage": {
"type": "string",
"frozen": 0,
"consume": 0
},
"is_using_private_pool": true
},
"error": {
"code": 0,
"raw_message": "string",
"message": "string",
"detail": {}
}
}
}
Last modified: 2 days ago