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.
Gommo Developer client
Official Gommo Developer TypeScript client — npm alias @ai-gateway/client. Integrate against Gommo public API (api.gommo.net, v2.api.gommo.net).
The Gommo Developer client gives typed helpers and built-in job polling on Gommo public hosts.
npm alias
Published on npm as @ai-gateway/client. API class: GommoClient. Future rename to @gommo/client when the @gommo org exists on npm.
| Host | Use for |
|---|---|
https://v2.api.gommo.net | Models, media jobs, upload |
https://api.gommo.net | Login, profile, chat, audio |
→ Quickstart · Request lifecycle · Authentication
Same golden path as the REST Quickstart: login (or env token) → list models → one image job → result URL. The client runs the poll loop for you on v2.api.gommo.net (3.5s, max 80) — there is no job-completion webhook on Tier A (Webhooks).
| Step | What to do |
|---|---|
| 1 | npm install @ai-gateway/client (below) |
| 2 | Server env: GOMMO_ACCESS_TOKEN + registration domain — API credentials |
| 3 | client.models.list({ type: 'image' }) — use catalog ratio / mode only |
| 4 | client.jobs.createAndWait({ ... }) — create + client poll until resultUrl |
| 5 | Troubleshoot: Common errors · manual poll: Jobs (pollUntilDone, createAndPoll) |
REST equivalent (curl/PowerShell): Quickstart step 4 · Cookbook: async job + poll.
| Language | Package | Status |
|---|---|---|
| TypeScript / JavaScript | @ai-gateway/client | v1.0.0 on npm |
| Python | — | Use OpenAPI generate |
| Go | — | Planned |
npm install @ai-gateway/clientRequires Node 18+ (native fetch) or pass custom fetch in options.
Contributors (this repo)
Source: packages/gateway-client. Local dev: npm run client:build then npm install ./packages/gateway-client in your app.
fetch or OpenAPI-generated clientsAgent SDK
Multi-turn agents: use client.chat + your orchestration, or MCP & agents for Cursor IDE tools.
import {
GommoClient,
modelSlug,
parseModelsList,
pickFirstRatio,
} from '@ai-gateway/client';
const client = new GommoClient({
accessToken: process.env.GOMMO_ACCESS_TOKEN,
domain: process.env.GOMMO_DOMAIN ?? 'YOUR_REGISTRATION_DOMAIN',
});
const catalog = await client.models.list({ type: 'image' });
const models = parseModelsList(catalog);
const m = models[0];
const slug = modelSlug(m);
const ratio = pickFirstRatio(m);
const job = await client.jobs.createAndWait({
type: 'image',
modelSlug: slug,
fields: { prompt: 'A red apple', ratio },
});
console.log(job.data?.resultUrl);createAndWait is create({ wait: true }): async create on Gommo, then SDK pollUntilDone with default 3500ms / 80 attempts.
Auth and chat use api.gommo.net — see Authentication.
| Guide | Topics |
|---|---|
| Overview | Resources map |
| Installation | npm, env, hosts |
| Authentication | login, register (gateway), change password, Bearer, me |
| Models | list, catalog helpers |
| Jobs | create, wait, poll |
| Chat | send, stream SSE |
| Upload | image, video multipart |
| Audio | voices, TTS, lists |
| Billing | Self-host /billing/* only — Coming to Gommo platform |
| Errors | GatewayError, codes |
| Client SDK | Cookbook | |
|---|---|---|
| Focus | Typed Gommo API surface | End-to-end tasks |
| Use when | Building an app | Learning / one-off scripts |
| Languages | TypeScript (npm) | curl + PowerShell |
| Poll helpers | Built-in | Manual loops |