PiAPI
HomeWorkspace
HomeWorkspace
Join Discord
  1. Hailuo
  • Get Started
    • Overview
    • Quickstart
    • Make Instruction: How to Use PiAPI to Build a Workflow on Make?
  • Endpoints
    • Song(Udio)
      • Song API Task Creation Examples
      • [Udio] Song Extend
      • Get Task
      • Create Task
      • [Udio] Generate Lyrics
    • Kling
      • Lipsync With PiAPI Kling API Examples
      • Motion Brush With PiAPI Kling API Example
      • Kling Elements Video Generation API
      • Kling Effects Video Generation
      • Cancel Task
        • Cancel Task
        • Cancel Tasks
      • Get Task
      • Create Task
      • Kling Virtual Try-On
      • Kling Effects
      • Kling Sound
    • Hailuo
      • Hailuo Director Mode Example
      • Generate Video
        POST
      • Get Task
        GET
    • Flux
      • Flux with LoRA and Controlnet
      • Available LoRA and Controlnet
      • Flux API with Redux Variation, Fill, Inpaint and Outpaint
      • Create Task
        • Text to Image
        • Image to Image
        • Kontext
      • Get task
    • Gemini
      • Gemini-2.5-flash-image
      • Get task
    • AI Hug
      • Get Task
      • Create Task
    • LLM
      • Use Cases for GPT-4o Image API
      • How To Avoid Timeouts in Completion API
      • GPT-4o Image Generation API
      • LLM API | Basic Completions
      • Get Task
    • Midjourney
      • PiAPI Penalties on Midjourney Usage
      • Detailed Explaination on Midjourney Task Result
      • Midjourney V7 API Instructions
      • Create Task
        • Imagine
        • Upscale
        • Variation
        • Reroll
        • Describe
        • Seed
        • Blend
        • Inpaint
        • Outpaint
        • Pan
      • Cancel Task
        • Cancel Task
        • Cancel Tasks
      • Get Task
    • Faceswap
      • Multi Faceswap
      • Image Faceswap
      • Video Faceswap
      • Get Task
    • TTS
      • Zeroshot Text-to-Speech F5-TTS
      • Get Task
    • Trellis
      • Create Task
      • Get Task
    • Luma Dream Machine
      • Cancel Task
        • Cancel Task
        • Cancel Tasks
      • Create Task
      • Get Task
    • WanX
      • Generate WanX Task with LoRA Using PiAPI
      • Available LoRA Types for Wanx
      • Use Cases for Wanx LoRA
      • Use Cases for Wanx Control Camera
      • Create Task
      • Get Task
    • Skyreels
      • Create Task
      • Get Task
    • Framepack
      • Create Task
      • Get Task
    • Hunyuan Video
      • How to Make a Hunyuan API Call
      • Get Task
      • Generate Video
    • Mmaudio
      • Get Task
      • Generate Audio
    • DiffRhythm
      • Generate Audio
      • Get Task
    • Ace Step
      • Create Task
        • Text to Audio
        • Audio to Audio
        • Audio Edit
        • Audio Extend
      • Get Task
    • Joycaption
      • Image Caption
      • Get Task
    • Tools
      • File Upload API
      • Remove Background API
      • Remove Background-Get Task
      • Segment With Prompt API
      • Segment With Prompt API-Get Task
      • Image Upscale(Super Resolution) API
      • Image Upscale-Get Task
      • Video Upscale
      • Video Upscale-Get Task
      • Video Remove Background
      • Video Remove Background-Get task
    • PiAPI Account Management
      • PiAPI Account Info
      • Task List Info
      • User Task History
    • Text to Image Copy
      POST
  • Resources
    • Change Log
    • Output Storage
    • Unified API Schema
    • Webhook
    • Bulk Generation Service
    • Billings
    • PiAPI MCP Server
    • Workspace Manual
      • Host-your-account (HYA) | Back-up Account
      • Host-your-account (HYA) | Debug Checklist
      • Host-your-account (HYA) | Connected Account Status
    • Announcements
      • PiAPI 2025 January 1st Pricing Update
  • Legacy Documentation
    • Face Swap
      • Video Faceswap
      • Multi-face-swap
      • Fetch
    • Dream Machine
      • Video Generation
      • Video Extend
      • Get Video Generation
    • Kling
      • Video Generation
      • Video Extend
      • Get Video Generation
  1. Hailuo

