Create speech

post/v1/audio/speech

Convert text into audio.

Authentication

Send your OLETOKEN API key as a Bearer token. Keys are created on the API Keys page of the console.

Authorization: Bearer $OLETOKEN_API_KEY

Request body

Content-Type:application/json

FieldTypeRequiredDescription
modelstring
inputstring≤ 4096The text to convert
voicestringalloyechofableonyxnovashimmer
response_formatstringdefault: mp3mp3opusaacflacwavpcm
speednumber0.25–4default: 1

Responses

200Audio generated

This response has no JSON body.

Example request

curl -X POST 'https://api.oletoken.ai/v1/audio/speech' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "tts-1",
    "input": "string",
    "voice": "alloy"
  }'