跳轉到主要內容
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>"

授權

Authorization
string
header
必填

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

主體

application/json
model
string
必填

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

範例:

"tts-1"

input
string
必填

Text to synthesize, up to 4096 characters.

voice
enum<string>
必填

Voice preset.

可用選項:
alloy,
echo,
fable,
onyx,
nova,
shimmer
response_format
string
預設值:mp3

Output audio format.

speed
number
預設值:1

Speaking speed.

必填範圍: 0.25 <= x <= 4

回應

Binary audio stream.

The response is of type file.