การเชื่อมต่อ API ของ Hailuo Standard
ใช้ Hailuo Standard ผ่าน Rivya Public API v1 ด้วยรหัสโมเดล hailuo-standard, อินพุตที่รองรับ, พารามิเตอร์, กฎ Files API, เครดิต และตัวอย่างคำตอบ
hailuo-standard
text, file
จำเป็นสำหรับโหมดอ้างอิง
per_video · text_6=30 · text_10=50 · image_512P_6=12 · image_512P_10=20 · image_768P_10=50 · ⌈total⌉
วิดีโอ
FIXED
1500 อักขระ
สัญญาของคำขอ
ส่งรหัส `model` ที่ระดับบนสุด ส่วนการควบคุมเฉพาะโมเดลอยู่ใน `params`
| คีย์ | ประเภท | จำเป็น | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|---|
| model | string | ใช่ | hailuo-standard | ใช้รหัสโมเดล API hailuo-standard |
| prompt | string | ใช่ | - | สูงสุด 1500 อักขระสำหรับโมเดลนี้ |
| params | object | ไม่ใช่ | - | อ็อบเจ็กต์พารามิเตอร์เฉพาะโมเดล ดูคีย์ที่อนุญาตได้จากแถวด้านล่าง |
| client_request_id | string | ไม่ใช่ | - | ID ฝั่งไคลเอนต์แบบเลือกได้สำหรับติดตามคำขอในระบบของคุณ |
พารามิเตอร์โมเดล
| คีย์ | ประเภท | จำเป็น | ค่าเริ่มต้น | ช่วง | ตัวเลือก | คำอธิบาย |
|---|---|---|---|---|---|---|
| duration | select | ไม่ใช่ | 6 | - | 6, 10 | ระยะเวลา |
| resolution | select | ไม่ใช่ | 768P | - | 512P, 768P | ความละเอียด |
| prompt_optimizer | select | ไม่ใช่ | true | - | false, true | ให้ Hailuo เขียนและปรับพรอมป์ของคุณก่อนสร้าง ปิดเมื่อคุณต้องการให้รอบสร้างอยู่ใกล้ถ้อยคำดิบของคุณมากขึ้น |
นโยบายการอัปโหลด
อัปโหลดไฟล์อ้างอิงก่อน จากนั้นใส่ URL และโทเค็นระยะเวลาที่ได้กลับมาไว้ใน `params.referenceMediaItems`
รูปอ้างอิง: โหมดรูปภาพรับรูปได้สูงสุด 2 รูป และรูปที่สองจะกลายเป็นเฟรมสุดท้าย JPG / PNG / WebP · ≤ 10 MB.
2
image
ไฟล์อ้างอิงวิดีโอและเสียงควรมี `durationToken` จาก /api/v1/files เมื่อจำเป็นต้องตรวจระยะเวลา
| kind | ขนาดสูงสุด | ชนิด MIME |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
คำขอขั้นต่ำ
{
"model": "hailuo-standard",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"duration": "6",
"resolution": "768P",
"prompt_optimizer": "true"
}
}คำขอแบบไฟล์อ้างอิง
{
"model": "hailuo-standard",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"duration": "6",
"resolution": "768P",
"prompt_optimizer": "true",
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-image.png",
"kind": "image",
"name": "reference-image.png",
"mimeType": "image/png"
}
]
}
}คำตอบจากการสร้าง
เอนด์พอยต์สำหรับสร้างงานจะส่ง ID งานสาธารณะกลับมา ให้ตรวจเอนด์พอยต์สถานะซ้ำจนกว่างานจะสำเร็จหรือล้มเหลว
{
"id": "task_hailuo_standard_example",
"status": "queued",
"model": "hailuo-standard",
"reserved_credits": 30,
"final_credits": 0,
"settlement_status": "RESERVED",
"created_at": "2026-05-11T00:00:00.000Z",
"updated_at": "2026-05-11T00:00:00.000Z",
"result": null,
"error": null
}ข้อผิดพลาดทั่วไป
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
บางโหมดต้องใช้การอัปโหลดไฟล์อ้างอิงผ่าน Files API
