Skip to main content

Generate Sound Effects

Purpose​

Generates sound effects asynchronously from a text prompt. Choose a length of 1, 2 or 3 seconds to get several short sound effects at once, or 30 seconds to get one looping ambience of environmental sounds like rain and wind. This is the same feature as the SFX (Sound effects) tab of the web app's "Generate Sounds" page.

Credit cost: 1 (1s, 2s, 3s), 3 (Ambient 30s)

Method and Path​

POST /public/v1/generate/sound/sfx

Authentication​

See the Authentication page. Bearer token is required.

Required Headers:

Authorization: Bearer {your_api_key}

Request Fields​

Send the request as multipart/form-data.

Field NameTypeRequiredDescription
promptstringYesDescribe the sound you want. Up to 200 characters. Leading and trailing whitespace is trimmed
lengthintegerYesLength in seconds. Allowed values: 1, 2, 3, 30

Length options:

lengthWeb optionResultsCredit cost
11s10 sound effects, 1 second each1
22s6 sound effects, 2 seconds each1
33s4 sound effects, 3 seconds each1
30Ambient 30s1 looping ambience, 30 seconds3

Response​

Success Response (200 OK):

{
"audio_id": "uuid-string"
}
FieldTypeDescription
audio_idstringUnique identifier for the created sound. Use Get Audio Status to retrieve results

The audio_id is not a job_id. Get Job Status does not return sound results.

Error / Validation Rules​

ConditionHTTP StatusError Message
prompt is empty after trimming400"prompt must not be empty"
prompt is longer than 200 characters400"prompt must be at most 200 characters"
length value is not allowed400"length should be one of 1, 2, 3, 30"
Invalid API key401"Invalid API key"
Not enough credits429"You do not have enough remaining tokens to use this feature."
Missing field or non-integer length422Validation error

Async Job Behavior​

This endpoint starts generation in the background. It immediately returns an audio_id, and the sound effects are generated in the background.

Polling Method:

  1. Save the audio_id received in the response
  2. Poll GET /public/v1/audio/{audio_id} to check status
  3. When status becomes Succeed, download the files in audio_urls (one URL per sound effect)

Status Flow: Pending → Succeed or Failed

If generation fails, the credits are refunded.

Example Request​

cURL (short sound effects):

curl -X POST "https://api.aetherforgeai.com/public/v1/generate/sound/sfx" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "prompt=a sword slashing through the air" \
-F "length=1"

cURL (Ambient 30s):

curl -X POST "https://api.aetherforgeai.com/public/v1/generate/sound/sfx" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "prompt=rain hitting the windows of an abandoned school with distant thunder" \
-F "length=30"