Audio

Create speech

Generates audio from the input text (Text-to-Speech).

post/v1/audio/speech

Request

  • Base URL: https://api.tokenlab.sh
  • URL: https://api.tokenlab.sh/v1/audio/speech
  • Auth: HTTP bearer

Headers

X-TokenLab-Delivery-Policy'auto' | 'verified' | 'official'

Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, request acceptance, or persistent resource creation.

Request body

modelstring required

TTS model. There is no default model. Query GET /v1/models?recommended_for=tts for the current shortlist.

inputstring required

Text to synthesize.

voice_idstring

Voice selector for MiniMax-compatible speech models.

instructionsstring

Optional style or delivery instructions for OpenAI-compatible TTS models that support them.

promptstring

Optional speaking style prompt for Gemini TTS models.

language_codestring

Optional language code for Gemini, xAI, and compatible TTS models.

response_formatstring

Audio format. Common values include mp3, opus, aac, flac, wav, and pcm. Supported values vary by model family.

stream_format'audio' | 'sse'

TokenLab delivery format.

speednumber

Speech speed for model families that support it.

temperaturenumber

Sampling temperature for Gemini-compatible TTS models.

Example request

{
  "model": "grok-tts",
  "language_code": "en-US",
  "response_format": "mp3"
}

Response

Audio file

Changes

No recorded changes to this operation across all 1 revision of this API.