Skip to content

TypeScript SDK — แพลตฟอร์ม Gommo (preview) ​

Gommo Developer client

Client Gommo Developer TypeScript — npm alias @ai-gateway/client เรียก Gommo public API (api.gommo.net, v2.api.gommo.net)

→ Gommo public API · Roadmap

GommoClient (official Gommo client) มี resources แยก namespace:

typescript
import { GommoClient } from '@ai-gateway/client';

const client = new GommoClient({
  accessToken: process.env.GOMMO_ACCESS_TOKEN,
  domain: process.env.GOMMO_DOMAIN ?? 'YOUR_REGISTRATION_DOMAIN',
});
ResourceMethods
client.authlogin(), me()
client.modelslist({ type })
client.jobscreate(), poll(), createAndWait(), pollUntilDone(), createAndPoll()
client.chatsend(), stream()
client.uploadimage(), video()
client.audiosearchVoices(), tts(), lists()
client.billingself-hosted gateway เท่านั้น — status(), packages(), createPayment()
client.byokself-hosted gateway เท่านั้น — ดู BYOK reference
clienthealth(), transport, v2BaseUrl, authBaseUrl, setAccessToken()

Helpers ที่ export จาก package root:

  • parseModelsList, modelSlug, pickFirstRatio
  • extractJobId, extractPollSnapshot, pollMediaForJobType, POLL_MEDIA
  • classifyPollStatus, DEFAULT_POLL_INTERVAL_MS, DEFAULT_POLL_MAX_ATTEMPTS
  • GatewayError, parseGatewayError

ดู Installation เพื่อเริ่มต้น