x-api-key instead of a
Bearer token, rename a few request fields, and replace MessagePack
WebSocket events with JSON messages, which removes the msgpack
dependency.
Why choose Gradium over Fish Audio
- Official voice catalog. Gradium’s flagship voices are first-party voices built with voice experts and researchers for every supported language. Fish Audio’s library is community-uploaded models owned by individual accounts.
- Streaming STT. Gradium transcribes live audio over WebSocket with semantic VAD and adaptive delay for turn-taking. Fish Audio only offers batch transcription.
- Speech-to-speech translation. Gradium’s S2S endpoint translates live speech into another language over one WebSocket: audio streams in, translated audio and transcript stream out. Fish Audio has no equivalent.
- JSON everywhere. All Gradium WebSocket messages are JSON, so
clients drop the MessagePack dependency and work directly with
wscat, browsers, and standard libraries. - Browser-safe auth. Short-lived tokens from
GET /api/api-keys/tokenlet browser and mobile clients connect without embedding API keys; see Browser WebSockets. - Production controls. Multiplexing with
client_req_id, pronunciation dictionaries, text rewriting, and telephony formats (ulaw_8000,alaw_8000) are built into the same endpoints.
Endpoint Swap
Auth Mapping
model_name goes in the request body or setup message; default
always points at the current recommended model, so most integrations
never set it.
Voice Catalog
Gradium’s flagship voice catalog covers all supported languages, including French, German, Spanish, and Portuguese, plus regional variants such as Brazilian Portuguese and Mexican Spanish.
Pick a replacement
voice_id per language from the
voice library, or clone a voice you
own as a private custom voice (see
Voice Cloning Migration).
Gradium POST TTS
Withonly_audio: true, the response is raw audio bytes, same as Fish
Audio’s /v1/tts.
Gradium
TTS Field Mapping
output_format is one string instead of separate format and
sample-rate fields: wav, pcm, opus, ulaw_8000, alaw_8000, or
explicit PCM rates such as pcm_16000 and pcm_44100.
Gradium does not return MP3. Replace
format: "mp3" with wav for
file output or opus for compressed streaming.WebSocket TTS Migration
Fish Audio’s/v1/tts/live socket uses MessagePack events. Gradium’s
TTS socket uses JSON text messages.
Gradium messages
Gradium replies with
ready after setup, streams audio messages,
and finishes with its own end_of_stream. For several logical requests
on one socket, add client_req_id to each message and set
close_ws_on_eos: false; see Multiplexing.
Voice Cloning Migration
Fish Audio clones a voice by creating a model from uploaded samples. Gradium uses onePOST /voices/ call; the returned uid is the
voice_id for any TTS request.
Gradium
Manage clones with
GET, PUT, and DELETE on
/voices/{voice_uid}; see Custom Voices.
STT Migration
Fish Audio’s/v1/asr takes MessagePack or multipart uploads and
returns one JSON object. Gradium’s POST STT endpoint takes raw audio
bytes as the request body and streams newline-delimited JSON messages.
Gradium
For live transcription, use the WebSocket endpoint; it emits
step
messages with inactivity_prob for turn-taking. See
Speech-to-Text.
Adapter Checklist
- Replace Fish Audio URLs with the matching Gradium endpoints.
- Change auth from
Authorization: Bearertox-api-key, or short-lived?token=...for browser WebSockets. - Drop the
modelheader; setmodel_nameonly for a specific model. - Rename
reference_idtovoice_id, using flagship voices from the voice library. - Collapse
formatandsample_rateinto oneoutput_formatstring; replace MP3 withwavoropus. - Replace MessagePack events (
start,text,stop) with JSON messages (setup,text,end_of_stream). - Re-create cloned voices with
POST /voices/and use the returneduidvalues. - Move prosody and sampling knobs into
json_config; see Voice Settings. - For batch STT, send raw audio bytes and read streamed JSON messages.
Next steps
Gradium TTS WebSocket guide
Streaming setup messages, audio messages, flush, and timestamps.
Custom Voices
Create, update, and manage cloned voices from reference audio.
Voice Settings
Speed, temperature, and similarity controls via json_config.
Speech-to-Text
Streaming transcription with semantic VAD and flush.