Skip to content

Các chế độ tích hợp ​

Advanced / operator docs

Ẩn khỏi sidebar Models & routing mặc định — link từ Deploy → Self-host nâng cao. Integrator Tier A chỉ cần Gommo public API (Mode A).

Ba cách gọi Gommo.

So sánh nhanh ​

Mode A DirectMode B RESTMode C Proxy
Base URLHost Gommo{gateway}/gateway{gateway}
AuthBearer / form upstreamAuthorization: BearerPass-through
Domain clientForm bắt buộcTùy chọn (GOMMO_API_DOMAIN)Form bắt buộc
Ẩn upstreamKhôngCóCó
Poll / wrapTự implementwait: trueEnvelope Gommo
ResponseGommo native{ success, data, message, code }Gommo native
Phù hợpProduction — khuyến nghịSelf-host JSON RESTFE Gommo legacy drop-in

Mode A — Direct Gommo ​

Gọi thẳng upstream từ backend tin cậy.

V2 jobs:

http
POST https://v2.api.gommo.net/ai/jobs/image/{modelSlug}
Authorization: Bearer {token}
Content-Type: application/x-www-form-urlencoded

domain={GOMMO_API_DOMAIN}&project_id=default&prompt=...&ratio=...

Auth, chat, audio:

http
POST https://api.gommo.net/api/apps/go-mmo/auth/login
POST https://api.gommo.net/api/v2/chat
POST https://api.gommo.net/ai/audio

Tự poll

Gommo không webhook. Poll 3.5s × ~80 lần hoặc dùng Mode B wait: true.


Mode B — Gateway REST ​

Sắp có trên nền tảng Gommo

Mode B (/gateway/*, wait: true, JSON REST) là xem trước trên repo này. Integrator production nên dùng Mode A (host public Gommo). Mode B sẽ hội tụ vào API nền tảng Gommo chính thức.

→ Roadmap nền tảng Gommo

JSON API /gateway/*. Gateway dịch sang form upstream và poll tùy chọn.

Domain tự điền từ GOMMO_API_DOMAIN nếu client không gửi.

GatewayUpstream
GET /gateway/models?type=POST /ai/models (v2)
POST /gateway/jobs/:typePOST /ai/jobs/:type/:slug
GET /gateway/jobs/:id?media=poll
POST /gateway/upload/imageupload V2
POST /gateway/chatPOST /api/v2/chat
POST /gateway/audio/*platform audio

Auth: Authorization: Bearer {user_access_token}.

Tùy chọn khi self-host gateway — JSON REST, wait: true, portal billing.


Mode C — Gateway proxy ​

Pass-through — giữ path Gommo, đổi base URL sang gateway.

MountUpstream
/vi/v2/*GOMMO_API_BASE_URL (bỏ /vi/v2)
/vi/ai/*, /vi/api/v2/*GOMMO_AUTH_BASE_URL
/vi/api/apps/go-mmo/*auth proxy
POST /v2/ai/jobs/image/flux-dev  →  v2.api.gommo.net/…
POST /api/v2/chat                →  api.gommo.net/…

Body limit 50MB. Stream chat/SSE. Form cần domain.

Dùng khi migrate FE Gommo sẵn có — chỉ đổi base URL.


Auth theo mode ​

RouteToken
V2 jobsAuthorization: Bearer
Platform formaccess_token trong form
LoginKhông token — trả access_token

→ Authentication

Cùng catalog, cùng quy tắc ​

  1. List models trước — không đoán ratio / mode / …
  2. Cùng user access_token
  3. Job async — poll hoặc wait: true

Tiếp theo ​

→ Choosing a mode · Endpoint map