# Generate voice preview

`POST https://www.getrevox.com/api/voices/preview`

Generate a short audio preview for a given voice.

## Request body (JSON)

- `voiceId` (string, required): The voice ID to generate a preview for.
- `provider` (enum (string), required): The provider to use for the preview. One of: `cartesia`, `elevenlabs`, `gradium`.
- `text` (string, optional): Custom text for the preview. If omitted, a short default is used. Constraints: max length 2000.
- `assistantPrompt` (string, optional): Prompt of the assistant the voice is for. When `text` is omitted, the preview is a few lines that assistant would say on a call. Constraints: max length 100000.
- `speed` (number, optional): Speed for preview. Cartesia 0.6–1.5, ElevenLabs 0.7–1.2. Default 1.0. Constraints: min 0.6, max 1.5.
- `volume` (number, optional): Volume for Cartesia preview (0.5–2.0). Ignored for other providers. Constraints: min 0.5, max 2.
- `model` (enum (string), optional): Cartesia model for the preview. Defaults to sonic-3.6. Ignored for other providers. One of: `sonic-3`, `sonic-3.5`, `sonic-3.6`.

## Example request

```bash
curl -X POST https://www.getrevox.com/api/voices/preview \
  -H "Authorization: Bearer $REVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "voiceId": "string",
    "provider": "cartesia"
  }'
```

## Responses

### 200: Success

### 400: Invalid request: the body or a parameter failed validation

- `error` (string, required)

### 500: Server error

- `message` (string, optional)
- `error` (string, optional)
- `bodyErrors` (object, optional): The validation errors returned from the API.
  - `issues` (array of object, required)
    - `path` (array of one of, required)
      - One of, **string** (string)
      - One of, **number** (number)
    - `message` (string, required)
    - `code` (string, optional)