1 USD ≈ 27,000 credits · display only
Reference rate may change over time.
1 USD ≈ 27,000 credits · display only
Reference rate may change over time.
Minimal loop for automation on the Gommo public API — no MCP or gateway required.
flowchart LR
A[Login or token] --> B[POST v2…/ai/models]
B --> C[POST v2…/ai/jobs/type/slug]
C --> D[POST v2…/ai/jobs/id?media=]
D --> E[resultUrl]$domain = $env:GOMMO_API_DOMAIN; if (-not $domain) { throw 'Set GOMMO_API_DOMAIN to the user registration domain (dealer)' }
$h = @{ Authorization = "Bearer $env:TOKEN"; 'Content-Type' = 'application/x-www-form-urlencoded' }
# 1. Catalog
$models = Invoke-RestMethod -Method POST `
-Uri "https://v2.api.gommo.net/ai/models?type=image" `
-Headers @{ Authorization = "Bearer $env:TOKEN" } `
-ContentType "application/x-www-form-urlencoded" `
-Body "type=image&domain=$domain"
$m = $models.data[0]
$slug = $m.model ?? $m.slug
$ratio = $m.ratios[0]
if ($ratio -is [pscustomobject]) { $ratio = $ratio.value }
# 2. Create job
$body = "domain=$domain&project_id=default&prompt=A red apple&ratio=$ratio"
$created = Invoke-RestMethod -Method POST `
-Uri "https://v2.api.gommo.net/ai/jobs/image/$slug" `
-Headers $h -Body $body
$jobId = $created.imageInfo.id_base ?? $created.data.id_base
# 3. Poll
$pollBody = "access_token=$env:TOKEN&domain=$domain"
for ($i = 1; $i -le 80; $i++) {
$poll = Invoke-RestMethod -Method POST `
-Uri "https://v2.api.gommo.net/ai/jobs/$jobId?media=image" `
-Headers $h -Body $pollBody
$url = $poll.imageInfo.result_url ?? $poll.data?.resultUrl
if ($url) { $url; break }
Start-Sleep -Seconds 3.5
}Gommo returns upstream envelopes — agents should read message / status fields before retrying. Self-hosted deploy may wrap responses — see Deploy → Self-host (advanced).
Cursor MCP tools (gommo_*) are separate from HTTP. For production integrations use the public API — see MCP & agents.