Eleven Sound Effects v2
curl --request POST \
--url https://api.snapgen.org/v1/audio/sound-effects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration_seconds": 123,
"prompt_influence": 123,
"loop": true,
"response_format": "<string>"
}
'import requests
url = "https://api.snapgen.org/v1/audio/sound-effects"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration_seconds": 123,
"prompt_influence": 123,
"loop": True,
"response_format": "<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>',
prompt: '<string>',
duration_seconds: 123,
prompt_influence: 123,
loop: true,
response_format: '<string>'
})
};
fetch('https://api.snapgen.org/v1/audio/sound-effects', 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/sound-effects",
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>',
'prompt' => '<string>',
'duration_seconds' => 123,
'prompt_influence' => 123,
'loop' => true,
'response_format' => '<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/sound-effects"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration_seconds\": 123,\n \"prompt_influence\": 123,\n \"loop\": true,\n \"response_format\": \"<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/sound-effects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration_seconds\": 123,\n \"prompt_influence\": 123,\n \"loop\": true,\n \"response_format\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snapgen.org/v1/audio/sound-effects")
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 \"prompt\": \"<string>\",\n \"duration_seconds\": 123,\n \"prompt_influence\": 123,\n \"loop\": true,\n \"response_format\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyElevenLabs Music & Sound
Eleven Sound Effects v2
Generate sound effects of 0.5 to 30 seconds from a text prompt with ElevenLabs. $0.18 per minute.
POST
/
v1
/
audio
/
sound-effects
Eleven Sound Effects v2
curl --request POST \
--url https://api.snapgen.org/v1/audio/sound-effects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration_seconds": 123,
"prompt_influence": 123,
"loop": true,
"response_format": "<string>"
}
'import requests
url = "https://api.snapgen.org/v1/audio/sound-effects"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration_seconds": 123,
"prompt_influence": 123,
"loop": True,
"response_format": "<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>',
prompt: '<string>',
duration_seconds: 123,
prompt_influence: 123,
loop: true,
response_format: '<string>'
})
};
fetch('https://api.snapgen.org/v1/audio/sound-effects', 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/sound-effects",
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>',
'prompt' => '<string>',
'duration_seconds' => 123,
'prompt_influence' => 123,
'loop' => true,
'response_format' => '<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/sound-effects"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration_seconds\": 123,\n \"prompt_influence\": 123,\n \"loop\": true,\n \"response_format\": \"<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/sound-effects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration_seconds\": 123,\n \"prompt_influence\": 123,\n \"loop\": true,\n \"response_format\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snapgen.org/v1/audio/sound-effects")
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 \"prompt\": \"<string>\",\n \"duration_seconds\": 123,\n \"prompt_influence\": 123,\n \"loop\": true,\n \"response_format\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyeleven-sound-effects-v2 generates a sound effect of 0.5 to 30 seconds from a text prompt, optionally as a seamless loop, and returns the audio file in the response.
| Property | Value |
|---|---|
| Model ID | eleven-sound-effects-v2 |
| Endpoint | POST /v1/audio/sound-effects |
| Output | Audio bytes: MP3 (default), Opus, or PCM |
| Limits | 0.5 to 30 seconds (default 5) |
| Billed on | Requested duration_seconds, rounded up to whole seconds (default 5) |
| Price | $0.003 per second ($0.18 per minute, 0.3 credits per second) |
string
required
Set to
eleven-sound-effects-v2.string
required
What the sound should be, up to 1,000 characters.
number
default:"5"
Length in seconds, from
0.5 to 30. Billed rounded up to whole seconds.number
From
0 to 1. Higher values follow the prompt more closely.boolean
true makes a sound that loops seamlessly.string
default:"mp3"
mp3, opus, or pcm. See Output formats.Request
curl https://api.snapgen.org/v1/audio/sound-effects \
-H "Authorization: Bearer $SNAPGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "eleven-sound-effects-v2",
"prompt": "Heavy wooden door creaking open in an empty hall",
"duration_seconds": 4
}' \
--output effect.mp3
Content-Type that matches response_format.
Price examples
| Length | Price |
|---|---|
| 1 second | $0.003 |
| 5 seconds | $0.015 |
| 30 seconds | $0.09 |
Synchronous audio endpoints reject
Idempotency-Key. If a request times out, check your Console request logs before you retry.
See Sound effects for every field, the response, and errors.