Generate speech

Convert text to audio

POST /v1/audio/speech

Service root: https://getrouter.ai

Protocol: OpenAI Audio

Authentication: Authorization: Bearer YOUR_API_KEY

Request body

The request body is required. Media type: application/json

Request fields

FieldTypeRequiredDescription
modelstringYes
inputstringYesText to convert
voicestringYesAllowed values: alloy, echo, fable, onyx, nova, shimmer
response_formatstringNoAllowed values: mp3, opus, aac, flac, wav, pcm; Default: "mp3"
speednumberNoDefault: 1; Range: 0.25–4

Example request

curl --request POST \
  --url https://getrouter.ai/v1/audio/speech \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "MODEL_ID",
  "input": "Hello, introduce yourself.",
  "voice": "alloy"
}'

Responses

StatusDescription
200Audio generated successfully

Success response fields

No top-level fields are defined in this schema.

For complete workflows and examples, read the Audio API Guide.


This page is generated from the public Relay OpenAPI specification. Browse the complete specification in the API Explorer.