ElevenLabs Voice Design
curl --request POST \
--url https://api.aihubmax.com/e/v1/audios/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "elevenlabs-voice-design",
"voice_description": "自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。",
"auto_generate_text": true
}
'import requests
url = "https://api.aihubmax.com/e/v1/audios/generations"
payload = {
"model": "elevenlabs-voice-design",
"voice_description": "自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。",
"auto_generate_text": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'elevenlabs-voice-design',
voice_description: '自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。',
auto_generate_text: true
})
};
fetch('https://api.aihubmax.com/e/v1/audios/generations', 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/audios/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'elevenlabs-voice-design',
'voice_description' => '自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。',
'auto_generate_text' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/e/v1/audios/generations"
payload := strings.NewReader("{\n \"model\": \"elevenlabs-voice-design\",\n \"voice_description\": \"自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。\",\n \"auto_generate_text\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aihubmax.com/e/v1/audios/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"elevenlabs-voice-design\",\n \"voice_description\": \"自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。\",\n \"auto_generate_text\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/e/v1/audios/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"elevenlabs-voice-design\",\n \"voice_description\": \"自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。\",\n \"auto_generate_text\": true\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "audio.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "audio"
}{
"error": {
"message": "Bad request",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "Validation failed",
"type": "validation_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}Speech Synthesis
ElevenLabs Voice Design
- Design candidate voices from a description and optional reference recording.
- Submit an asynchronous task and query its status.
- On completion, read results[0].text and all results[0].previews. Each preview has a download URL and generated_voice_id.
- Present all previews and obtain the user’s explicit choice before calling elevenlabs-voice-create.
- Bill actual returned preview text once at USD 0.08/1000 Unicode characters, without multiplying by candidate count. Save preview audio promptly.
POST
/
v1
/
audios
/
generations
ElevenLabs Voice Design
curl --request POST \
--url https://api.aihubmax.com/e/v1/audios/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "elevenlabs-voice-design",
"voice_description": "自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。",
"auto_generate_text": true
}
'import requests
url = "https://api.aihubmax.com/e/v1/audios/generations"
payload = {
"model": "elevenlabs-voice-design",
"voice_description": "自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。",
"auto_generate_text": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'elevenlabs-voice-design',
voice_description: '自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。',
auto_generate_text: true
})
};
fetch('https://api.aihubmax.com/e/v1/audios/generations', 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/audios/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'elevenlabs-voice-design',
'voice_description' => '自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。',
'auto_generate_text' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/e/v1/audios/generations"
payload := strings.NewReader("{\n \"model\": \"elevenlabs-voice-design\",\n \"voice_description\": \"自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。\",\n \"auto_generate_text\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aihubmax.com/e/v1/audios/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"elevenlabs-voice-design\",\n \"voice_description\": \"自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。\",\n \"auto_generate_text\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/e/v1/audios/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"elevenlabs-voice-design\",\n \"voice_description\": \"自然、温暖、清晰的成年中文旁白声音,适合长篇讲解。\",\n \"auto_generate_text\": true\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "audio.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "audio"
}{
"error": {
"message": "Bad request",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "Validation failed",
"type": "validation_error"
}
}{
"error": {
"message": "Rate limit exceeded",
"type": "rate_limit_error"
}
}{
"error": {
"message": "Internal server error",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}elevenlabs-voice-design generates candidate voices and previews from a description. Describe language, perceived age, tone and delivery. An optional reference recording can guide the design if you have permission to use it.
- Supply
voice_description(20–1000 characters). Choose exactly one preview text mode: supplytext(100–1000 characters), or setauto_generate_text=trueand omittext. - Query the task. On completion, read
results[0].textand all ofresults[0].previews[]. Each candidate contains a previewurlandgenerated_voice_id. Audio is returned as a download URL instead of Base64. - Present all candidates for listening and obtain the user’s explicit choice. Only then send the selected
generated_voice_idto Voice Create. Do not automatically save the first candidate or create every candidate.
reference_audio_base64 accepts nonempty bare Base64 only, not a URL or Data URI. Use your own or authorized recordings. Optional prompt_strength ranges from 0–1: 0 favors the reference and 1 favors the description. loudness ranges from -1–1 (default 0.5), guidance_scale from 0–100 (default 5), seed from 0–2147483647, and should_enhance defaults to false. This design model does not support quality; this and other unknown fields are rejected.
Candidates preserve actual media_type, duration_secs, language, detected_labels and other metadata, with file_name and file_size added. Fields may be null, and parsers should allow new fields. Candidate voices usually share the same text. Present every returned candidate; their number follows the actual response. Candidates may expire, so create the chosen voice promptly.
The base price is USD 0.08 per 1000 Unicode characters in the returned preview text. Count response text once, without multiplying by the number of candidates or rounding to blocks of 1000. Descriptions and controls are free. Automatic text reserves 1000 characters; supplied text reserves its input length. Completion adjusts the reservation using actual returned text and the saved group multiplier. Failures follow the task refund rules.
Download preview audio promptly; retention follows file storage policy. generated_voice_id identifies a candidate awaiting creation. Speech synthesis uses the voice_id returned by Create.Authorizations
Body
application/json
Preview text, 100–1000 characters. Supply text or set auto_generate_text=true, exclusively. Actual response text is billed once, without multiplying by candidate count.
Required string length:
100 - 1000Example:
"欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。欢迎收听今天的分享。"
Response
Task created