คู่มือการเชื่อมต่อโมเดล
เชื่อมต่อผ่าน Gommo public API บน https://v2.api.gommo.net Auth: Authorization: Bearer <access_token> form body ต้องมี domain (โดเมนลงทะเบียน เช่น <registration-domain>)
อ่านแคตตาล็อกก่อน
ก่อน create ครั้งแรก: อ่านแคตตาล็อก · วงจร request
Gommo โฮสต์แคตตาล็อกโมเดล ทุกการเชื่อมต่อมีเดียทำตาม flow เดียวกัน:
- ลิสต์โมเดล ตาม ประเภทงาน — read-catalog
- เลือก
model/ slug และ พารามิเตอร์ ที่อนุญาตจาก response - สร้างงาน — ห้ามเดาฟิลด์
- Poll — client poll ทุก 3.5s สูงสุด 80 ครั้ง (~5 นาที)
ดูแคตตาล็อกสดที่ แท็บ Models
ลิสต์โมเดล (แนะนำ)
http
POST https://v2.api.gommo.net/ai/models?type=image
Authorization: Bearer {access_token}
Content-Type: application/x-www-form-urlencoded
type=image&domain=%REGISTRATION_DOMAIN%ตัวอย่างคำขอฉบับเต็ม → อ้างอิงมีเดีย & งาน
สร้างงาน
ใช้ model id จากแคตตาล็อก (ชื่อฟิลด์อาจเป็น model, slug, หรือ id_base ใน response):
http
POST https://v2.api.gommo.net/ai/jobs/image/{model_id}
Authorization: Bearer {access_token}
Content-Type: application/x-www-form-urlencoded
domain=%REGISTRATION_DOMAIN%&project_id=default&prompt=A product photo on white background&ratio=16:9&mode=low&resolution=2kค่าฟิลด์ต้องมาจาก ลิสต์โมเดลของคุณ สำหรับ โมเดลนั้น — ดู พารามิเตอร์
Polling
Gommo ไม่ webhook เมื่องานเสร็จ Poll จนได้สถานะสุดท้าย:
http
POST https://v2.api.gommo.net/ai/jobs/{id_base}?media=image
Authorization: Bearer {access_token}
Content-Type: application/x-www-form-urlencoded
domain=%REGISTRATION_DOMAIN%&project_id=default| การตั้งค่า | ค่า |
|---|---|
| Interval | 3500 ms |
| Max attempts | 80 |
Poll media | image | video | music (ตรงกับประเภทงาน) |
ทางเลือก: self-host (operator)
เมื่อ self-host repo — ดู Deploy → Self-host ขั้นสูง การเชื่อมต่อ Tier A ใช้ public host ด้านบน
ถัดไป
→ อ่านแคตตาล็อก · ประเภทงาน · พารามิเตอร์ · Quickstart
