Hướng dẫn tích hợp Models
Tích hợp qua Gommo public API trên https://v2.api.gommo.net. Auth: Authorization: Bearer <access_token>. Form body gồm domain (domain đăng ký, vd. <registration-domain>).
Đọc catalog trước
Trước create đầu tiên: Đọc catalog — sau đó Vòng đời request.
Gommo host catalog model. Mọi tích hợp media theo cùng flow:
- List models theo job type — read-catalog
- Chọn
model/ slug và parameters cho phép từ response - Create job — không đoán field
- Poll — client poll mỗi 3.5s, tối đa 80 lần (~5 phút)
Xem catalog live tại tab Models.
List models (khuyến nghị)
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%Ví dụ request đầy đủ → Media & jobs reference.
Tạo job
Dùng model id từ catalog (field có thể là model, slug, hoặc id_base trong response):
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=2kGiá trị field phải lấy từ models list của bạn cho model đó — xem Parameters.
Polling
Gommo không webhook khi job hoàn thành. Poll đến trạng thái terminal:
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| Cài đặt | Giá trị |
|---|---|
| Interval | 3500 ms |
| Max attempts | 80 |
Poll media | image | video | music (khớp job type) |
Tùy chọn: self-host (operator)
Khi self-host repo — xem Deploy → Self-host nâng cao. Tích hợp Tier A dùng host public ở trên.
Tiếp theo
→ Đọc catalog · Job types · Parameters · Quickstart
