Skip to main content
POST
Openai Audio Speech

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
x-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. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier.

Available options:
default,
priority,
flex
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 | null

Extra body parameters for the model.

Response

Successful Response