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 Name | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Describe the sound you want. Up to 200 characters. Leading and trailing whitespace is trimmed |
| length | integer | Yes | Length in seconds. Allowed values: 1, 2, 3, 30 |
Length options:
| length | Web option | Results | Credit cost |
|---|---|---|---|
1 | 1s | 10 sound effects, 1 second each | 1 |
2 | 2s | 6 sound effects, 2 seconds each | 1 |
3 | 3s | 4 sound effects, 3 seconds each | 1 |
30 | Ambient 30s | 1 looping ambience, 30 seconds | 3 |
Response
Success Response (200 OK):
{
"audio_id": "uuid-string"
}
| Field | Type | Description |
|---|---|---|
| audio_id | string | Unique 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
| Condition | HTTP Status | Error Message |
|---|---|---|
| prompt is empty after trimming | 400 | "prompt must not be empty" |
| prompt is longer than 200 characters | 400 | "prompt must be at most 200 characters" |
| length value is not allowed | 400 | "length should be one of 1, 2, 3, 30" |
| Invalid API key | 401 | "Invalid API key" |
| Not enough credits | 429 | "You do not have enough remaining tokens to use this feature." |
| Missing field or non-integer length | 422 | Validation 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:
- Save the
audio_idreceived in the response - Poll
GET /public/v1/audio/{audio_id}to check status - When status becomes
Succeed, download the files inaudio_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"