Prerequisites
- A SLNG account with an API key
curlfor the HTTP example- Python 3.9 or higher with
websockets14+ andmsgpackfor the WebSocket example (pip install 'websockets>=14' msgpack)
Authorization: Bearer <SLNG_API_KEY>.
Available models
Choose a model and use its endpoint path withhttps://api.slng.ai for HTTP or wss://api.slng.ai for WebSocket. Each model’s API references describe its supported request fields and response format.
The examples below use S2.1 Pro in Europe (
eu). See Regions for availability, region selection, and requests for additional regions.
Voices
Browse SLNG’s official Fish Audio voice list for available voices and audio samples. Setreference_id to the Voice ID listed for your chosen voice. The examples use 9a9cf47702da476aa4629e2506d4a857 (Hannah).
For voice cloning with inline reference audio, SLNG accepts references containing audio bytes and their transcripts through MessagePack requests.
REST API
Synthesize a complete utterance with a single request:mp3, wav, pcm, and opus.
WebSocket streaming
Send text incrementally and receive audio chunks over a persistent connection. SLNG’s Fish Audio WebSocket endpoint uses MessagePack for both outgoing and incoming messages. MessagePack is a binary serialization format that can carry audio bytes directly.flush event to synthesize buffered text while keeping the session open. The stop event ends input and lets the server finish synthesis.
Regions
Current and upcoming regional availability for Fish Audio through SLNG:
For available regions, set
X-World-Part-Override to the region code in your HTTP request or WebSocket connection headers. If you omit the header, SLNG selects the region automatically. Region codes for upcoming regions will be added when they become available.
For upcoming region availability or to request a new region, contact Fish Audio. Include your preferred region, model, and expected usage so our team can discuss availability and timelines.
