ChatKore API文档
  1. 语音接口
ChatKore API文档
  • 发出请求
  • 帮助中心
    • 收费标准
    • 常见问题
  • 模型接口
    • 聊天接口
      • 聊天接口
    • 向量接口
      • 创建向量
    • 图像接口
      • 创建图像
      • 编辑图像
      • 生成图像的变体
    • 语音接口
      • tts文本转语音
        POST
      • 创建转录
        POST
      • 创建翻译
        POST
  1. 语音接口

tts文本转语音

POST
https://api.chatkore.com/v1/audio/speech
了解如何将文本转换为音频。
将输入文本转录为音频。

请求参数

Header 参数
Authorization
string 
可选
示例值:
Bearer sk-xxxxxxxx
Content-Type
string 
可选
示例值:
application/json
Body 参数application/json
model
string 
必需
要使用的模型的 ID (tts-1, tts-1-hd)
input
string 
要输出的文本
必需
voice
string 
必需
语音选项不同声音ID(alloy, echo, fable, onyx, nova, shimmer)
response_format
string 
可选
音频的格式。支持的格式有mp3、opus、aac和flac。
speed
number 
可选
生成的音频的速度。选择一个介于0.25到4.0之间的值。1.0是默认值。
示例
{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.chatkore.com/v1/audio/speech' \
--header 'Authorization: Bearer sk-xxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
}'

返回响应

🟢200成功
application/json
Body
object {0}
示例
{}
上一页
生成图像的变体
下一页
创建转录
Built with