Skip to main content
POST
/
v3
/
audio
/
speech
Generate speech (TTS)
curl --request POST \
  --url https://api.opper.ai/v3/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": "<string>",
  "model": "<string>"
}
'
{
  "audio": {
    "b64_json": "<string>",
    "file_id": "<string>",
    "mime_type": "<string>",
    "url": "<string>"
  },
  "created": 123,
  "id": "<string>",
  "model": "<string>",
  "usage": {
    "characters": 123,
    "cost": 123
  }
}
See the Audio guide for runnable examples and voices.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Body

application/json
input
string
required
model
string
required
format
string
parameters
object
speed
number
store
boolean

Persist the generated audio to /v3/files and return a reusable file_id. Defaults to true; set false to skip.

voice
string

Response

Successful response

audio
object
required
created
integer
required
id
string
required
model
string
required
usage
object
required