API Reference / Endpoints / Sound Effects
Generate sound effects
/v1/sound-effects/generateGenerate a sound effect from text and receive a completed artifact on success.
POST
/v1/sound-effects/generateAuth: API keyBilling: Consumes 1 API callBehavior: SyncScopes: audio:generate
POSTSyncjsonaudio:generate
When to use it
Use this when you need a direct text-to-SFX generation flow with optional duration and loop controls.
Behavior on success
Returns a completed payload on the normal success path.
Integration shape
Authorization model
audio:generate
Request format
json
Polling pattern
No polling required on the normal success path.
Request
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Sound effect description. |
duration_seconds | number | Optional | Optional duration from 0.5 to 30 seconds. |
prompt_influence | number | Optional | Optional prompt influence from 0 to 1. |
loop | boolean | Optional | Loop-ready generation hint. |
output_format | string | Optional | Optional encoder hint. |
Example request
POST /v1/sound-effects/generate
const response = await fetch('https://prod-backup-backend.wubble.ai/v1/sound-effects/generate', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WUBBLE_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"text": "Heavy rain on a tin roof with distant thunder",
"duration_seconds": 5,
"prompt_influence": 0.7,
"loop": false
}),
});
const payload = await response.json();
console.log(payload);Example response
Response shapejson
{
"success": true,
"data": {
"request_id": "<uuid>",
"status": "completed",
"result_url": "https://cdn.wubble.ai/audio/sfx.mp3",
"credits_used": 1
}
}Implementation notes
This usually completes synchronously with HTTP 200 and a completed status.
On generation failure, the backend runs the refund path before returning an error.
Production guidance
Pair this route with idempotency on POST requests and either request polling or webhooks whenever the response is asynchronous.
Was this page helpful?