Skip to main content
If your application already has a provider adapter, keep that adapter shape and move the implementation to Gradium endpoints, x-api-key auth, Gradium voice_id values, and Gradium WebSocket messages. For realtime apps, Gradium also gives you STT semantic VAD and adaptive delay controls in the same API surface.

Endpoint Swap

Auth Mapping

Gradium POST TTS

Gradium’s POST endpoint returns audio bytes when only_audio is true, so the rest of your “write this response to a file or player” code can stay the same.
Gradium

TTS Field Mapping

Gradium uses a compact output_format string: wav, pcm, opus, ulaw_8000, alaw_8000, or explicit PCM rates such as pcm_16000.

WebSocket TTS Migration

Gradium sends setup first, then one or more text messages, then end_of_stream. Use client_req_id when you need to correlate concurrent logical requests on one socket.
Gradium messages
For a single streaming utterance, client_req_id and close_ws_on_eos: false are optional. Use them when you want multiple utterances on one socket.

TTS Feature Mapping

Gradium Streaming STT

Gradium STT uses JSON messages for direct WebSocket audio, with base64 payloads. It returns text, end_text, step, flushed, and end_of_stream messages.
Gradium STT

Adapter Checklist

  • Replace provider URLs with matching Gradium endpoints.
  • Remove provider API-version headers; Gradium does not require them.
  • Change auth to x-api-key on servers or temporary ?token=... for browser WebSockets.
  • Rename transcript to text.
  • Flatten voice.id to voice_id.
  • Convert structured output_format into a Gradium format string.
  • For context-style routing, map the request identifier to client_req_id when you need response correlation.
  • For STT direct WebSocket clients, base64 encode audio inside JSON messages.

Next steps

Gradium TTS WebSocket guide

Streaming setup messages, audio messages, flush, and timestamps.

Multiplexing

Replace context-style routing with client_req_id.

Browser WebSockets

Use short-lived tokens without exposing API keys.

Telephony audio

Map low-sample-rate PCM, mu-law, and A-law formats.