API reference
Text to speech (Audio Speech)
Parameters, request examples and the response format for POST /v1/audio/speech — turn text into an audio file for order updates, voice notifications and narrated content. Same format as the OpenAI speech API. Requests are relayed as-is.
POST /v1/audio/speech turns text into speech and returns the audio file directly (MP3 by default) — handy for order updates, voice notifications, narrated content and spoken support replies. The format matches the OpenAI speech API. Requests are relayed to the model service in their original format; available voices and formats vary by model and follow that model's official documentation.
https://open.tutujin.com/v1/audio/speechHeaders
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer sk-..., an API key from the console |
Content-Type | Yes | application/json |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name, e.g. tts-1 |
input | string | Yes | Text to read aloud. Each request has a length limit, so split long text into sentences or paragraphs |
voice | string | Yes | Voice. OpenAI TTS models offer alloy, echo, fable, onyx, nova, shimmer and others; other vendors' models use different voice names |
response_format | string | No | Audio format; OpenAI models support mp3 (default), opus, aac, flac, wav, pcm |
speed | number | No | Speaking speed, 0.25 to 4.0, default 1.0 |
Request example
curl https://open.tutujin.com/v1/audio/speech \
-H "Authorization: Bearer $TUTUJIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "Your order has shipped and should arrive tomorrow.",
"voice": "alloy"
}' \
--output notice.mp3import os
from openai import OpenAI
client = OpenAI(base_url="https://open.tutujin.com/v1", api_key=os.environ["TUTUJIN_API_KEY"])
with client.audio.speech.with_streaming_response.create(
model="tts-1",
voice="alloy",
input="Your order has shipped and should arrive tomorrow.",
) as resp:
resp.stream_to_file("notice.mp3")import fs from 'node:fs'
import OpenAI from 'openai'
const client = new OpenAI({ baseURL: 'https://open.tutujin.com/v1', apiKey: process.env.TUTUJIN_API_KEY })
const resp = await client.audio.speech.create({
model: 'tts-1',
voice: 'alloy',
input: 'Your order has shipped and should arrive tomorrow.',
})
fs.writeFileSync('notice.mp3', Buffer.from(await resp.arrayBuffer()))Response format
A successful call returns raw audio bytes, not JSON. The Content-Type response header gives the audio type, e.g. audio/mpeg for MP3. With cURL, add --output to save it to a file.
Errors come back as a JSON error body with an HTTP error status, so check the status code before treating the body as audio. See Errors and retries.
Notes
- This endpoint is relayed as-is and has not been verified separately on this site. When you switch to another vendor's speech model, confirm its
voicevalues and output formats first. - Split long text into sentences or paragraphs, synthesize each and join the audio in order; overly long text in one request returns an error.
- Synthesize fixed phrases such as "Your order has shipped" once and reuse the cached audio instead of requesting it every time.
- Billing follows the model's price list; the Usage page in the console is the record of what you were charged.
Models that support this endpoint
| Model | Vendor | Cheapest group | Input ¥/1M | Output ¥/1M | Per request ¥ |
|---|---|---|---|---|---|
| minimax/speech-2.8-turbo | MiniMax | Standard | — | — | ¥4 |
| minimax/speech-2.8-hd | MiniMax | Standard | — | — | ¥7 |
| tts-1 | OpenAI | Standard | ¥30 | ¥30 | — |
| tts-1-1106 | OpenAI | Standard | ¥30 | ¥30 | — |
| tts-1-hd-1106 | OpenAI | Standard | ¥60 | ¥60 | — |
| tts-1-hd | OpenAI | Standard | ¥60 | ¥60 | — |
| speech-2.8-turbo | MiniMax | Standard | ¥700 | ¥700 | — |
| speech-2.8-hd | MiniMax | Standard | ¥700 | ¥700 | — |
Prices in CNY, cheapest group for each model; updated Nov 12, 2026, 8:17 PM.
Still stuck? Add our WeChat support JsnonoChat and send the request id from the error message, and we will look into it.