Generate a sound effect

by ElevenLabs

elevenlabs/sound_generation

Generate a sound effect from a written description.

Billed per
call
Price
Price: $0.0192
Provider
ElevenLabs
Timeout
5 min

Overview

Turns a written description of a sound into generated audio: ambience, foley, impacts, stings, and any other non-speech effect. A prompt-influence control trades literal fidelity to the description against creative variation. Duration can be pinned within a half-second to thirty-second range, or left unset so the model picks a length that suits the sound described. The response is the encoded audio itself rather than a link.

The generated audio, returned inline with its media type and size in bytes.

Input

These go in the input object of the run request.

FieldTypeRequiredDescription
textstringYesThe sound to generate, described in words.
duration_secondsnumberNoHow long the sound should be; omit to let the model choose.
Minimum: 0.5
Maximum: 30
prompt_influencenumberNoHow closely to follow the description, from loose to literal.
Default: 0.3
Minimum: 0
Maximum: 1

Requests up to 1 MB.

Example

Use your own API key and a saved idempotency key for each new job. Replace image or media placeholders with your own publicly reachable HTTPS URLs. Keep the same key and request body when recovering a timeout.

# Set once per job; reuse this key and the identical body after a timeout.
: "${AGENTSKY_IDEMPOTENCY_KEY:?Set a unique, saved key for this job}"
curl --fail-with-body https://gateway.agentsky.dev/v1/run \
  -H "authorization: Bearer $AGENTSKY_API_KEY" \
  -H "content-type: application/json" \
  -H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \
  -d '{"provider":"elevenlabs","endpoint":"sound_generation","input":{"text":"A heavy wooden door creaking open in an empty hall","duration_seconds":4}}'
# If status is READY/RUNNING, poll GET /v1/runs/{runId} with the same API key.

Pricing

$0.0192 per call using your plan when signed in. Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.

Questions