Skip to main content
POST
/
v1
/
openai
/
audio
/
speech
Openai Audio Speech
curl --request POST \
  --url https://api.example.com/v1/openai/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": "<string>",
  "service_tier": "default",
  "voice": "<string>",
  "response_format": "wav",
  "speed": 1,
  "extra_body": {}
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-deepinfra-source
string | null
xi-api-key
string | null

Body

application/json
model
string
required

model name

Example:

"deepinfra/tts"

input
string
required

Text to convert to speech

Example:

"I'm beginnin' to feel like a Rap God, Rap God\nAll my people from the front to the back nod, back nod\nNow, who thinks their arms are long enough to slap box, slap box?\nThey said I rap like a robot, so call me Rap-bot"

service_tier
enum<string> | null

The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it).

Available options:
default,
priority
voice
string | null

Preset voices to use for the speech.

response_format
enum<string>
default:wav

response format for the speech

Available options:
mp3,
opus,
flac,
wav,
pcm
Examples:

"mp3"

"opus"

"flac"

"wav"

"pcm"

speed
number
default:1

speed of the speech

Required range: 0.25 <= x <= 4
extra_body
Extra Body · object

Extra body parameters for the model.

Response

Successful Response