If your Cartesia integration already has a provider adapter, migrating to Gradium should be a small change: point the adapter at Gradium, send your Gradium API key inDocumentation Index
Fetch the complete documentation index at: https://docs.gradium.ai/llms.txt
Use this file to discover all available pages before exploring further.
x-api-key, and map Cartesia’s transcript
and voice.id fields to Gradium’s text and voice_id.
The shape stays familiar:
- Complete utterance: one
POST, one audio response body. - Streaming utterance: one WebSocket connection, text in, audio chunks out.
Endpoint swap
| Flow | Cartesia | Gradium |
|---|---|---|
| One-shot TTS | POST https://api.cartesia.ai/tts/bytes | POST https://api.gradium.ai/api/post/speech/tts |
| Streaming TTS | wss://api.cartesia.ai/tts/websocket | wss://api.gradium.ai/api/speech/tts |
POST migration
Cartesia’s bytes endpoint sends a full transcript and returns audio bytes. Gradium’s POST endpoint does the same whenonly_audio is
true.
Field mapping
| Cartesia concept | Gradium field |
|---|---|
transcript | text |
voice.id | voice_id |
model_id | model_name |
output_format.container | output_format |
Cartesia-Version | Not required by Gradium |
Authorization bearer token or X-API-Key header | x-api-key header |
WebSocket migration
For a single streaming utterance, Gradium does not require Cartesia’s context id flow. Open the socket, sendsetup, send text, then end the
stream.
| Cartesia streaming step | Gradium streaming step |
|---|---|
| Connect to Cartesia WebSocket | Connect to wss://api.gradium.ai/api/speech/tts |
| Send request with transcript and voice | Send setup, then text |
| Read audio chunks | Read audio messages |
| Finish the utterance | Send end_of_stream |
audio messages contain base64-encoded audio chunks. Decode
and append them in the same place your Cartesia adapter handled audio
chunk payloads.
If you use multiple simultaneous utterances on one connection, see
Multiplexing.
Checklist
- Replace the Cartesia URL with the Gradium endpoint.
- Change auth to
x-api-key. - Rename
transcripttotext. - Flatten
voice.idtovoice_id. - Change Cartesia’s structured
output_formatto a Gradium format string such aswav,pcm, oropus. - Keep your audio output path.
Next steps
Gradium TTS REST guide
Full POST schema, response modes, and output formats.
Gradium TTS WebSocket guide
Streaming setup messages, audio messages, flush, and timestamps.