v4

latestOpenAPI 3.1.02026-07-31155218294.8 KB
Audio

Openai Audio Speech

post/v1/audio/speech

Headers

x-deepinfra-sourcestring nullable
xi-api-keystring nullable
x-api-keystring nullable

Request body

service_tier'default' | 'priority' | 'flex'
fail_fastboolean

If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.

modelstring required

model name

inputstring required

Text to convert to speech

voicestring nullable

Preset voices to use for the speech.

response_format'mp3' | 'opus' | 'flac' | 'wav' | 'pcm'

Select the desired format for the speech output. Supported formats include mp3, opus, flac, wav, and pcm.

speednumber

speed of the speech

extra_bodyobject nullable

Extra body parameters for the model.

Example request

{
  "model": "deepinfra/tts",
  "input": "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",
  "response_format": "mp3"
}

Response

Successful Response

{"stackTrail":"paths:/v1/audio/speech:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}