文本转语音(OpenAI 兼容)
返回的是裸音频字节,不是 JSON —— 客户端要按二进制读响应。
计费单位取决于模型:有的按输入字符计,有的按输出 token 计。批量跑大任务之前先看该模型的定价。
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}