Skip to content

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:

  1. List models theo job type — read-catalog
  2. Chọn model / slug và parameters cho phép từ response
  3. Create job — không đoán field
  4. 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ị) ​

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%

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):

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

Giá 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:

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
Cài đặtGiá trị
Interval3500 ms
Max attempts80
Poll mediaimage | 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