หน้า API ของโมเดล
การเชื่อมต่อ API ของ Sora 2
ใช้ Sora 2 ผ่าน Rivya Public API v1 ด้วย model id sora-2, input ที่รองรับ, พารามิเตอร์, กฎ Files API, เครดิต และตัวอย่าง response
พร้อมใช้งานผ่าน APIText หรือ URL พร้อม; โหมด reference ใช้ Files APIวิดีโอ
ID โมเดล API
sora-2
Input
text, file
Files API
จำเป็นสำหรับโหมด reference
เครดิตพื้นฐาน
6
ความสามารถ
วิดีโอ
Billing
FIXED
ขีดจำกัดพรอมต์
10000 อักขระ
contract ของ request
ส่ง model id ที่ระดับบนสุด control เฉพาะโมเดลอยู่ใน params
| Key | Type | จำเป็น | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|---|
| model | string | ใช่ | sora-2 | ใช้ API model id sora-2 |
| prompt | string | ใช่ | - | สูงสุด 10000 อักขระสำหรับโมเดลนี้ |
| params | object | ไม่ใช่ | - | object พารามิเตอร์เฉพาะโมเดล ใช้แถวด้านล่างสำหรับ key ที่อนุญาต |
| client_request_id | string | ไม่ใช่ | - | client-side id แบบเลือกได้สำหรับ trace คำขอในระบบของคุณ |
พารามิเตอร์โมเดล
| Key | Type | จำเป็น | ค่าเริ่มต้น | ช่วง | ตัวเลือก | คำอธิบาย |
|---|---|---|---|---|---|---|
| n_frames | select | ไม่ใช่ | 10 | - | 10, 15 | ระยะเวลา |
| aspect_ratio | select | ไม่ใช่ | landscape | - | landscape, portrait | อัตราส่วนภาพ |
| remove_watermark | select | ไม่ใช่ | false | - | false, true | ลบลายน้ำ |
| upload_method | select | ไม่ใช่ | s3 | - | s3, oss | ปลายทางอัปโหลด |
policy การอัปโหลด
อัปโหลดไฟล์ reference ก่อน จากนั้นใส่ URL และ duration token ที่ได้กลับมาไว้ใน params.referenceMediaItems
กฎ reference
ภาพอ้างอิง: อัปโหลดไฟล์ภาพได้สูงสุด 1 ไฟล์สำหรับโปรเจกต์ภาพ
ไฟล์สูงสุด
1
ชนิดไฟล์ที่รับ
image
Duration token
reference วิดีโอและเสียงควรมี durationToken จาก /api/v1/files เมื่อจำเป็นต้องตรวจ duration
| kind | ขนาดสูงสุด | MIME type |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
request ขั้นต่ำ
{
"model": "sora-2",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"n_frames": "10",
"aspect_ratio": "landscape",
"remove_watermark": "false",
"upload_method": "s3"
}
}request แบบไฟล์ reference
{
"model": "sora-2",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"n_frames": "10",
"aspect_ratio": "landscape",
"remove_watermark": "false",
"upload_method": "s3",
"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_sora_2_example",
"status": "queued",
"model": "sora-2",
"reserved_credits": 6,
"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