Generate Sounds
curl --request POST \
--url https://apibox.erweima.ai/api/v1/generate/sounds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A soft rain ambience with distant thunder and gentle wind",
"model": "V6",
"soundLoop": false,
"soundTempo": 120,
"soundKey": "Any",
"grabLyrics": false,
"callBackUrl": "https://api.example.com/callback"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/generate/sounds"
payload = {
"prompt": "A soft rain ambience with distant thunder and gentle wind",
"model": "V6",
"soundLoop": False,
"soundTempo": 120,
"soundKey": "Any",
"grabLyrics": False,
"callBackUrl": "https://api.example.com/callback"
}
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({
prompt: 'A soft rain ambience with distant thunder and gentle wind',
model: 'V6',
soundLoop: false,
soundTempo: 120,
soundKey: 'Any',
grabLyrics: false,
callBackUrl: 'https://api.example.com/callback'
})
};
fetch('https://apibox.erweima.ai/api/v1/generate/sounds', 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://apibox.erweima.ai/api/v1/generate/sounds",
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([
'prompt' => 'A soft rain ambience with distant thunder and gentle wind',
'model' => 'V6',
'soundLoop' => false,
'soundTempo' => 120,
'soundKey' => 'Any',
'grabLyrics' => false,
'callBackUrl' => 'https://api.example.com/callback'
]),
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://apibox.erweima.ai/api/v1/generate/sounds"
payload := strings.NewReader("{\n \"prompt\": \"A soft rain ambience with distant thunder and gentle wind\",\n \"model\": \"V6\",\n \"soundLoop\": false,\n \"soundTempo\": 120,\n \"soundKey\": \"Any\",\n \"grabLyrics\": false,\n \"callBackUrl\": \"https://api.example.com/callback\"\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://apibox.erweima.ai/api/v1/generate/sounds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A soft rain ambience with distant thunder and gentle wind\",\n \"model\": \"V6\",\n \"soundLoop\": false,\n \"soundTempo\": 120,\n \"soundKey\": \"Any\",\n \"grabLyrics\": false,\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/generate/sounds")
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 \"prompt\": \"A soft rain ambience with distant thunder and gentle wind\",\n \"model\": \"V6\",\n \"soundLoop\": false,\n \"soundTempo\": 120,\n \"soundKey\": \"Any\",\n \"grabLyrics\": false,\n \"callBackUrl\": \"https://api.example.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "a1b2****c3d4"
}
}Generate Sounds
Generate Sounds
Create a sound generation task with loop, tempo, key, and optional lyrics subtitle capture settings.
POST
/
api
/
v1
/
generate
/
sounds
Generate Sounds
curl --request POST \
--url https://apibox.erweima.ai/api/v1/generate/sounds \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A soft rain ambience with distant thunder and gentle wind",
"model": "V6",
"soundLoop": false,
"soundTempo": 120,
"soundKey": "Any",
"grabLyrics": false,
"callBackUrl": "https://api.example.com/callback"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/generate/sounds"
payload = {
"prompt": "A soft rain ambience with distant thunder and gentle wind",
"model": "V6",
"soundLoop": False,
"soundTempo": 120,
"soundKey": "Any",
"grabLyrics": False,
"callBackUrl": "https://api.example.com/callback"
}
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({
prompt: 'A soft rain ambience with distant thunder and gentle wind',
model: 'V6',
soundLoop: false,
soundTempo: 120,
soundKey: 'Any',
grabLyrics: false,
callBackUrl: 'https://api.example.com/callback'
})
};
fetch('https://apibox.erweima.ai/api/v1/generate/sounds', 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://apibox.erweima.ai/api/v1/generate/sounds",
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([
'prompt' => 'A soft rain ambience with distant thunder and gentle wind',
'model' => 'V6',
'soundLoop' => false,
'soundTempo' => 120,
'soundKey' => 'Any',
'grabLyrics' => false,
'callBackUrl' => 'https://api.example.com/callback'
]),
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://apibox.erweima.ai/api/v1/generate/sounds"
payload := strings.NewReader("{\n \"prompt\": \"A soft rain ambience with distant thunder and gentle wind\",\n \"model\": \"V6\",\n \"soundLoop\": false,\n \"soundTempo\": 120,\n \"soundKey\": \"Any\",\n \"grabLyrics\": false,\n \"callBackUrl\": \"https://api.example.com/callback\"\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://apibox.erweima.ai/api/v1/generate/sounds")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A soft rain ambience with distant thunder and gentle wind\",\n \"model\": \"V6\",\n \"soundLoop\": false,\n \"soundTempo\": 120,\n \"soundKey\": \"Any\",\n \"grabLyrics\": false,\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/generate/sounds")
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 \"prompt\": \"A soft rain ambience with distant thunder and gentle wind\",\n \"model\": \"V6\",\n \"soundLoop\": false,\n \"soundTempo\": 120,\n \"soundKey\": \"Any\",\n \"grabLyrics\": false,\n \"callBackUrl\": \"https://api.example.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "a1b2****c3d4"
}
}Model Versions
- Current models:
V6(default),V6_WILD,V6_MINI - Deprecated models:
V5_5,V5,V4_5PLUS,V4_5ALL,V4_5,V4 - Deprecated values remain available only for backward compatibility. New integrations should use a V6-series model.
🚀 User Guide
- By using this interface, you can generate corresponding audio content based on the input
prompt. - It supports setting up loop playback effect, which is suitable for background music, ambient sounds, and other scenarios.
- It allows specifying BPM (beats per minute) and pitch (Key) to facilitate control over the style of the generated result.
- Optional feature to enable lyric subtitle capture for easier display or processing of lyric content later.
- Supports asynchronous reception of task completion notifications through callback address.
model parameter
- Allowed values:
V6,V6_WILD,V6_MINI. Deprecated:V5,V5_5,V4_5PLUS,V4_5ALL,V4_5,V4.
📌 Usage Scenarios
- 🎧 Background music creation
- 🎮 Game sound effects or looped ambient sounds generation
- 🌐 Integration of audio content platforms and creative tools
Authorizations
🔑 API Authentication
All endpoints require authentication using Bearer Token.
Get API Key
- Visit the API Key Management Page to obtain your API Key
Usage
Add to request headers:
Authorization: Bearer YOUR_API_KEY
⚠️ Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately from the management page
Body
application/json
Prompt text for sound generation. Maximum 500 characters.
Maximum string length:
500Example:
"A soft rain ambience with distant thunder and gentle wind"
AI model version. Default: V6.
V6: Current standard model and recommended default.V6_WILD: Current model for more experimental and creative results.V6_MINI: Current lightweight model.- Deprecated:
V5_5,V5,V4_5PLUS,V4_5ALL,V4_5, andV4. These values remain listed only for backward compatibility; use a V6-series model for new integrations.
Available options:
V6, V6_WILD, V6_MINI, V5_5, V5, V4_5PLUS, V4_5ALL, V4_5, V4 Example:
"V6"
Whether to enable loop playback for the generated sound.
Example:
false
BPM (beats per minute). If omitted, Auto is used.
Required range:
1 <= x <= 300Example:
120
Pitch key of generated sound. Default is Any.
Available options:
Any, Cm, C#m, Dm, D#m, Em, Fm, F#m, Gm, G#m, Am, A#m, Bm, C, C#, D, D#, E, F, F#, G, G#, A, A#, B Example:
"Any"
Whether to fetch lyric subtitle data after task completion.
Example:
false
Callback URL for asynchronous task completion notifications.
Example:
"https://api.example.com/callback"
Response
Request successful
Status Codes
- ✅ 200 - Request successful
- ⚠️ 400 - Invalid parameters
- ⚠️ 401 - Unauthorized access
- ⚠️ 404 - Invalid request method or path
- ⚠️ 405 - Rate limit exceeded
- ⚠️ 413 - Theme or prompt too long
- ⚠️ 429 - Insufficient credits
- ⚠️ 430 - Your call frequency is too high. Please try again later.
- ⚠️ 455 - System maintenance
- ❌ 500 - Server error
Available options:
200, 400, 401, 404, 405, 413, 429, 430, 455, 500 Example:
200
Error message when code != 200
Example:
"success"
Show child attributes
Show child attributes
