# ElevenLabs Text to Sound v2

This document describes how to call the ElevenLabs `eleven_text_to_sound_v2` sound effect generation model, which supports converting text descriptions into sound effect audio.

> **Official Documentation Reference**:
> - [Create sound effect](https://elevenlabs.io/docs/api-reference/sound-generation)

---

## Sound Effect Generation (Synchronous)

### Endpoint

`POST https://api-us-ca.umodelverse.ai/v1/audio/sound-generation`

Converts a text description into sound effect audio, suitable for use cases such as video production, voiceovers, or games.

### Input

| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| model | string | Yes | Model name, fixed value: `text-to-sound-v2` |
| text | string | Yes | Text description of the sound effect you want to generate |
| loop | boolean | No | Whether to generate a loopable sound effect. Default is `false`. Only supported by the `eleven_text_to_sound_v2` model |
| duration_seconds | double | Yes | Duration of the sound effect in seconds, range: 0.5–30 |
| prompt_influence | double | No | Degree of influence the prompt has on the output, range: 0–1, default is `0.3`. Higher values produce results that more closely match the description but with reduced variety |
| output_format | string | No | Output audio format, e.g., `mp3_22050_32` (MP3, 22.05 kHz, 32 kbps) |

### Request Example

```shell
curl --location 'https://api-us-ca.umodelverse.ai/v1/audio/sound-generation' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "model": "text-to-sound-v2",
  "text": "Spacious braam suitable for high-impact movie trailer moments",
  "duration_seconds": 5.0,
  "output_format": "mp3_22050_32"
}' \
--output sound_effect.mp3
```

### Output

Returns a binary audio stream directly. The format is determined by `output_format`, defaulting to MP3.

### Response Headers

| Parameter | Type | Description |
| :--- | :--- | :--- |
| character-cost | string | Number of characters consumed by this generation |
