| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | required | API key or JWT token. Prefix with eu- to select the EU endpoint. |
apiUrl | string | https://api.kugelaudio.com | API base URL. For self-hosted deployments, see Self-Hosted Deployment. |
ttsUrl | string | same as apiUrl | TTS server URL for WebSocket streaming. |
timeout | number | 60000 | HTTP request timeout in milliseconds. |
keepalivePingInterval | number | null | 20000 | Milliseconds between WebSocket ping frames on the pooled connection. Set to 0 or null to disable. In browsers, pings are only sent via the ws package (skipped under native WebSocket). |
region | Region | – | 'eu', 'us', or 'global'. 'eu' selects the direct EU endpoint. |
isMasterKey | boolean | false | Treat apiKey as a master key (server-side use; bypasses billing). |
isToken | boolean | false | Treat apiKey as a JWT user token. Takes precedence over isMasterKey. |
orgId | number | – | Organisation to bill usage against. Required for token auth to record usage. |
Authentication modes
Most integrations pass a project-scoped API key. For server-side and user-token scenarios, set the matching flag:client.isMasterKey,
client.isToken, client.orgId, plus client.apiKey, client.ttsUrl, and
client.keepalivePingInterval.
Client lifecycle
Region Selection
Pin traffic to the direct EU endpoint when needed. See the EU endpoint guide for details.The full
KugelAudioOptions interface is documented in Types & Errors. Next: Generate Audio.