Skip to content
中文
Hailuo · Model API

Hailuo 02 API

Hailuo 02 API with VezAPI. Explore model capabilities, credit pricing, request parameters, and integration examples.

Text to VideoImage to Video

Hailuo 02 API documentation

Integrate Hailuo 02 with your VezAPI key. The operations below share the same authentication and account balance.

Base URL: https://api.vezapi.com
Send Authorization: Bearer YOUR_VEZAPI_KEY. Use a unique Idempotency-Key for each submission; reuse it only when checking the same request.

Hailuo Pro Image to Video

POST/api/v1/jobs/createTask

Model IDs: hailuo/02-image-to-video-pro

ParameterTypeDescription & constraints
model
required
string

The model name to use for generation. Required field. - Must be `hailuo/02-image-to-video-pro` for this endpoint

Values: "hailuo/02-image-to-video-pro"

Default: "hailuo/02-image-to-video-pro"

callBackUrl
optional
string

The URL to receive generation task completion updates. Optional but recommended for production use. - System will POST task status and results to this URL when generation completes - Callback includes generated content URLs and task information - Your callback endpoint should accept POST requests with JSON payload containing results - Alternatively, use the Get Task Details endpoint to poll task status - To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification) for signature verification implementation

input
required
object

Input parameters for the generation task

input.prompt
required
string

Text prompt describing the desired video animation (Max length: 1500 characters)

maxLength: 1500

input.image_url
required
string

Input image to animate (File URL after upload, not file content; Accepted types: image/jpeg, image/png, image/webp; Max size: 10.0MB)

input.end_image_url
optional
string

Optional URL of the image to use as the last frame of the video (File URL after upload, not file content; Accepted types: image/jpeg, image/png, image/webp; Max size: 10.0MB)

input.prompt_optimizer
optional
boolean

Whether to use the model's prompt optimizer (Boolean value (true/false))

input.nsfw_checker
optional
boolean

Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "hailuo/02-image-to-video-pro",
  "input": {
    "prompt": "Cinematic wide shot: A colossal starship drifts silently above the rings of Saturn, its metallic hull reflecting streaks of cosmic light. The camera pushes closer, revealing thousands of illuminated windows like a floating city. Smaller fighter crafts dart across the frame, leaving neon trails as they maneuver through the vastness of space. A sudden burst of thrusters scatters asteroid fragments in slow motion, glowing faintly as they collide and drift apart.",
    "image_url": "https://example.com/input.png"
  }
}'
Responses and errors

HTTP 200

Request successful

ParameterTypeDescription & constraints
code
optional
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description upon failure

data
required
object
data.taskId
required
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Hailuo Standard Image to Video

POST/api/v1/jobs/createTask

Model IDs: hailuo/02-image-to-video-standard

ParameterTypeDescription & constraints
model
required
string

The model name to use for generation. Required field. - Must be `hailuo/02-image-to-video-standard` for this endpoint

Values: "hailuo/02-image-to-video-standard"

Default: "hailuo/02-image-to-video-standard"

callBackUrl
optional
string

The URL to receive generation task completion updates. Optional but recommended for production use. - System will POST task status and results to this URL when generation completes - Callback includes generated content URLs and task information - Your callback endpoint should accept POST requests with JSON payload containing results - Alternatively, use the Get Task Details endpoint to poll task status - To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification) for signature verification implementation

input
required
object

Input parameters for the generation task

input.prompt
required
string

The text prompt describing the video to generate (Max length: 1500 characters)

maxLength: 1500

input.image_url
required
string

The URL of the image to use as the first frame of the video (File URL after upload, not file content; Accepted types: image/jpeg, image/png, image/webp; Max size: 10.0MB)

input.end_image_url
optional
string

Optional URL of the image to use as the last frame of the video (File URL after upload, not file content; Accepted types: image/jpeg, image/png, image/webp; Max size: 10.0MB)

input.duration
required
string

Required. Video duration in seconds: 6 or 10.

Values: "6", "10"

input.resolution
required
string

Required. The resolution of the generated video.

Values: "512P", "768P"

input.prompt_optimizer
optional
boolean

Whether to use the model's prompt optimizer (Boolean value (true/false))

input.nsfw_checker
optional
boolean

Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "hailuo/02-image-to-video-standard",
  "input": {
    "prompt": "Epic aerial shot: A lone samurai stands atop a jagged mountain peak as a storm of sakura petals is swept across the wind. Behind him, the sky is split in two — half daylight, half night. The shot pulls back to reveal that the mountain is actually the curved back of a sleeping dragon that spans across the horizon. Lightning crackles in the distance as the dragon'\''s eye slowly opens, glowing with ancient magic. The samurai doesn’t flinch; he lowers his straw hat and places his hand on the hilt of his blade.",
    "image_url": "https://example.com/input.png",
    "duration": "10",
    "resolution": "768P"
  }
}'
Responses and errors

HTTP 200

Request successful

ParameterTypeDescription & constraints
code
optional
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description upon failure

data
required
object
data.taskId
required
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Hailuo Pro Text to Video

POST/api/v1/jobs/createTask

Model IDs: hailuo/02-text-to-video-pro

ParameterTypeDescription & constraints
model
required
string

The model name to use for generation. Required field. - Must be `hailuo/02-text-to-video-pro` for this endpoint