Generate Video

POST
https://api.piapi.ai/api/v1/task
Hailuo API provides video generation services with various models supporting text-to-video and image-to-video conversions.

Pricing#

Hailuo v1#

ModelPrice (USD)Special Requirements
t2v-01$0.20None
i2v-01$0.20None
t2v-01-director$0.20None
i2v-01-director$0.20None
i2v-01-live$0.20None
s2v-01$0.30Must detect human face in input image

Hailuo v2#

ModelPrice (USD)durationresolution
t2v-02, i2v-02$0.256768
t2v-02, i2v-02$0.5010768
t2v-02, i2v-02$0.8061080

Model Requirements#

Text-to-Video (t2v-01, t2v-01-director)#

Required fields: prompt
Optional fields: expand_prompt
image_url should not be provided

Text-to-Video (t2v-02)#

Required fields: prompt
Optional fields: expand_prompt, duration, resolution
image_url should not be provided

Image-to-Video (i2v-01, i2v-01-live, i2v-01-director)#

Required fields: image_url
Optional fields: prompt, expand_prompt

Image-to-Video (i2v-02)#

Required fields: image_url
Optional fields: prompt, expand_prompt, duration, resolution

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, i2v-01-director, t2v-01-director
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, i2v-01-director

Hailuo v2#

Duration: 6, 10
Resolution: 768, 1080
1080p+10s is not supported

Configuration Options#

Service Mode#

Currently only supports "public" mode (or Pay-As-You-Go)

Important Notes#

1.
For s2v-01 model:
Face detection is mandatory in the input image
Failed face detection will result in task failure
Higher price (0.30vs0.20 for other models)
2.
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
3.
Billing:
Cost is calculated per generation
Charges are applied upon successful task completion only

Request

Header Params

Body Params application/json

Examples
{
    "model": "hailuo",
    "task_type": "video_generation",
    "input": {
        "prompt": "autumn wind, wild",
        "model": "t2v-01",
        "expand_prompt": true
    },
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/e20b246e-07f9-4f04-aa70-07d8d1042b1b",
            "secret": "123456"
        }
    }
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.piapi.ai/api/v1/task' \
--header 'x-api-key;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "hailuo",
    "task_type": "video_generation",
    "input": {
        "prompt": "autumn wind, wild",
        "model": "t2v-01",
        "expand_prompt": true
    },
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/e20b246e-07f9-4f04-aa70-07d8d1042b1b",
            "secret": "123456"
        }
    }
}'

Responses

🟢200OK
application/json
Successful response
Body

Example
{
    "code": 200,
    "data": {
        "task_id": "3f6d4641-afe2-4386-b6cf-d3f90133e2e7",
        "model": "hailuo",
        "task_type": "video_generation",
        "status": "pending",
        "config": {
            "service_mode": "",
            "webhook_config": {
                "endpoint": "https://webhook.site/1a45ac8c-fcf7-4b32-8fee-94eecc073d77",
                "secret": "123456"
            }
        },
        "input": {
            "expand_prompt": true,
            "model": "t2v-01",
            "prompt": "autumn wind, wild"
        },
        "output": {
            "percent": 0,
            "cover_url": "",
            "video_url": "",
            "download_url": "",
            "desc": "",
            "prompt_img_url": "",
            "status": 0,
            "user_origin_prompt": false,
            "width": 0,
            "height": 0,
            "model_id": "",
            "message": ""
        },
        "meta": {
            "created_at": "2025-08-22T07:54:16.579786508Z",
            "started_at": "0001-01-01T00:00:00Z",
            "ended_at": "0001-01-01T00:00:00Z",
            "usage": {
                "type": "point",
                "frozen": 2000000,
                "consume": 0
            },
            "is_using_private_pool": false
        },
        "detail": null,
        "logs": null,
        "error": {
            "code": 0,
            "raw_message": "",
            "message": "",
            "detail": null
        }
    },
    "message": "success"
}
Modified at 2025-07-09 07:46:29
Previous
Hailuo Director Mode Example
Next
Get Task