Elevenlabs
  1. 文字转语音
Elevenlabs
  • 文字转语音
    • 减少延迟
    • 文字转语音
      POST
    • Streaming
      POST
  • 历史
    • 获取生成的物品
      GET
    • 通过 id 获取历史记录
      GET
    • 删除历史记录项
      DELETE
    • 从历史项目中获取音频
      GET
    • 下载历史项目
      POST
  • 样品
    • 删除样本
      DELETE
    • 从样本中获取音频
      GET
  • 用户
    • 获取用户订阅信息
      GET
    • 获取用户信息
      GET
  • 声音
    • 获取声音
      GET
    • 获取默认语音设置
      GET
    • 获取语​​音设置
      GET
    • 获取语​​音
      GET
    • 删除语音
      DELETE
    • 编辑语音设置
      POST
    • 添加语音
      POST
    • 编辑声音
      POST
  • 语音库
    • 查询库
      GET
    • 添加共享语音
      POST
  • 项目
    • 获取项目
      GET
    • 通过 id 获取项目
      GET
    • 添加项目
      POST
    • 删除项目
      DELETE
    • 转换项目
      POST
    • 获取项目快照
      GET
    • 流式传输项目音频
      POST
    • 获取章节
      GET
    • 通过 id 获取章节
      GET
    • 删除章节
      DELETE
    • 转换章节
      POST
    • 获取章节快照
      GET
    • 流式传输章节音频
      POST
    • 更新发音词典
      POST
  • 发音词典
    • 从文件添加
  • 模型
    • 获取模型
  • 音频原生
    • 创建启用音频的项目
  1. 文字转语音

Streaming

开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/v1/text-to-speech/{voice_id}/stream
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v1/text-to-speech//stream' \
--header 'xi-api-key;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model_id": "<string>",
  "pronunciation_dictionary_locators": [
    {
      "pronunciation_dictionary_id": "<string>",
      "version_id": "<string>"
    }
  ],
  "text": "<string>",
  "voice_settings": {
    "similarity_boost": 123,
    "stability": 123,
    "style": 123,
    "use_speaker_boost": true
  }
}'
响应示例响应示例
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

请求参数

Path 参数
voice_id
string 
必需
要使用的语音 ID,可以使用 https://api.elevenlabs.io/v1/voices 列出所有可用的语音。
Header 参数
Content-Type
string 
必需
示例值:
application/json
xi-api-key
string 
可选
您的 API 密钥。这是大多数端点以编程方式访问我们的 API 所必需的。您可以使用网站上的“个人资料”选项卡查看您的 xi-api-key。
Body 参数application/json
model_id
string 
可选
将使用的模型的标识符,您可以使用 GET /v1/models 查询它们。该模型需要支持文本到语音,您可以使用 can_do_text_to_speech 属性进行检查。
pronunciation_dictionary_locators
array [object {2}] 
可选
要应用于文本的发音词典定位器(id、version_id)列表。它们将按顺序应用。每个请求最多可以有 3 个定位器
pronunciation_dictionary_id
string 
必需
version_id
string 
必需
text
string 
必需
将转换为语音的文本。
voice_settings
object 
可选
语音设置会覆盖给定语音的存储设置。它们仅适用于给定的请求。
similarity_boost
integer 
必需
stability
integer 
必需
style
integer 
可选
use_speaker_boost
boolean 
可选
示例

返回响应

🟠422参数错误
application/json
Body
detail
array [object {3}] 
必需
loc
array[string]
可选
msg
string 
可选
type
string 
可选
上一页
文字转语音
下一页
获取生成的物品
Built with