Skip to main content
Run Fish Audio’s real-time speech models closer to your users with SLNG, our preferred provider for regional hosting. Europe and Australia are available now, with more regions coming soon. Generate speech through its HTTP API or stream audio in real time over WebSocket.

Prerequisites

  • A SLNG account with an API key
  • curl for the HTTP example
  • Python 3.9 or higher with websockets 14+ and msgpack for the WebSocket example (pip install 'websockets>=14' msgpack)
Set your SLNG API key in the environment before running the examples:
Both HTTP and WebSocket requests authenticate with Authorization: Bearer <SLNG_API_KEY>.

Available models

Choose a model and use its endpoint path with https://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. Set reference_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:
The response contains binary audio in the requested format. Supported formats are 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.
Use a 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.