Values: "hailuo/02-text-to-video-pro"

Default: "hailuo/02-text-to-video-pro"

callBackUrl
optional
string

The URL to receive generation task completion updates. Optional but recommended for production use. - System will POST task status and results to this URL when generation completes - Callback includes generated content URLs and task information - Your callback endpoint should accept POST requests with JSON payload containing results - Alternatively, use the Get Task Details endpoint to poll task status - To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification) for signature verification implementation

input
required
object

Input parameters for the generation task

input.prompt
required
string

The text prompt for video generation (Max length: 1500 characters)

maxLength: 1500

input.prompt_optimizer
optional
boolean

Whether to use the model's prompt optimizer (Boolean value (true/false))

input.nsfw_checker
optional
boolean

Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "hailuo/02-text-to-video-pro",
  "input": {
    "prompt": "High top angle wide mid close-up tracking shot, flying very fast two meters high over prehistoric ferns and moss-covered ground, dominated by a real young boy (pink t-shirt, pink shorts, white shoes, white long socks), with his back to the camera, body stretched out, gliding smoothly forward, flying in the air, casting a clear shadow on the terrain below. His legs and body are high above the surface, his feet not touching the ground, soaring in a Superman pose. The background is a vast Jurassic valley, filled with dense, ancient jungle vegetation and towering cycads. In the distance, rugged volcanic mountains rise with a winding path cutting through. Massive, slow-moving sauropods graze far off on the horizon. Large, fluffy white clouds float in the vibrant blue sky. Strong dynamic motion blur adds a vivid sense of high-speed flight and deep cinematic perspective. Realistic image –raw."
  }
}'
Responses and errors

HTTP 200

Request successful

ParameterTypeDescription & constraints
code
optional
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description upon failure

data
required
object
data.taskId
required
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Hailuo Standard Text to Video

POST/api/v1/jobs/createTask

Model IDs: hailuo/02-text-to-video-standard

ParameterTypeDescription & constraints
model
required
string

The model name to use for generation. Required field. - Must be `hailuo/02-text-to-video-standard` for this endpoint

Values: "hailuo/02-text-to-video-standard"

Default: "hailuo/02-text-to-video-standard"

callBackUrl
optional
string

The URL to receive generation task completion updates. Optional but recommended for production use. - System will POST task status and results to this URL when generation completes - Callback includes generated content URLs and task information - Your callback endpoint should accept POST requests with JSON payload containing results - Alternatively, use the Get Task Details endpoint to poll task status - To ensure callback security, see [Webhook Verification Guide](/common-api/webhook-verification) for signature verification implementation

input
required
object

Input parameters for the generation task

input.prompt
required
string

Text description for video generation (Max length: 1500 characters)

maxLength: 1500

input.duration
required
string

Required. Video duration in seconds: 6 or 10.

Values: "6", "10"

input.prompt_optimizer
optional
boolean

Whether to use the model's prompt optimizer (Boolean value (true/false))

input.nsfw_checker
optional
boolean

Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

Request example
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "hailuo/02-text-to-video-standard",
  "input": {
    "prompt": "A llama and a raccoon battle it out in an intense table tennis match, inside a roaring Olympic stadium. Slow-mo, wild angles, full comedy mode.",
    "duration": "6"
  }
}'
Responses and errors

HTTP 200

Request successful

ParameterTypeDescription & constraints
code
optional
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

Values: 200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
optional
string

Response message, error description upon failure

data
required
object
data.taskId
required
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Task status and callbacks

For asynchronous tasks, keep the returned taskId. Query GET /api/v1/jobs/recordInfo?taskId=... or provide callBackUrl when creating the task. Only the account that created a task can access it or derive new resources from it.

A timeout can mean the submission was accepted. Inspect the existing request in your dashboard; do not create another task automatically. Callback delivery is retried and may arrive more than once. Deduplicate with X-VezAPI-Event-Id.

Files, logs and billing

Generated media normally follows a 14-day provider lifetime; uploaded files expire after 24 hours. Save the files you need before expiration. VezAPI streams registered files without keeping a permanent media library. Request logs are retained for two calendar months.

Credits are reserved before submission. Final deductions match actual discounted consumption one for one. Unknown usage pauses new paid requests. If available funds cannot cover final usage while protecting other reservations, settlement stays pending until funded; model usage cannot make the wallet negative. Time-based inputs require server-side metadata reads; a failed read prevents submission.

Open full documentation →

Hailuo 02 API pricing

Rates below are reference estimates; final deductions equal actual discounted consumption, one for one. At the standard pack rate, 1,000 credits ≈ $10. Larger packs reduce the effective credit price.

SpecificationCreditsUnitUSD reference
hailuo 02, image-to-video, Standard-6.0s-768p30per video$0.3
hailuo 02, text-to-video, Standard-10.0s-768p50.0per video$0.5
hailuo 02, image-to-video, Standard-10.0s-512p20.0per video$0.2
hailuo 02, image-to-video, Standard-10.0s-768p50.0per video$0.5
hailuo 02, text-to-video, Standard-6.0s-768p30.0per video$0.3
hailuo 02, image-to-video, Standard-6.0s-512p12.0per video$0.12
hailuo 02, image-to-video, Pro-6.0s-1080p57.0per video$0.57
hailuo 02, text-to-video, Pro-6.0s-1080p57.0per video$0.57