Skip to main content
POST
/
v1
/
audio
/
sfx
Audio Sound Effects
curl --request POST \
  --url https://kymaapi.com/v1/audio/sfx \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "duration_seconds": 123,
  "prompt_influence": 123,
  "response_format": "<string>"
}
'
Synchronous endpoint. Describe a sound — door slam, rain, sword unsheathing, ambient room — get back a clip. Pairs naturally with /v1/audio/music for video and game soundtracking.
curl -X POST https://kymaapi.com/v1/audio/sfx \
  -H "Authorization: Bearer $KYMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "heavy wooden door slamming shut in stone hallway, with reverb",
    "duration_seconds": 3
  }' \
  --output door.mp3

Request

application/json body.
model
string
default:"elevenlabs-sfx"
SFX model. Currently only elevenlabs-sfx is shipped.
prompt
string
required
Description of the sound. Max 500 characters. Also accepts text as an alias.
duration_seconds
number
Optional duration 0.5 to 22 seconds. Omit to let the model auto-pick a sensible length.
prompt_influence
number
default:"0.3"
How literal the prompt should be (0 = creative, 1 = strict). Range 01.
response_format
string
default:"mp3_44100_128"
Audio format. Same options as audio/speech.
save_to_blob
string
Optional query param. Set to 1 to have Kyma upload the resulting MP3 to Vercel Blob, write a multimodal_jobs row, and return JSON { job_id, kind: "audio", url, duration_sec, cost_usd, balance_usd } instead of streaming bytes. Used by Canvas and Muse audio kinds — most direct API callers don’t need this.

Response

Default (streaming)

200 OK with audio bytes. Flat pricing — duration doesn’t change the cost.
HeaderWhat
X-Kyma-Modelelevenlabs-sfx
X-Kyma-Cost-USDflat $0.027 per generation
X-Kyma-Balance-USDremaining balance

With ?save_to_blob=1

200 OK with JSON:
{
  "object": "audio.generation",
  "job_id": "mmj_...",
  "kind": "audio",
  "model": "elevenlabs-sfx",
  "url": "https://blob.vercel-storage.com/mmj/.../mmj_....mp3",
  "duration_sec": 3,
  "cost_usd": 0.027,
  "balance_usd": 47.97
}

Errors

Statuserror.codeWhen
400not_an_sfx_modelmodel is not an SFX SKU
400prompt_too_longprompt > 500 chars
400invalid_durationduration_seconds outside [0.5, 22]
401auth_errormissing or invalid API key
402billing_errorbalance too low
502provider_errorupstream provider failure

See also