Text to speech (OpenAI-compatible)
Returns raw audio bytes, not JSON — set your client to read the response as binary.
The billing unit is model-dependent: some models bill per input character, others per output token. Check the model's pricing before batching large jobs.
Authorization
bearerAuth Authorization: Bearer <your RouteMux API key>.
Create keys at https://routemux.com/console/keys. New keys use the sk- prefix;
the legacy rmx_live_ prefix is still accepted.
The Anthropic SDK's x-api-key and the Google SDK's x-goog-api-key are accepted too.
Sending several key headers with different values returns 400 AUTH_AMBIGUOUS_API_KEY.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Request and response bodies match the upstream provider's official format verbatim —
RouteMux passes them through untouched. See the provider's own docs for field definitions;
the gateway itself only reads model and stream.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/audio/speech" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/tts-1", "input": "A neon city at dusk", "voice": "alloy" }'{ "model": "string", "stream": true}