หน้า API ของโมเดล
การเชื่อมต่อ API ของ 4o Image
ใช้ 4o Image ผ่าน Rivya Public API v1 ด้วย model id 4o-image, input ที่รองรับ, พารามิเตอร์, กฎ Files API, เครดิต และตัวอย่าง response
พร้อมใช้งานผ่าน APItext input พร้อมรูปภาพ
ID โมเดล API
4o-image
Input
text
Files API
ไม่จำเป็นสำหรับ request ขั้นต่ำ
เครดิตพื้นฐาน
3
ความสามารถ
รูปภาพ
Billing
FIXED
ขีดจำกัดพรอมต์
ยังไม่มีขีดจำกัดพรอมต์ในเอกสาร
contract ของ request
ส่ง model id ที่ระดับบนสุด control เฉพาะโมเดลอยู่ใน params
| Key | Type | จำเป็น | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|---|
| model | string | ใช่ | 4o-image | ใช้ API model id 4o-image |
| prompt | string | ใช่ | - | ข้อความพรอมต์สำหรับโมเดลที่รองรับ input แบบข้อความ |
| params | object | ไม่ใช่ | - | object พารามิเตอร์เฉพาะโมเดล ใช้แถวด้านล่างสำหรับ key ที่อนุญาต |
| client_request_id | string | ไม่ใช่ | - | client-side id แบบเลือกได้สำหรับ trace คำขอในระบบของคุณ |
พารามิเตอร์โมเดล
| Key | Type | จำเป็น | ค่าเริ่มต้น | ช่วง | ตัวเลือก | คำอธิบาย |
|---|---|---|---|---|---|---|
| size | select | ไม่ใช่ | 1:1 | - | 1:1, 3:2, 2:3 | อัตราส่วนภาพ |
request ขั้นต่ำ
{
"model": "4o-image",
"prompt": "A clean editorial product image on a soft studio background",
"params": {
"size": "1:1"
}
}response จากการสร้าง
endpoint create ส่ง public task id กลับมา poll endpoint สถานะจนกว่างานจะสำเร็จหรือล้มเหลว
{
"id": "task_4o_image_example",
"status": "queued",
"model": "4o-image",
"reserved_credits": 3,
"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
endpoint create ส่ง public task id กลับมา poll endpoint สถานะจนกว่างานจะสำเร็จหรือล้มเหลว