# Sound effect generator API

A sound effect from a description, as an MP3 of 0.5 to 30 seconds, or one that loops without a seam (loop: true) for ambience and engines. Without seconds the model picks the length; the job is held at 30 s and charged for the length it came back. Search the free library first (search_assets, type audio).

Tool id `sound-effect-generator` on the REST API (`POST https://3dvalley.com/api/v1/jobs`); MCP tool `generate_sound_effect` on https://3dvalley.com/mcp. Paid in credits (1 credit = $0.01), taken when the job starts and given back if it fails. The general rules (keys, idempotency, waiting, webhooks) are in [the API docs](https://3dvalley.com/docs/api).

The free CC0 library holds sound effects already: `GET /api/v1/assets?type=audio&q=door+creak` (MCP: `search_assets` with `type: "audio"`) before paying for one.

## Models and prices

| Model | Name | Price | Time | What it is |
|---|---|---|---|---|
| `elevenlabs-sfx` (default) | ElevenLabs Sound Effects | 1 credit per 2 seconds | about 8 s | A sound effect from a description, 0.5 to 30 seconds, or one that loops without a seam. |

## Input

| Field | Required | |
|---|---|---|
| `prompt` | yes | The sound: "heavy wooden door creaking open, then slamming shut". Up to 450 characters. |

## Options

| Option | Type | Values | |
|---|---|---|---|
| `seconds` | number | from 0.5 to 30 | The length in seconds. Without it the model picks one. |
| `loop` | boolean | `true` or `false` | Make it loop without a seam. Default `false`. |
| `prompt_influence` | number | from 0 to 1 | 0 to 1: how closely it keeps to the words; higher varies less. The default is 0.3. |

## Output

Files: `audio`. `audio` is the MP3 (128 kbit/s, 44.1 kHz). `stats.seconds` is its length. A job without `seconds` is held at the longest and charged for the length it came back (`credits.charged`).

## Example

```
curl -X POST https://3dvalley.com/api/v1/jobs \
  -H "Authorization: Bearer $THREEDVALLEY_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=50" \
  -H "Content-Type: application/json" \
  -d '{"tool":"sound-effect-generator","input":{"prompt":"heavy wooden door creaking open, then slamming shut"},"options":{"seconds":4}}'
```

From an MCP client:

```
generate_sound_effect({"prompt":"heavy wooden door creaking open, then slamming shut","seconds":4})
```

## Limits

- `max_prompt`: 450
- `min_seconds`: 0.5
- `max_seconds`: 30
