| Builder method | Type | Default | Description |
|---|---|---|---|
builder(apiKey) | String | required | API key or token. Prefix with eu- for the EU endpoint. |
.apiUrl(...) | String | https://api.kugelaudio.com | REST + WebSocket base URL. For self-hosted deployments, see Self-Hosted Deployment. |
.ttsUrl(...) | String | same as apiUrl | Separate TTS server URL for WebSocket streaming. |
.region(Region) | Region | – | Region.EU, Region.US, or Region.GLOBAL. |
.timeout(Duration) | Duration | 60 s | HTTP request timeout. |
.autoConnect(boolean) | boolean | true | Pre-open the WebSocket at construction. |
.keepalivePingInterval(Duration) | Duration | 20 s | WebSocket ping interval to prevent idle timeouts. Pass null to disable. |
.masterKey() | – | – | Treat the key as a master key (server-side; bypasses billing). |
.token() | – | – | Treat the key as a JWT user token. |
.orgId(int) | int | – | Organisation to bill usage against (required for token auth). |
Authentication modes
Most integrations use a project-scoped API key. For server-side and user-token scenarios, set the mode on the builder:options.getAuthMode(), which returns one of
AuthMode.API_KEY, AuthMode.MASTER_KEY, or AuthMode.TOKEN.
Region Selection
Pin traffic to the direct EU endpoint when needed. See the EU endpoint guide for details.Next: Generate & Stream — one-shot generation, streaming, normalization, and word timestamps.