Text-to-Speech API
POST https://tokuse.com/v1/audio/speech turns text into audio with an OpenAI-compatible request. The response body is audio bytes, so save it or stream it instead of parsing JSON.
| Item | Value |
|---|---|
| Method and path | POST /v1/audio/speech |
| Authentication | Authorization: Bearer $TOKUSE_API_KEY |
| Models | TTS models enabled on the Volcengine upstream account |
| Pricing | Tokuse pricing and the upstream provider console |
Endpoint and authentication
Calls to Tokuse use the usual Bearer token. The upstream channel is where the special key format applies: a Volcengine TTS channel expects an appid|access_token key, not a standard Ark API key.
Configure the channel key in Tokuse before testing. The client request does not send appid|access_token; that value belongs to the upstream channel configuration.
Models and voices
Use a TTS model enabled on the upstream account and a voice ID that the model supports. Voice names differ between providers, so a voice that works with one TTS model may be rejected by another.
Request
curl https://tokuse.com/v1/audio/speech \
-H "Authorization: Bearer $TOKUSE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-tts-model",
"input": "One key, multiple model providers.",
"voice": "your-voice-id",
"response_format": "mp3"
}' \
--output speech.mp3
Response
HTTP/1.1 200 OK
Content-Type: audio/mpeg
(binary audio written to speech.mp3)
The exact content type depends on response_format. The important part is that the body is binary audio, not a JSON object.
Notes and limits
- For a Volcengine TTS upstream, set the channel key as
appid|access_token. A normal Ark key will not authenticate the TTS service. - Write the response to a file or pipe it to the client. Code that calls
response.json()will fail on this endpoint. - Long input text may need to be split. Check the selected model's text limit before sending a paragraph or document in one call.
Billing
No fixed prices are listed here. Speech synthesis is billed by input characters or audio seconds depending on the model. Check the Tokuse pricing page and the upstream provider console for current rates; gateway pricing is on /pricing.