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. Calls Gommo public API (api.gommo.net, v2.api.gommo.net).
Upstream requires non-empty messages.
Optional language (upstream form field, e.g. EN, VI). When omitted, the client sends VI (same as the gateway).
action=chat may return SSE even when you expect JSON. Concatenate choices[0].delta.content from data: lines until [DONE].
const res = await client.chat.send({
action: 'chat',
query: 'Hello',
language: 'EN',
messages: [{ role: 'user', text: 'Hello' }],
});Optional: sessionId for multi-turn; model, server, agentId for routing.
for await (const chunk of client.chat.stream({
query: 'Tell a short story',
language: 'EN',
messages: [{ role: 'user', text: 'Tell a short story' }],
})) {
process.stdout.write(chunk);
}const catalog = await client.chat.listModels();Tier A upstream: POST /api/v2/chat with action=models. Gateway mode: GET /gateway/chat-models.
await client.chat.send({
action: 'set_model',
messages: [{ role: 'user', text: 'hi' }],
model: 'gpt-5.5::cheap',
});Separate from sessionId on chat — persists messages on Gommo:
const sessions = await client.chatSessions.listSessions({ limit: 20 });
await client.chatSessions.saveMessage({
sessionId: '…',
messageId: '…',
role: 'user',
text: 'Hello',
});See Chat reference — Reading responses (JSON vs SSE) and Chat sessions.