Generate Sound Based on Given Prompt
curl --request POST \
--url https://api.wav.com/api/public/v1/sound_generator \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'prompt=Generate a soothing ambient soundscape.' \
--data generate_album_cover=false \
--data webhook_url=http://your-webhook-url.com/callback \
--data audio_length=30import requests
url = "https://api.wav.com/api/public/v1/sound_generator"
payload = {
"prompt": "Generate a soothing ambient soundscape.",
"generate_album_cover": "false",
"webhook_url": "http://your-webhook-url.com/callback",
"audio_length": "30"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
prompt: 'Generate a soothing ambient soundscape.',
generate_album_cover: 'false',
webhook_url: 'http://your-webhook-url.com/callback',
audio_length: '30'
})
};
fetch('https://api.wav.com/api/public/v1/sound_generator', 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.wav.com/api/public/v1/sound_generator",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "prompt=Generate%20a%20soothing%20ambient%20soundscape.&generate_album_cover=false&webhook_url=http%3A%2F%2Fyour-webhook-url.com%2Fcallback&audio_length=30",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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.wav.com/api/public/v1/sound_generator"
payload := strings.NewReader("prompt=Generate%20a%20soothing%20ambient%20soundscape.&generate_album_cover=false&webhook_url=http%3A%2F%2Fyour-webhook-url.com%2Fcallback&audio_length=30")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
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.wav.com/api/public/v1/sound_generator")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("prompt=Generate%20a%20soothing%20ambient%20soundscape.&generate_album_cover=false&webhook_url=http%3A%2F%2Fyour-webhook-url.com%2Fcallback&audio_length=30")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wav.com/api/public/v1/sound_generator")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "prompt=Generate%20a%20soothing%20ambient%20soundscape.&generate_album_cover=false&webhook_url=http%3A%2F%2Fyour-webhook-url.com%2Fcallback&audio_length=30"
response = http.request(request)
puts response.read_body{
"success": true,
"task_id": "26c9aaf8-f292-4c66-992b-7f3c7dfe85fe",
"conversion_id": "31b6c4a2-e5e2-44ab-baf1-93ffa4c8a7b7",
"eta": 84,
"credit_estimate": 0.011,
"message": "",
"status": "IN_QUEUE"
}{
"success": false,
"error_code": "INSUFFICIENT_CREDITS",
"message": ""
}{
"success": false,
"error_code": "UNPROCESSABLE_CONTENT",
"message": ""
}{
"success": false,
"error_code": "INTERNAL_SERVER_ERROR",
"message": ""
}Features
Sound Generator
Creates an audio file based on a textual prompt. The generation process is asynchronous and returns a task ID for tracking.
POST
/
v1
/
sound_generator
Generate Sound Based on Given Prompt
curl --request POST \
--url https://api.wav.com/api/public/v1/sound_generator \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'prompt=Generate a soothing ambient soundscape.' \
--data generate_album_cover=false \
--data webhook_url=http://your-webhook-url.com/callback \
--data audio_length=30import requests
url = "https://api.wav.com/api/public/v1/sound_generator"
payload = {
"prompt": "Generate a soothing ambient soundscape.",
"generate_album_cover": "false",
"webhook_url": "http://your-webhook-url.com/callback",
"audio_length": "30"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
prompt: 'Generate a soothing ambient soundscape.',
generate_album_cover: 'false',
webhook_url: 'http://your-webhook-url.com/callback',
audio_length: '30'
})
};
fetch('https://api.wav.com/api/public/v1/sound_generator', 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.wav.com/api/public/v1/sound_generator",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "prompt=Generate%20a%20soothing%20ambient%20soundscape.&generate_album_cover=false&webhook_url=http%3A%2F%2Fyour-webhook-url.com%2Fcallback&audio_length=30",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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.wav.com/api/public/v1/sound_generator"
payload := strings.NewReader("prompt=Generate%20a%20soothing%20ambient%20soundscape.&generate_album_cover=false&webhook_url=http%3A%2F%2Fyour-webhook-url.com%2Fcallback&audio_length=30")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
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.wav.com/api/public/v1/sound_generator")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("prompt=Generate%20a%20soothing%20ambient%20soundscape.&generate_album_cover=false&webhook_url=http%3A%2F%2Fyour-webhook-url.com%2Fcallback&audio_length=30")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wav.com/api/public/v1/sound_generator")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "prompt=Generate%20a%20soothing%20ambient%20soundscape.&generate_album_cover=false&webhook_url=http%3A%2F%2Fyour-webhook-url.com%2Fcallback&audio_length=30"
response = http.request(request)
puts response.read_body{
"success": true,
"task_id": "26c9aaf8-f292-4c66-992b-7f3c7dfe85fe",
"conversion_id": "31b6c4a2-e5e2-44ab-baf1-93ffa4c8a7b7",
"eta": 84,
"credit_estimate": 0.011,
"message": "",
"status": "IN_QUEUE"
}{
"success": false,
"error_code": "INSUFFICIENT_CREDITS",
"message": ""
}{
"success": false,
"error_code": "UNPROCESSABLE_CONTENT",
"message": ""
}{
"success": false,
"error_code": "INTERNAL_SERVER_ERROR",
"message": ""
}Pro model Free all October
Sound Generator Pro
Our fastest, highest-quality sound model yet, now powering every request to /v1/sound_generator. Free throughout October for up to 500 generations/day and 21/hour; after October, pricing is more than 3x lower than before.
$0all of October
500generations / day
21generations / hour
3xcheaper after October
- Generate realistic or abstract sounds
- Fine-tuned AI audio creation
- Instant feedback or asynchronous delivery via webhook
What it supports
| Feature | What it creates | Example prompt |
|---|---|---|
| Sound FX | A one-shot sound, action, ambience, or short audio scene. | Generate sound FX of a realistic car crash with tire skid, metal impact, and brief glass shatter; no music; 6 seconds. |
| Loops | Repeatable audio designed to cycle seamlessly at a stated tempo. | Generate loop of tight kick and snare at 80 BPM in 4/4, four bars, with a clean loop point and no vocals. |
| Samples | A single musical note, chord, hit, texture, or short isolated phrase. | Generate sample of a clean E major chord on acoustic guitar, one sustained hit with natural decay and no other instruments. |
Special features
BPM control
Specify an exact tempo in your prompt (e.g. “at 90 BPM”) and the output locks to it, so loops sync cleanly with an existing track.
Foley support
Everyday, real-world sounds like footsteps, cloth rustle, or object handling, ready to layer into film, video, and game audio.
Audio length control
Set the exact duration, from 5 seconds to 2 minutes, with the
audio_length parameter.Endpoint
POST /v1/sound_generator
Sample Output
Listen to an actual sample: Prompt: sound of bird chirping in a forest. Download AudioTry it Yourself
Visit the Sound Generator Endpoint Explorer to try live prompt-based sound creation.🚀 Experiment with different descriptions — from realistic sounds (like “city street at night”) to fantastical ones (“alien spacecraft landing”)!
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | String | Yes | A natural language description of the sound you want. Maximum 300 characters. |
webhook_url | String | Optional | Webhook URL to receive a callback with the audio result |
audio_length | Integer | Optional | Duration of the generated audio in seconds, from 5 to 120 |
generate_album_cover | Boolean | Optional | If true, generate an album cover for the generated audio |
content-type: application/x-www-form-urlencoded
Sample Request
Python
import requests
url = "https://api.wav.com/api/public/v1/sound_generator"
payload = {
"prompt": "Generate a soothing ambient soundscape.",
"generate_album_cover": "false",
"webhook_url": "http://your-webhook-url.com/callback",
"audio_length": "30"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)
Sample Response
Success (200 OK)
{
"success":true,
"task_id":"26c9aaf8-f292-4c66-992b-7f3c7dfe85fe",
"conversion_id":"31b6c4a2-e5e2-44ab-baf1-93ffa4c8a7b7",
"eta":84,
"credit_estimate":0.011,
"message":"",
"status":"IN_QUEUE"
}
Webhook Response
Once the sound is ready, your webhook will receive:- 1 Sound Generator webhook
- 1 Album Cover webhook — sent only when
generate_album_coveristrue
{
"success": true,
"conversion_type": "Sound Creator",
"task_id": "26c9aaf8-f292-4c66-992b-7f3c7dfe85fe",
"conversion_id": "31b6c4a2-e5e2-44ab-baf1-93ffa4c8a7b7",
"conversion_path": "https://cdn1.musicgpt.com/conversions/api/standard/26c9aaf8-f292-4c66-992b-7f3c7dfe85fe.mp3",
"conversion_path_wav": null,
"conversion_duration": 30.0,
"message": "Audio Generation Completed Successfully",
"title": "Sound Creator",
"conversion_paths": {"31b6c4a2-e5e2-44ab-baf1-93ffa4c8a7b7": "https://cdn1.musicgpt.com/conversions/api/standard/26c9aaf8-f292-4c66-992b-7f3c7dfe85fe.mp3"},
"conversion_paths_wav": {"31b6c4a2-e5e2-44ab-baf1-93ffa4c8a7b7": null},
"conversion_durations": { "31b6c4a2-e5e2-44ab-baf1-93ffa4c8a7b7": 30.0}
}
{
"success": true,
"conversion_type": "Sound Creator",
"task_id": "26c9aaf8-f292-4c66-992b-7f3c7dfe85fe",
"image_paths": [
"https://cdn1.musicgpt.com/img-gen-pipeline/api/26c9aaf8-f292-4c66-992b-7f3c7dfe85fe.jpg"
],
"thumbnail_paths": [
"https://cdn1.musicgpt.com/img-gen-pipeline/api/26c9aaf8-f292-4c66-992b-7f3c7dfe85fe_thumb.jpg"
],
"image_path": "https://cdn1.musicgpt.com/img-gen-pipeline/api/26c9aaf8-f292-4c66-992b-7f3c7dfe85fe.jpg",
"thumbnail_path": "https://cdn1.musicgpt.com/img-gen-pipeline/api/26c9aaf8-f292-4c66-992b-7f3c7dfe85fe_thumb.jpg",
"conversion_id_1": "31b6c4a2-e5e2-44ab-baf1-93ffa4c8a7b7",
"album_cover_generator_output": true,
"subtype": "album_cover_generation"
}
Note: If your webhook is set, you’ll get the sound automatically once ready. Otherwise, you can fetch it manually using the conversion_id.
Payload and Request Formation
Authorizations
Body
application/x-www-form-urlencoded
Text prompt guiding the sound generation. Maximum 300 characters.
Maximum string length:
300Example:
"Generate a soothing ambient soundscape."
Whether to generate an album cover for the generated audio
Callback URL for async processing results.
Example:
"http://your-webhook-url.com/callback"
Desired duration of generated audio in seconds, from 5 to 120.
Required range:
5 <= x <= 120Example:
30

