การเชื่อมต่อ API ของ Runway
ใช้ Runway ผ่าน Rivya Public API v1 ด้วย model id runway, input ที่รองรับ, พารามิเตอร์, กฎ Files API, เครดิต และตัวอย่าง response
runway
text, file
จำเป็นสำหรับโหมด reference
12
วิดีโอ
FIXED
1800 อักขระ
contract ของ request
ส่ง model id ที่ระดับบนสุด control เฉพาะโมเดลอยู่ใน params
| Key | Type | จำเป็น | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|---|
| model | string | ใช่ | runway | ใช้ API model id runway |
| prompt | string | ใช่ | - | สูงสุด 1800 อักขระสำหรับโมเดลนี้ |
| params | object | ไม่ใช่ | - | object พารามิเตอร์เฉพาะโมเดล ใช้แถวด้านล่างสำหรับ key ที่อนุญาต |
| client_request_id | string | ไม่ใช่ | - | client-side id แบบเลือกได้สำหรับ trace คำขอในระบบของคุณ |
พารามิเตอร์โมเดล
| Key | Type | จำเป็น | ค่าเริ่มต้น | ช่วง | ตัวเลือก | คำอธิบาย |
|---|---|---|---|---|---|---|
| duration | select | ไม่ใช่ | 5 | - | 5, 10 | ระยะเวลา |
| quality | select | ไม่ใช่ | 720p | - | 720p, 1080p | คุณภาพ |
| aspectRatio | select | ไม่ใช่ | 16:9 | - | 16:9, 4:3, 1:1, 3:4, 9:16 | อัตราส่วนภาพ |
| waterMark | text | ไม่ใช่ | - | - | - | ลายน้ำ |
policy การอัปโหลด
อัปโหลดไฟล์ reference ก่อน จากนั้นใส่ URL และ duration token ที่ได้กลับมาไว้ใน params.referenceMediaItems
ภาพอ้างอิง: อัปโหลดภาพหนึ่งภาพแบบไม่บังคับเพื่อสลับเข้าสู่โหมด image-to-video หรือปล่อยว่างไว้เพื่ออยู่ในโหมดข้อความ
1
image
reference วิดีโอและเสียงควรมี durationToken จาก /api/v1/files เมื่อจำเป็นต้องตรวจ duration
| kind | ขนาดสูงสุด | MIME type |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
request ขั้นต่ำ
{
"model": "runway",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"duration": "5",
"quality": "720p",
"aspectRatio": "16:9",
"waterMark": "ปล่อยว่างเพื่อปิด watermark"
}
}request แบบไฟล์ reference
{
"model": "runway",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"duration": "5",
"quality": "720p",
"aspectRatio": "16:9",
"waterMark": "ปล่อยว่างเพื่อปิด watermark",
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-image.png",
"kind": "image",
"name": "reference-image.png",
"mimeType": "image/png"
}
]
}
}response จากการสร้าง
endpoint create ส่ง public task id กลับมา poll endpoint สถานะจนกว่างานจะสำเร็จหรือล้มเหลว
{
"id": "task_runway_example",
"status": "queued",
"model": "runway",
"reserved_credits": 12,
"final_credits": 0,
"created_at": "2026-05-11T00:00:00.000Z",
"updated_at": "2026-05-11T00:00:00.000Z",
"result": null,
"error": null
}error ทั่วไป
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
บางโหมดต้องใช้การอัปโหลด reference ผ่าน Files API