Documentation

API Documentation

Hunyuan Video Generation

Advanced video generation model supporting multiple task types including text-to-video, image-to-video, and LoRA-enhanced generation.

Quick Start
Get started with Hunyuan model in minutes

Base URL

https://api.qubico.ai/v1/inference

Header Params

x-api-key: YOUR_API_KEY

Model ID

Qubico/hunyuan
Parameters Reference
Complete list of available parameters for Hunyuan video generation

Required Parameters

model
string
required

Model identifier. Must be "Qubico/hunyuan"

task_type
string
required

Task type. Options: "txt2video", "fast-txt2video", "img2video-concat", "img2video-replace", "txt2video-lora"

input.prompt
string
required

Text description of the video content to generate. Maximum 1000 characters. Required for all task types.

Optional Parameters

input.image
string (URL)
img2video tasks only

Source image URL for image-to-video generation. Required for img2video-concat and img2video-replace tasks. Supports JPEG, PNG, WebP formats.

input.lora_settings
array
txt2video-lora only

LoRA configuration array for txt2video-lora task. Each object contains lora_type and lora_strength (0.0-2.0).

input.aspect_ratio
string
optional

Video aspect ratio. Common values: "16:9", "9:16", "1:1", "4:3". Default varies by task type.

Configuration Parameters

config.webhook_config
object
optional

Webhook configuration for async notifications

endpoint - Webhook URL
secret - Webhook secret for verification

Code Examples

txt2video

{
    "model": "Qubico/hunyuan",
    "task_type": "txt2video",
    "input": {
        "prompt": "A cat walks on the grass, realistic style."
    },
    "config": {
        "webhook_config": {
            "endpoint": "",
            "secret": ""
        }
    }
}

fast-txt2video

{
    "model": "Qubico/hunyuan",
    "task_type": "fast-txt2video",
    "input": {
        "prompt": "A cat walks on the grass, realistic style."
    },
    "config": {
        "webhook_config": {
            "endpoint": "",
            "secret": ""
        }
    }
}

img2video-concat

{
    "model": "Qubico/hunyuan",
    "task_type": "img2video-concat",
    "input": {
        "image": "https://i.ibb.co/5g8hj28f/hug.webp",
        "prompt": "Describe a heartfelt scenario where one person expresses affection through warm embrace to the other, highlighting the emotional warmth and intimacy shared in that moment.",
        "aspect_ratio": "1:1"
    },
    "config": {
        "webhook_config": {
            "endpoint": "",
            "secret": ""
        }
    }
}

img2video-replace

{
    "model": "Qubico/hunyuan",
    "task_type": "img2video-replace",
    "input": {
        "image": "https://i.ibb.co/5g8hj28f/hug.webp",
        "prompt": "Describe a heartfelt scenario where one person expresses affection through warm embrace to the other, highlighting the emotional warmth and intimacy shared in that moment.",
        "aspect_ratio": "1:1"
    },
    "config": {
        "webhook_config": {
            "endpoint": "",
            "secret": ""
        }
    }
}

txt2video-lora

{
    "model": "Qubico/hunyuan",
    "task_type": "txt2video-lora",
    "input": {
        "prompt": "A cat walks on the grass, anime style.",
        "lora_settings": [
            {
                "lora_type": "anime",
                "lora_strength": 1.0
            }
        ]
    },
    "config": {
        "webhook_config": {
            "endpoint": "",
            "secret": ""
        }
    }
}

Response Format

{
  "task_id": "string",
  "status": "pending|processing|completed|failed",
  "result": {
    "video_url": "string",
    "duration": "number",
    "resolution": "string",
    "format": "mp4"
  },
  "created_at": "timestamp",
  "completed_at": "timestamp"
}

Error Handling

Common Error Codes

  • 400 - Invalid parameters or malformed request
  • 401 - Invalid or missing API key
  • 429 - Rate limit exceeded
  • 500 - Internal server error

Rate Limits & Pricing

Rate Limits
  • • 10 requests per minute
  • • 100 requests per hour
  • • 1000 requests per day
Pricing
  • • Standard: $0.30 per second
  • • Fast: $0.20 per second
  • • Image-to-Video: $0.35 per second
  • • LoRA: $0.40 per second