POST
/
audio
/
speech
curl --request POST \
  --url https://geekai.co/api/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "tts-1",
  "input": "你好, 很高兴见到你!",
  "voice": "alloy",
  "response_format": "mp3",
  "instructions": "<string>",
  "speed": 1,
  "retries": 0
}'
This response does not have an example.

注:语音模型名称设置参考系统支持语音模型列表,请求/响应参数结构完全兼容 OpenAI,切换模型时只需修改对应的模型名称即可,若模型请求/响应参数和OpenAI不一致,极客智坊底层会自动转换对齐。

响应数据格式和 OpenAI 完全兼容,即返回音频文件的二进制数据。

关于文本转语音 API 调用示例,可以参考这里:文本对话

请求/响应参数明细

Authorizations

Authorization
string
header
required

JWT认证token

Body

application/json

Response

200
audio/mpeg

成功响应

MP3格式音频