Platform notice: all DeepSeek models are now live. New users receive trial credits on sign-up.
Api reference

Text to speech

OpenAI-compatible text-to-speech API, callable with API Keys and billed per character.

Text-to-speech uses Authorization: Bearer sk-tp-... and shares the same Key authentication, rate limiting, and billing pipeline as chat completions. The console Playground · Speech uses the same capability.

Speech synthesis

POST /api/v1/audio/speech
  • Auth: Authorization: Bearer sk-tp-...
  • Content-Type: application/json

Request body

ParameterTypeRequiredDescription
modelstringYesPlatform TTS model name, see Models
inputstringYesText to synthesize; must not be empty
voicestringYesVoice identifier; allowed values depend on the model
response_formatstringNomp3 (default), wav, opus, aac, flac, pcm
speednumberNoSpeech rate multiplier, defaults to 1.0
Other params-NoPassed through per the OpenAI protocol and model support

Response

Returns raw audio bytes with the matching Content-Type (e.g. audio/mpeg); not JSON.

curl https://api.openruler.ai/api/v1/audio/speech \
  -H "Authorization: Bearer sk-tp-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"tts-1","input":"Hello from OpenRuler","voice":"alloy"}' \
  --output speech.mp3

Billing

  • Billed per input character at "yuan per 10k characters"; the model must use per-character pricing.
  • Responses include X-Cost-Yuan (cost) and X-Bill-Units (character count) headers.

Pre-checks

  1. Key valid and not revoked (including all parents), account active → otherwise 401
  2. Model exists and is live (LIVE), priced per character with a unit price → otherwise 400
  3. input not empty → otherwise 400
  4. Balance above zero and Key chain quota not exhausted → otherwise 402

Audio translation (planned)

POST /api/v1/audio/translations

🧭 Not available yet. The upstream gateway used by the platform does not expose /v1/audio/translations. To avoid documenting an endpoint that cannot actually be called, it remains closed. For cross-language audio, call Speech to Text first, then translate the text with a chat model.

Voice management

Clone your own voice and use it for synthesis — see Voice Management (voice cloning). The contract is finalized but not live yet (needs a direct MiniMax channel). Today only the model's built-in voice values are available.

Errors

For error format and troubleshooting see FAQ · Error codes. Upstream errors are passed through unchanged.

On this page

OpenRuler