POST /v1/audio/speech

Text-to-speech endpoint.

Inference APIs

Synthesize audio from text and stream back the provider's binary audio response with the right content type.

POST/v1/audio/speech

Request

  • Auth: tenant auth when enabled; otherwise dev mode is open
  • Content-Type: application/json
  • Max body size: 256 KiB

Request fields

FieldTypeRequiredNotes
modelstringyesAlias or direct provider string
inputstringyesText to synthesize
voicestringyesVoice name
response_formatstringnoMaps to audio content type; unsupported or omitted values default to audio/mpeg
speednumbernoPassed upstream when present

Response handling

FieldTypeRequiredNotes
response bodybinaryyesUpstream audio payload
Content-TypeheaderyesPreserved from upstream when set, otherwise derived from response_format

Errors

HTTPCodeWhen
400invalid_request_errorMalformed JSON or missing model, input, or voice
400provider_not_configuredProvider missing from config or unavailable
400invalid_request_errorProvider does not support speech
502upstream_errorUpstream request failed

Notes

  • The response is binary, not JSON.
  • The gateway preserves the upstream content type when possible.
  • Format mapping falls back to audio/mpeg when no explicit match exists.