Skip to main content
POST
/
v1
/
audio
/
speech
Create speech
curl --request POST \
  --url https://api.dgrid.ai/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "tts-1",
  "input": "Hello from DGrid.",
  "voice": "alloy"
}
'
"<string>"

Authorizations

Authorization
string
header
required

Your DGrid API key. All endpoints use Authorization: Bearer <DGRID_API_KEY>.

Body

application/json
model
string
required

Voice model, such as tts-1 or tts-1-hd.

Example:

"tts-1"

input
string
required

Text to synthesize, up to 4096 characters.

voice
enum<string>
required

Voice preset.

Available options:
alloy,
echo,
fable,
onyx,
nova,
shimmer
response_format
string
default:mp3

Output audio format.

speed
number
default:1

Speaking speed.

Required range: 0.25 <= x <= 4

Response

Binary audio stream.

The response is of type file.