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.

  1. Create an API key in the app under API and export it as SFXLOOM_API_KEY.
  2. POST /api/v1/generations with a prompt. Credits are reserved and you get a generation id.
  3. Poll GET /api/v1/generations/{id} every 2–5 seconds until status is completed or failed (usually 5–30 seconds).
  4. Download each finished sound with GET /api/v1/sounds/{id}/download.
Base URLhttps://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"
    done

Authentication

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.

Header
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.

FieldTypeDescription
prompt*stringWhat 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”.
modelstringOne of elevenlabs/sound-effects-v2, kwaivgi/kling-text-to-audio. Defaults to elevenlabs/sound-effects-v2.
paramsobjectModel settings, see models. Omitted params use their defaults; unknown keys or out-of-range values return 400 invalid_params.
variationsintegerHow 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
  }'
Response · 202
{
  "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.

FieldTypeDescription
statusstringqueued → processing → completed (at least one variation succeeded) or failed (none did).
variations[]arrayEach is pending, completed (with sound_id, url, download_url), failed (with error) or deleted.
urlstringSigned link to the original file, valid for 60 minutes (see url_expires_at). Poll again for a fresh one.
creditsobjectreserved at start; charged and refunded are set once the generation is settled (null before).
licensestringcommercial or personal, fixed when the generation starts — see License.
curl https://sfxloom.com/api/v1/generations/Xq3k9TzP2mLb7RfA1cDe \
  -H "Authorization: Bearer $SFXLOOM_API_KEY"
Response · 200
{
  "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.wav

List 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.

FieldTypeDescription
params.durationnumberDuration. 0.5–22 s, step 0.5, default 5.
params.prompt_influencenumberHigher values follow your prompt more closely.. 0–1, step 0.05, default 0.3.
params.loopbooleanGenerate 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.

FieldTypeDescription
params.durationnumberDuration. 3–10 s, step 0.1, default 10.
curl https://sfxloom.com/api/v1/models \
  -H "Authorization: Bearer $SFXLOOM_API_KEY"
Response · 200
{
  "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"
Response · 200
{
  "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.

ModelDurationCredits per variation
ElevenLabs SFX v20.5–4.5 s1
5–9 s2
9.5–13.5 s3
14–18 s4
18.5–22 s5
Kling Text-to-Audio3–10 s4

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-Limit and X-RateLimit-Remaining.
  • Starting generations is also limited per account, shared with the web app. Over the limit you get 429 with a Retry-After header (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.

Response · 402
{
  "error": {
    "code": "insufficient_credits",
    "message": "You don't have enough credits."
  }
}
StatusCodeMeaning
400invalid_bodyThe body isn't a JSON object or a field has the wrong type.
400invalid_modelUnknown model id. See GET /api/v1/models.
400invalid_paramsA parameter is unknown for this model, has the wrong type or is out of range.
400empty_promptThe prompt is missing or empty.
400prompt_too_longThe prompt is longer than the model allows.
400prompt_blockedThe prompt isn't allowed (sexual content, imitating or cloning a real person's voice).
400invalid_variationsvariations must be an integer between 1 and 4.
400invalid_formatformat must be wav, mp3 or ogg.
401missing_api_keyNo `Authorization: Bearer <key>` header.
401invalid_api_keyThe key is wrong or has been revoked.
402insufficient_creditsNot enough credits for this generation. Nothing was charged.
404not_foundThe generation or sound doesn't exist or belongs to another account.
429rate_limitedToo many generations started in the last minute (per account, shared with the web app).
429key_rate_limitedToo many requests with this key in the current minute.
500internalSomething 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

Get an API key