Documentation renewed! For old docs, visit doc.newapi.pro
New APINew API
User GuideInstallationAPI ReferenceAI ApplicationsHelp & SupportBusiness Cooperation
AI Model APIAudio

Text-to-Speech

Converts text to audio

POST
/v1/audio/speech

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

In: header

Request Body

application/json

model*string
input*string

要转换的文本

Lengthlength <= 4096
voice*string
Value in"alloy" | "echo" | "fable" | "onyx" | "nova" | "shimmer"
response_format?string
Default"mp3"
Value in"mp3" | "opus" | "aac" | "flac" | "wav" | "pcm"
speed?number
Default1
Range0.25 <= value <= 4

Response Body

audio/mpeg

curl -X POST "https://api.example.com/v1/audio/speech" \  -H "Content-Type: application/json" \  -d '{    "model": "tts-1",    "input": "string",    "voice": "alloy"  }'
"string"

How is this guide?

Last updated on