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).
import { GommoClient } from '@ai-gateway/client';
const client = new GommoClient({ domain: process.env.GOMMO_DOMAIN ?? 'YOUR_REGISTRATION_DOMAIN' });
const { access_token } = await client.auth.login({
email: '[email protected]',
password: 'secret',
});
// Token is stored on client automaticallyconst client = new GommoClient({
accessToken: process.env.GOMMO_ACCESS_TOKEN,
domain: process.env.GOMMO_DOMAIN ?? 'YOUR_REGISTRATION_DOMAIN',
});Login and me() call api.gommo.net; media jobs use v2.api.gommo.net automatically.
const me = await client.auth.me(process.env.GOMMO_DOMAIN ?? 'YOUR_REGISTRATION_DOMAIN');
const credits = me.balancesInfo?.credits_ai;
const username = me.userInfo?.username ?? me.data?.username;Use username for Billing topup when using self-hosted gateway billing.
client.setAccessToken(newToken);Merchant env (GOMMO_ACCESS_TOKEN, GOMMO_MANAGER_ID) must be set on the gateway. Registration domain is resolved server-side — do not send domain in the JSON body.
const client = new GommoClient({
transport: 'gateway',
gatewayBaseUrl: process.env.GATEWAY_URL,
});
const result = await client.auth.register({
email: '[email protected]',
password: 'secret12',
phone: '0900000000',
name: 'Optional name',
});auth.register() is not available on transport: 'gommo' (public API register uses merchant form fields server-side).
Public API (form on api.gommo.net):
await client.auth.changePassword({
currentPassword: process.env.CURRENT_PASSWORD!,
newPassword: process.env.NEW_PASSWORD!,
language: 'EN',
});Self-hosted gateway (transport: 'gateway', gatewayBaseUrl):
const client = new GommoClient({
transport: 'gateway',
gatewayBaseUrl: process.env.GATEWAY_URL,
accessToken: process.env.GOMMO_ACCESS_TOKEN,
});
await client.auth.changePassword({
currentPassword: '…',
newPassword: '…',
});Not the same as AI project set_password. See Account settings — change password.
Public API (form on api.gommo.net):
await client.auth.transferCredits({
username: 'recipient_username',
value: 10_000,
message: 'Transfer note',
language: 'EN',
});Self-hosted gateway (transport: 'gateway', Bearer session):
await client.auth.transferCredits({
username: 'recipient_username',
value: 10_000,
message: 'Transfer note',
});Upstream may return HTTP 200 with { error: 1, message: "…" } — check error / success on the returned envelope. Not merchant /admin/credits/send. See Account — transfer credits.
Public API (form on api.gommo.net):
const ledger = await client.auth.listPaymentsHistory({
limit: 500,
time_start: 0,
time_end: 0,
language: 'EN',
});
// ledger.data — array of rows; sum plus/minus client-sideSelf-hosted gateway (transport: 'gateway', Bearer session):
await client.auth.listPaymentsHistory({ limit: 500, source: 'sendBalances' });Not /api/v2/usage-history. See Account — transaction history.
Public API (form on api.gommo.net):
const sessions = await client.auth.listDevices({
language: 'EN',
current_device_id: deviceId,
device_id: deviceId,
device_name: 'Browser 1',
});
// sessions.data?.items — array of rows; sessions.data?.current_device_idSelf-hosted gateway:
await client.auth.registerDevice({ language: 'EN' });
await client.auth.renameDevice({ device_id: '…', device_name: 'Work laptop' });
await client.auth.disableDevice({ device_id: '…' });See Account — session devices.
const tickets = await client.auth.listSupportTickets({ language: 'EN' });
// tickets.data — array of ticket summaries
const created = await client.auth.createSupportTicket({
subject: 'Billing question',
issue_type: 'bug',
description: 'Steps to reproduce…',
});
// created.ticket_id_hash — use as ticket_id_base
const thread = await client.auth.getSupportTicketDetail({
ticket_id_base: 'SUP-20260925-7022',
});
await client.auth.replySupportTicket({
ticket_id_base: 'SUP-20260925-7022',
content: 'Additional details…',
});See Account — support tickets.
const landing = await client.auth.getPartnerProgramStatus({ language: 'EN', lang: 'en' });
// landing.program, landing.application — prefer application?.status for pending review
await client.auth.applyPartnerProgram({
bank_name: '…',
account_name: '…',
account_number: '…',
contact: '…',
email: '[email protected]',
reason: '…',
accept_rules: 1,
});See Account — partner program.
const landing = await client.auth.getCreatorRewardsStatus({ language: 'EN' });
const pool = await client.auth.getCreatorRewardsPool({ language: 'EN' });
await client.auth.applyCreatorRewards({
payout_pref: 'credit',
contact: '…',
email: '[email protected]',
reason: '…',
accept_rules: 1,
});