Everstack

Text-to-Speech: Generate audio from text

POST/v1/audio/speech
POST/v1/audio/speech

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Request Body

PropertyTypeRequiredDescription
modelstringNo
inputstringNo
voicestringNo
responseFormatstringNo
speednumberNo
metadataobjectNo

Responses

200 Generated audio file

PropertyTypeDescription
audiostring
formatstring
contentTypestring
durationSecondsnumber
inputCharactersinteger

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X POST "http://localhost:8089/v1/audio/speech" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"string","input":"string","voice":"string","responseFormat":"string","speed":0}'
const response = await fetch("http://localhost:8089/v1/audio/speech", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "model": "string",
  "input": "string",
  "voice": "string",
  "responseFormat": "string",
  "speed": 0
}),
});
const data = await response.json();
import requests

response = requests.post(
    "http://localhost:8089/v1/audio/speech",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
  "model": "string",
  "input": "string",
  "voice": "string",
  "responseFormat": "string",
  "speed": 0
},
)
data = response.json()

Response

{
  "audio": "string",
  "format": "string",
  "contentType": "string",
  "durationSeconds": 0,
  "inputCharacters": 0
}
{
  "code": 0,
  "message": "string",
  "details": [
    {
      "@type": "string"
    }
  ]
}