Skip to content
HomeModels
DocsAudio & speech

Text to speech

Convert text into natural speech. The response contains the audio file directly.

OpenAI compatible
POST/v1/audio/speech
Base URLhttps://api.linkinfra.ai

Authorization

Bearer Token
AuthorizationBearer <token>

Authenticate requests with your API key in the request header:

Authorization: Bearer sk-your-api-key

Need a key? Create one in the console

Request body

application/json
modelstringrequired

Model ID from the model catalog. Availability depends on your account group and configured channels.

inputstringrequired

Text to convert into speech.

voicestringrequired

Voice name, such as alloy. Available voices depend on the model.

response_formatstring

Audio format such as mp3, opus, aac, flac, wav, or pcm, subject to model support.

speednumber

Speech speed. Supported values depend on the upstream model.

Response

audio/mpeg
200Successful response
audiobinary

Binary audio data. Save it as a file in the requested format.

Request failed? Read the error handling guide