Eleven v3
curl --request POST \
--url https://api.snapgen.org/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "<string>",
"speed": 123,
"language": "<string>",
"stability": 123,
"similarity_boost": 123,
"style": 123,
"use_speaker_boost": true,
"seed": 123,
"previous_text": "<string>",
"next_text": "<string>",
"apply_text_normalization": "<string>"
}
'import requests
url = "https://api.snapgen.org/v1/audio/speech"
payload = {
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "<string>",
"speed": 123,
"language": "<string>",
"stability": 123,
"similarity_boost": 123,
"style": 123,
"use_speaker_boost": True,
"seed": 123,
"previous_text": "<string>",
"next_text": "<string>",
"apply_text_normalization": "<string>"
}
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: '<string>',
input: '<string>',
voice: '<string>',
response_format: '<string>',
speed: 123,
language: '<string>',
stability: 123,
similarity_boost: 123,
style: 123,
use_speaker_boost: true,
seed: 123,
previous_text: '<string>',
next_text: '<string>',
apply_text_normalization: '<string>'
})
};
fetch('https://api.snapgen.org/v1/audio/speech', 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.snapgen.org/v1/audio/speech",
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' => '<string>',
'input' => '<string>',
'voice' => '<string>',
'response_format' => '<string>',
'speed' => 123,
'language' => '<string>',
'stability' => 123,
'similarity_boost' => 123,
'style' => 123,
'use_speaker_boost' => true,
'seed' => 123,
'previous_text' => '<string>',
'next_text' => '<string>',
'apply_text_normalization' => '<string>'
]),
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.snapgen.org/v1/audio/speech"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123,\n \"language\": \"<string>\",\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"style\": 123,\n \"use_speaker_boost\": true,\n \"seed\": 123,\n \"previous_text\": \"<string>\",\n \"next_text\": \"<string>\",\n \"apply_text_normalization\": \"<string>\"\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.snapgen.org/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123,\n \"language\": \"<string>\",\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"style\": 123,\n \"use_speaker_boost\": true,\n \"seed\": 123,\n \"previous_text\": \"<string>\",\n \"next_text\": \"<string>\",\n \"apply_text_normalization\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snapgen.org/v1/audio/speech")
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\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123,\n \"language\": \"<string>\",\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"style\": 123,\n \"use_speaker_boost\": true,\n \"seed\": 123,\n \"previous_text\": \"<string>\",\n \"next_text\": \"<string>\",\n \"apply_text_normalization\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyElevenLabs Speech
Eleven v3
Expressive ElevenLabs Eleven v3 text to speech with audio tags through the OpenAI-compatible speech endpoint. $0.12 per 1,000 characters.
POST
/
v1
/
audio
/
speech
Eleven v3
curl --request POST \
--url https://api.snapgen.org/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "<string>",
"speed": 123,
"language": "<string>",
"stability": 123,
"similarity_boost": 123,
"style": 123,
"use_speaker_boost": true,
"seed": 123,
"previous_text": "<string>",
"next_text": "<string>",
"apply_text_normalization": "<string>"
}
'import requests
url = "https://api.snapgen.org/v1/audio/speech"
payload = {
"model": "<string>",
"input": "<string>",
"voice": "<string>",
"response_format": "<string>",
"speed": 123,
"language": "<string>",
"stability": 123,
"similarity_boost": 123,
"style": 123,
"use_speaker_boost": True,
"seed": 123,
"previous_text": "<string>",
"next_text": "<string>",
"apply_text_normalization": "<string>"
}
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: '<string>',
input: '<string>',
voice: '<string>',
response_format: '<string>',
speed: 123,
language: '<string>',
stability: 123,
similarity_boost: 123,
style: 123,
use_speaker_boost: true,
seed: 123,
previous_text: '<string>',
next_text: '<string>',
apply_text_normalization: '<string>'
})
};
fetch('https://api.snapgen.org/v1/audio/speech', 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.snapgen.org/v1/audio/speech",
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' => '<string>',
'input' => '<string>',
'voice' => '<string>',
'response_format' => '<string>',
'speed' => 123,
'language' => '<string>',
'stability' => 123,
'similarity_boost' => 123,
'style' => 123,
'use_speaker_boost' => true,
'seed' => 123,
'previous_text' => '<string>',
'next_text' => '<string>',
'apply_text_normalization' => '<string>'
]),
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.snapgen.org/v1/audio/speech"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123,\n \"language\": \"<string>\",\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"style\": 123,\n \"use_speaker_boost\": true,\n \"seed\": 123,\n \"previous_text\": \"<string>\",\n \"next_text\": \"<string>\",\n \"apply_text_normalization\": \"<string>\"\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.snapgen.org/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123,\n \"language\": \"<string>\",\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"style\": 123,\n \"use_speaker_boost\": true,\n \"seed\": 123,\n \"previous_text\": \"<string>\",\n \"next_text\": \"<string>\",\n \"apply_text_normalization\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snapgen.org/v1/audio/speech")
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\": \"<string>\",\n \"input\": \"<string>\",\n \"voice\": \"<string>\",\n \"response_format\": \"<string>\",\n \"speed\": 123,\n \"language\": \"<string>\",\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"style\": 123,\n \"use_speaker_boost\": true,\n \"seed\": 123,\n \"previous_text\": \"<string>\",\n \"next_text\": \"<string>\",\n \"apply_text_normalization\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyeleven-v3 runs ElevenLabs Eleven v3 text to speech on the OpenAI-compatible speech endpoint. Send up to 5,000 characters with one of 21 premade voices and receive the audio file in the response. Eleven v3 follows audio tags in square brackets, such as [excited], [whispers], or [laughs], so you can direct the delivery line by line.
| Property | Value |
|---|---|
| Model ID | eleven-v3 |
| Endpoint | POST /v1/audio/speech (synchronous) |
| Output | Audio bytes: MP3 (default), Opus, PCM, or WAV |
| Voices | 21 ElevenLabs premade voices, by ID or first name |
| Limits | Up to 5,000 characters per request |
| Billed on | Characters of input, including audio tags |
| Price | $0.12 per 1,000 characters (12 credits) |
eleven-v3-dialogue. For longer text
per request, use eleven-v4 (10,000
characters) or eleven-flash-v2.5
(40,000 characters).
string
required
Set to
eleven-v3.string
required
The text to speak, up to 5,000 characters, including audio tags. Newlines
are allowed; blank text and other control characters are rejected. Each
character is billed.
string
required
A voice ID or first name from the
voice list, for example
JBFqnCBsd6RMkjVDRZzb or George. Names are case-insensitive.string
default:"mp3"
mp3, opus, pcm, or wav. See
Output formats.number
Speaking speed, from
0.7 to 1.2.string
An ISO 639 language code of two or three lowercase letters, such as
en or
de. The provider rejects a code the model doesn’t support.number
From
0 to 1. Lower values give a broader emotional range; higher values
sound more consistent.number
From
0 to 1. How closely the output follows the original voice.number
From
0 to 1. Exaggerates the voice’s speaking style.boolean
Boosts similarity to the original speaker.
integer
From
0 to 4294967295. Makes repeated requests more repeatable, without
guaranteeing identical audio.string
Up to 5,000 characters that come before
input, for continuity across
requests. Not billed.string
Up to 5,000 characters that follow
input, for continuity across requests.
Not billed.string
auto, on, or off: whether numbers, dates, and similar text are spelled
out before speaking.Request
curl https://api.snapgen.org/v1/audio/speech \
-H "Authorization: Bearer $SNAPGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "eleven-v3",
"input": "Welcome back! Today we explore the northern lights.",
"voice": "JBFqnCBsd6RMkjVDRZzb",
"response_format": "mp3"
}' \
--output speech.mp3
Content-Type that matches
response_format (audio/mpeg for MP3).
Direct the delivery with audio tags
Put a tag before the words it should shape. Tags are part ofinput, so they
count toward the 5,000-character limit and are billed like any other text.
curl https://api.snapgen.org/v1/audio/speech \
-H "Authorization: Bearer $SNAPGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "eleven-v3",
"input": "[whispers] The results are in. [excited] We actually did it! [laughs]",
"voice": "Sarah",
"stability": 0.5
}' \
--output speech.mp3
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["SNAPGEN_API_KEY"],
base_url="https://api.snapgen.org/v1",
)
with client.audio.speech.with_streaming_response.create(
model="eleven-v3",
voice="Sarah",
input="[whispers] The results are in. [excited] We actually did it!",
extra_body={"stability": 0.5},
) as response:
response.stream_to_file("speech.mp3")
const fs = require("node:fs");
const OpenAI = require("openai");
async function main() {
const client = new OpenAI({
apiKey: process.env.SNAPGEN_API_KEY,
baseURL: "https://api.snapgen.org/v1",
});
const response = await client.audio.speech.create({
model: "eleven-v3",
voice: "Sarah",
input: "[whispers] The results are in. [excited] We actually did it!",
});
fs.writeFileSync("speech.mp3", Buffer.from(await response.arrayBuffer()));
}
main();
Price examples
| Text | Price |
|---|---|
| 100 characters | $0.012 |
| 1,000 characters | $0.12 |
| 5,000 characters | $0.60 |
Synchronous audio endpoints reject
Idempotency-Key. If a request times
out, check your Console request logs before you retry. See
Text to speech for the response headers and
errors.