Developers · REST API
A sound effects API for game developers
Generate game-ready sound effects from a text prompt in your own tools: build scripts, editor plugins and asset pipelines. Same models, same credits and the same library as the SFX Loom web app.
New here? Create a free account · 5 free credits · no card required
- Bearer key auth
- REST + JSON
- converted on download
- WAV · OGG · MP3
- per sound
- from 1 credit
- per request
- 1–4 takes
What you can build
Sound effects wherever your workflow already is
Fill a whole sound list in one run
Keep your game's sound list in a CSV or JSON file and let a script generate, name and save every effect into your project.
Batch script guide →Generate from inside your editor
Add a menu to the Unity or Godot editor that turns a prompt into an imported WAV, without leaving the engine.
Unity editor tool →Plug it into your asset pipeline
Regenerate placeholder audio in CI, build internal tools for your sound team or add SFX generation to your own app's backend.
API tutorial →Prototype and jam faster
Game jams and greyboxing need dozens of sounds fast. Generate four takes per prompt and keep the best one.
Sound checklist →Reference
API documentation
Quickstart
Generate sound effects from your own tools, build pipelines or game editors. Every request goes through SFX Loom and is billed in the same credits as the web app. Sounds you create with the API also appear in your Library.
- Create an API key in the app under API and export it as
SFXLOOM_API_KEY. POST /api/v1/generationswith a prompt. Credits are reserved and you get a generation id.- Poll
GET /api/v1/generations/{id}every 2–5 seconds untilstatusiscompletedorfailed(usually 5–30 seconds). - Download each finished sound with
GET /api/v1/sounds/{id}/download.
https://sfxloom.com/api/v1# 1. Start a generation and keep its id
GEN_ID=$(curl -s -X POST https://sfxloom.com/api/v1/generations \
-H "Authorization: Bearer $SFXLOOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"elevenlabs/sound-effects-v2","prompt":"Soft UI button click, short and crisp, modern mobile game menu, no reverb, no music","params":{"duration":1,"prompt_influence":0.5},"variations":2}' | jq -r .id)
# 2. Poll every 3 seconds until it's done
while :; do
STATUS=$(curl -s https://sfxloom.com/api/v1/generations/$GEN_ID \
-H "Authorization: Bearer $SFXLOOM_API_KEY" | jq -r .status)
[ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ] && break
sleep 3
done
# 3. Download every finished variation as WAV
curl -s https://sfxloom.com/api/v1/generations/$GEN_ID -H "Authorization: Bearer $SFXLOOM_API_KEY" \
| jq -r '.variations[] | select(.status == "completed") | .sound_id' \
| while read SOUND_ID; do
curl -sL "https://sfxloom.com/api/v1/sounds/$SOUND_ID/download?format=wav" \
-H "Authorization: Bearer $SFXLOOM_API_KEY" -o "$SOUND_ID.wav"
doneAuthentication
Send your key in the Authorization header of every request. Keys start with sfxl_ and act on your account: they can spend your credits and read your sounds.
Authorization: Bearer sfxl_…- Keep keys on your server or in your local tools. Never ship them in a game build, website or mobile app.
- We store only a hash of each key, so a lost key can’t be shown again: revoke it and create a new one.
- A revoked key stops working immediately and gets
401 invalid_api_key.
Create a generation
POST/api/v1/generations
Starts generating one or more variations of a sound. The full cost is reserved from your balance up front; the request fails with 402 insufficient_credits (and nothing is charged) if your balance is too low. Responds with 202 Accepted and the generation, which is still processing.
| Field | Type | Description |
|---|---|---|
| prompt* | string | What the sound should be. Up to 450 characters (ElevenLabs SFX v2), 200 characters (Kling Text-to-Audio). Tip: name the source, action, material, distance and add “no music, no background noise”. |
| model | string | One of elevenlabs/sound-effects-v2, kwaivgi/kling-text-to-audio. Defaults to elevenlabs/sound-effects-v2. |
| params | object | Model settings, see models. Omitted params use their defaults; unknown keys or out-of-range values return 400 invalid_params. |
| variations | integer | How many versions to generate, 1–4. Defaults to 1. Each one costs the same. |
curl -X POST https://sfxloom.com/api/v1/generations \
-H "Authorization: Bearer $SFXLOOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "elevenlabs/sound-effects-v2",
"prompt": "Soft UI button click, short and crisp, modern mobile game menu, no reverb, no music",
"params": {
"duration": 1,
"prompt_influence": 0.5
},
"variations": 2
}'{
"id": "Xq3k9TzP2mLb7RfA1cDe",
"object": "generation",
"model": "elevenlabs/sound-effects-v2",
"prompt": "Soft UI button click, short and crisp, modern mobile game menu, no reverb, no music",
"params": {
"duration": 1,
"prompt_influence": 0.5,
"loop": false
},
"variations_count": 2,
"license": "commercial",
"status": "processing",
"credits": {
"reserved": 2,
"charged": null,
"refunded": null
},
"error": null,
"created_at": "2026-11-04T10:15:00.000Z",
"variations": [
{
"status": "pending",
"error": null
},
{
"status": "pending",
"error": null
}
]
}Get a generation
GET/api/v1/generations/{id}
Returns the generation and advances it: each call checks the provider, saves finished sounds to your library and, once every variation is done, settles credits. Poll every 2–5 seconds.
| Field | Type | Description |
|---|---|---|
| status | string | queued → processing → completed (at least one variation succeeded) or failed (none did). |
| variations[] | array | Each is pending, completed (with sound_id, url, download_url), failed (with error) or deleted. |
| url | string | Signed link to the original file, valid for 60 minutes (see url_expires_at). Poll again for a fresh one. |
| credits | object | reserved at start; charged and refunded are set once the generation is settled (null before). |
| license | string | commercial or personal, fixed when the generation starts — see License. |
curl https://sfxloom.com/api/v1/generations/Xq3k9TzP2mLb7RfA1cDe \
-H "Authorization: Bearer $SFXLOOM_API_KEY"{
"id": "Xq3k9TzP2mLb7RfA1cDe",
"object": "generation",
"model": "elevenlabs/sound-effects-v2",
"prompt": "Soft UI button click, short and crisp, modern mobile game menu, no reverb, no music",
"params": {
"duration": 1,
"prompt_influence": 0.5,
"loop": false
},
"variations_count": 2,
"license": "commercial",
"status": "completed",
"credits": {
"reserved": 2,
"charged": 2,
"refunded": 0
},
"error": null,
"created_at": "2026-11-04T10:15:00.000Z",
"variations": [
{
"status": "completed",
"sound_id": "b7Rf2kLm9QpZx4TnV1sA",
"format": "mp3",
"duration_seconds": 1,
"url": "https://storage.googleapis.com/…/b7Rf2kLm9QpZx4TnV1sA.mp3?X-Goog-Signature=…",
"url_expires_at": "2026-11-04T11:15:30.000Z",
"download_url": "https://sfxloom.com/api/v1/sounds/b7Rf2kLm9QpZx4TnV1sA/download"
},
{
"status": "completed",
"sound_id": "Hc8JwY3dE5uK0oPq6GtM",
"format": "mp3",
"duration_seconds": 1,
"url": "https://storage.googleapis.com/…/Hc8JwY3dE5uK0oPq6GtM.mp3?X-Goog-Signature=…",
"url_expires_at": "2026-11-04T11:15:30.000Z",
"download_url": "https://sfxloom.com/api/v1/sounds/Hc8JwY3dE5uK0oPq6GtM/download"
}
]
}Download a sound
GET/api/v1/sounds/{id}/download?format=wav|mp3|ogg
Without format (or when it matches the stored file) the response is a 302 redirect to a short-lived signed URL of the original — follow redirects (curl -L). With another format the converted file is streamed directly. WAV is 16-bit PCM, ready for game engines.
curl -L "https://sfxloom.com/api/v1/sounds/b7Rf2kLm9QpZx4TnV1sA/download?format=wav" \
-H "Authorization: Bearer $SFXLOOM_API_KEY" \
-o click.wavList models
GET/api/v1/models
Available models with their parameters and credit prices. Slider values must be within range and on the step grid (for example a duration of 2.5 with step 0.5).
ElevenLabs SFX v2
elevenlabs/sound-effects-v2
General-purpose, high-quality sound effects. 0.5–22 s, supports looping. Prompt up to 450 characters.
| Field | Type | Description |
|---|---|---|
| params.duration | number | Duration. 0.5–22 s, step 0.5, default 5. |
| params.prompt_influence | number | Higher values follow your prompt more closely.. 0–1, step 0.05, default 0.3. |
| params.loop | boolean | Generate a sound that loops seamlessly. Default false. |
Kling Text-to-Audio
kwaivgi/kling-text-to-audio
Cinematic ambience and effects. 3–10 s. Prompt up to 200 characters. Sounds from this model are licensed for personal use only for now.
| Field | Type | Description |
|---|---|---|
| params.duration | number | Duration. 3–10 s, step 0.1, default 10. |
curl https://sfxloom.com/api/v1/models \
-H "Authorization: Bearer $SFXLOOM_API_KEY"{
"object": "list",
"data": [
{
"id": "elevenlabs/sound-effects-v2",
"object": "model",
"name": "ElevenLabs SFX v2",
"description": "General-purpose, high-quality sound effects. 0.5–22 s, supports looping.",
"max_prompt_length": 450,
"variations": {
"min": 1,
"max": 4
},
"params": [
{
"key": "duration",
"type": "number",
"description": "Duration",
"min": 0.5,
"max": 22,
"step": 0.5,
"default": 5,
"unit": "s"
},
{
"key": "prompt_influence",
"type": "number",
"description": "Higher values follow your prompt more closely.",
"min": 0,
"max": 1,
"step": 0.05,
"default": 0.3,
"unit": null
},
{
"key": "loop",
"type": "boolean",
"description": "Generate a sound that loops seamlessly.",
"default": false
}
],
"pricing": {
"default_credits_per_variation": 2,
"credits_per_variation_by_duration": [
{
"min_duration": 0.5,
"max_duration": 4.5,
"credits": 1
},
{
"min_duration": 5,
"max_duration": 9,
"credits": 2
},
{
"min_duration": 9.5,
"max_duration": 13.5,
"credits": 3
},
{
"min_duration": 14,
"max_duration": 18,
"credits": 4
},
{
"min_duration": 18.5,
"max_duration": 22,
"credits": 5
}
]
},
"commercial_use_available": true
},
{
"id": "kwaivgi/kling-text-to-audio",
"object": "model",
"name": "Kling Text-to-Audio",
"description": "Cinematic ambience and effects. 3–10 s.",
"max_prompt_length": 200,
"variations": {
"min": 1,
"max": 4
},
"params": [
{
"key": "duration",
"type": "number",
"description": "Duration",
"min": 3,
"max": 10,
"step": 0.1,
"default": 10,
"unit": "s"
}
],
"pricing": {
"default_credits_per_variation": 4,
"credits_per_variation_by_duration": [
{
"min_duration": 3,
"max_duration": 10,
"credits": 4
}
]
},
"commercial_use_available": false
}
]
}Get balance
GET/api/v1/balance
Your spendable credits. Subscription credits are used first, then pack credits. Buy more on Plan & credits.
curl https://sfxloom.com/api/v1/balance \
-H "Authorization: Bearer $SFXLOOM_API_KEY"{
"object": "balance",
"total": 412,
"subscription_credits": 380,
"pack_credits": 32
}Credits & pricing
The API costs exactly the same as the web app. Each variation costs the credits below; a request costs that × variations. Only the model and duration change the price.
| Model | Duration | Credits per variation |
|---|---|---|
| ElevenLabs SFX v2 | 0.5–4.5 s | 1 |
| 5–9 s | 2 | |
| 9.5–13.5 s | 3 | |
| 14–18 s | 4 | |
| 18.5–22 s | 5 | |
| Kling Text-to-Audio | 3–10 s | 4 |
Example: ElevenLabs SFX v2, 1 s, 2 variations = 1 × 2 = 2 credits.
- The whole cost is reserved when the generation starts and shown in
credits.reserved. - Each variation that succeeds is charged; each one that fails or times out is refunded automatically.
- Refunds go to your pack credits, which never expire. Every movement is listed in credit history.
- If you stop polling, the generation still settles: unfinished work is refunded within 15 minutes, the next time you call the API or open the app.
Rate limits
- 120 requests per minute per key, across all endpoints. Every response carries
X-RateLimit-LimitandX-RateLimit-Remaining. - Starting generations is also limited per account, shared with the web app. Over the limit you get
429with aRetry-Afterheader (seconds). - Prompts go through the same content filter as the web app before any credits are reserved.
Errors
Errors use standard HTTP status codes and a JSON body with a stable code and a readable message.
{
"error": {
"code": "insufficient_credits",
"message": "You don't have enough credits."
}
}| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_body | The body isn't a JSON object or a field has the wrong type. |
| 400 | invalid_model | Unknown model id. See GET /api/v1/models. |
| 400 | invalid_params | A parameter is unknown for this model, has the wrong type or is out of range. |
| 400 | empty_prompt | The prompt is missing or empty. |
| 400 | prompt_too_long | The prompt is longer than the model allows. |
| 400 | prompt_blocked | The prompt isn't allowed (sexual content, imitating or cloning a real person's voice). |
| 400 | invalid_variations | variations must be an integer between 1 and 4. |
| 400 | invalid_format | format must be wav, mp3 or ogg. |
| 401 | missing_api_key | No `Authorization: Bearer <key>` header. |
| 401 | invalid_api_key | The key is wrong or has been revoked. |
| 402 | insufficient_credits | Not enough credits for this generation. Nothing was charged. |
| 404 | not_found | The generation or sound doesn't exist or belongs to another account. |
| 429 | rate_limited | Too many generations started in the last minute (per account, shared with the web app). |
| 429 | key_rate_limited | Too many requests with this key in the current minute. |
| 500 | internal | Something went wrong on our side. Safe to retry GET requests. |
Questions
Is there a free tier for the API?+
Yes. Every new account gets 5 free credits after verifying its email, and the API spends the same credits as the web app. When you need more, pick a monthly plan or a one-time credit pack.
How much does one sound cost?+
It depends on the model and duration and starts at 1 credit per sound. The full price table is in the Credits & pricing section below. Credits are reserved when a generation starts and refunded automatically for every variation that fails.
Can I use the generated sounds in a commercial game?+
Sounds generated while you have an active paid plan, or after buying a credit pack, come with a commercial license. Sounds from free credits are for personal use. The API returns the license of each generation in the license field.
Can I call the API from my game at runtime?+
No. An API key can spend your credits, so it must stay on your machine or your own server. Generate sounds during development, then ship the audio files with your game. If your own app needs runtime generation, call the API from your backend.
Which models can I use?+
ElevenLabs SFX v2 and Kling Text-to-Audio. GET /api/v1/models lists every model with its parameters, ranges and prices, so new models show up without code changes.
Are there rate limits?+
120 requests per minute per key, plus a per-account limit on how many generations you can start per minute. Responses carry X-RateLimit headers, and 429 responses include Retry-After.
Start generating sound effects from code
5 free credits · no card required · same credits as the web app