ElevenLabs 预设音色目录
curl --request GET \
--url https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"voice_id": "004KTmksPwLFhbYi3ENc",
"name": "Zak - Male, Welsh Native",
"description": "Casual voice nationality Welsh/English.",
"languages": [
"en",
"pt",
"ar",
"it",
"es",
"ko",
"uk",
"hi",
"de",
"no",
"hr",
"cs",
"vi",
"pl",
"sv"
],
"accent": "british",
"gender": "male",
"age": "middle_aged",
"category": [
"high_quality"
],
"preview_url": "https://storage.googleapis.com/eleven-public-prod/database/workspace/20f2f3fe22fc43f49c5fedebde76fac4/voices/004KTmksPwLFhbYi3ENc/2a637b54-34f0-48a2-b396-50eb4f3aedad.mp3",
"notice_period_days": 730
}
]语音合成
ElevenLabs 预设音色目录
返回预设音色目录,不扣 quota;保留音色 ID、试听地址等元数据。目录不是完整白名单,收录条目不保证账户访问权限或与全部模型及参数兼容。 不传 limit 和 offset 时保持返回完整数组;传入任一参数启用可选分页,响应仍为数组。目录更新通常不频繁,不承诺固定周期;首次下载或主动重新下载时,建议按页下载全部条目,合并并保存到本地,成功后再替换旧目录。语言、性别、名称等筛选由业务端或用户本地完成。
GET
/
v1
/
configs
/
elevenlabs-preset-voice-id
ElevenLabs 预设音色目录
curl --request GET \
--url https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"voice_id": "004KTmksPwLFhbYi3ENc",
"name": "Zak - Male, Welsh Native",
"description": "Casual voice nationality Welsh/English.",
"languages": [
"en",
"pt",
"ar",
"it",
"es",
"ko",
"uk",
"hi",
"de",
"no",
"hr",
"cs",
"vi",
"pl",
"sv"
],
"accent": "british",
"gender": "male",
"age": "middle_aged",
"category": [
"high_quality"
],
"preview_url": "https://storage.googleapis.com/eleven-public-prod/database/workspace/20f2f3fe22fc43f49c5fedebde76fac4/voices/004KTmksPwLFhbYi3ENc/2a637b54-34f0-48a2-b396-50eb4f3aedad.mp3",
"notice_period_days": 730
}
]需要 Bearer Token,不扣 quota。返回音色目录数组,包含 voice_id、name、description、languages、preview_url 等元数据。试听 preview_url 后,将音色 ID 填入 Speech 的
不传
分页响应通过以下响应头提供进度,浏览器可直接读取:
按
voice_id 或 Dialogue 的 inputs[].voice_id。目录不是完整白名单,未收录的已有音色 ID 仍可提交;条目收录不保证账户访问权限或与全部模型及参数兼容。空目录返回 [],目录不可用返回 503。
分页下载
目录更新通常不频繁,不承诺固定更新周期。首次下载和主动重新下载时,建议按页拉取全部条目,按返回顺序合并并保存到本地,全部成功后再替换旧目录。业务端或用户本地可按语言、性别、名称等元数据自行筛选;接口不提供这些筛选参数。GET https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id?limit=100&offset=0
Authorization: Bearer YOUR_API_KEY
limit 和 offset 时,继续返回原来的完整数组。传入任一参数启用分页,响应仍为数组,条目顺序和元数据保持不变。
| 参数 | 规则 |
|---|---|
limit | 每页上限,十进制整数 1–1000;只传 offset 时默认为 100 |
offset | 从 0 开始的偏移量,非负十进制整数;分页时默认为 0 |
| 响应头 | 含义 |
|---|---|
X-Total-Count | 当前目录总条目数 |
X-Limit | 实际采用的每页上限 |
X-Offset | 本页偏移量 |
X-Next-Offset | 下一页偏移量;空字符串表示结束 |
X-Next-Offset 继续请求,收到空字符串即停止;即使末页恰好填满 limit,也不需要额外请求。空目录、偏移量等于或超过总数时返回 [],下一偏移量为空。非法参数返回 HTTP 400,error.code 为 invalid_pagination。分页期间不锁定目录快照;如果总数发生变化,请从 offset=0 重新下载。
完整下载示例
下面的 Python 示例适用于首次下载和主动重新下载。设置环境变量AIHUB_API_KEY 后运行;下载失败时保留原本的 elevenlabs-voices.json。
import json
import os
from pathlib import Path
from urllib.request import Request, urlopen
def download_catalog(api_key):
entries = []
offset = 0
total = None
while True:
url = (
"https://api.aihubmax.com/e/v1/configs/elevenlabs-preset-voice-id"
f"?limit=100&offset={offset}"
)
request = Request(url, headers={"Authorization": f"Bearer {api_key}"})
with urlopen(request, timeout=60) as response:
page = json.load(response)
count = int(response.headers["X-Total-Count"])
next_offset = response.headers.get("X-Next-Offset")
if total is None:
total = count
if count != total or not isinstance(page, list) or next_offset is None:
raise RuntimeError("Catalog changed or pagination is unavailable; retry from offset=0")
entries.extend(page)
if next_offset == "":
if len(entries) != total:
raise RuntimeError("Incomplete catalog; keep the previous local copy")
return entries
if not page or int(next_offset) != len(entries):
raise RuntimeError("Invalid pagination progress; keep the previous local copy")
offset = int(next_offset)
catalog = download_catalog(os.environ["AIHUB_API_KEY"])
target = Path("elevenlabs-voices.json")
staged = target.with_suffix(".download.json")
staged.write_text(json.dumps(catalog, ensure_ascii=False), encoding="utf-8")
staged.replace(target)
授权
查询参数
响应
目录数组;分页只改变返回范围,保留原数组结构。空目录或越界页返回 []。以下响应头仅在分页请求中返回,并通过 Access-Control-Expose-Headers 向浏览器开放。