Base URL
All API requests should be made to:Authentication
Protected API requests require authentication using an API key. Include your API key in theAuthorization header:
X-API-Key: YOUR_API_KEY. Health checks and
GET /v1/models are public; synthesis, voice, and dictionary endpoints require
authentication. See Authentication for the
exact forms and key-management guidance.
Or for WebSocket connections, as a query parameter:
Request Format
HTTP Requests
- Content-Type:
application/json - Accept:
application/jsonoraudio/*for TTS endpoints
WebSocket Connections
- Protocol: WebSocket (wss://)
- Messages: JSON-encoded
Response Format
Success Responses
Success bodies are endpoint-specific. Catalog endpoints return JSON objects, voice-reference listing returns a JSON array, and synthesis endpoints return binary audio or WebSocket JSON frames. See the endpoint page for the exact shape.Error Responses
Error Codes
See Error Codes for the full lookup table, including HTTP status codes,error_code values, client-facing messages, and WebSocket
close codes.
Rate Limits
Rate limit errors useerror_code: "RATE_LIMITED" and HTTP status 429.
If retry timing is available, it is sent as the HTTP Retry-After header.
Endpoints Overview
Text-to-Speech
Voices
Models
Dictionaries
Usage
There is no usage REST endpoint. Per-session usage — audio seconds and the amount charged — is delivered inline on the streaming surfaces as theusage
block of the terminal frame (see
Stream and
Multi-context, or session.lastUsage /
getLastUsage() in the SDKs). Account-level totals and history live in the
dashboard.
SDKs
We provide official SDKs for easy integration:Python SDK
pip install kugelaudio
JavaScript SDK
npm install kugelaudio
Versioning
Public REST resources use the/v1/ URL prefix. WebSocket routes are exposed
under /ws/tts.