# Generate speech from text

- **Method:** `POST`
- **Path:** `/api/v1/tts/generate`
- **Operation ID:** `start_tts_api_v1_tts_generate_post`
- **Tags:** TTS

Generate speech using a built-in speaker voice, with optional style instruction.

## Effective servers

- `http://127.0.0.1:8100`

  Voice Creator Pro on this computer

## Query parameters

- **`sync`**: `boolean`, default: `false`

  Wait for generation to complete and return audio directly

## Request body

**Required:** `true`

**Content type:** `application/json`

schema: `TTSRequest`

- **`speaker` (required)**: `string`

  Speaker ID (e.g. 'Ryan', 'Vivian')
- **`text` (required)**: `string`

  Text to generate speech for
- **`generation_params`**: `object | null`, schema: `GenerationParamsModel`

  Advanced sampling parameters
  - **`seed`**: `integer | null`

    Random seed for reproducible generation
- **`instruct`**: `string | null`

  Optional voice style instruction
- **`language`**: `string`, default: `"Auto"`

  Target language. Query GET /api/v1/models/active for supported languages per variant.
- **`model_family`**: `string | null`

  TTS model to use. If omitted, uses the currently configured model.
- **`quality`**: `string | null`

  Quality/variant tier. Query GET /api/v1/models/active for available tiers.

**Example:**

```json
{
  "text": "Hello, how are you today?",
  "speaker": "Vivian",
  "language": "English",
  "instruct": "Speak slowly and softly",
  "quality": "higher_quality",
  "generation_params": {
    "seed": 42,
    "additionalProperty": "anything"
  },
  "model_family": "qwen3-tts"
}
```

## Responses

### 200 Generation started (async) or completed result (sync).

**Content type:** `application/json`

**Any of:**

- `object`, schema: `GenerationStartedResponse`
  - **`queue_position` (required)**: `integer`

    Position in the generation queue (0 = next to run)
  - **`started` (required)**: `boolean`

    Whether the generation job was enqueued
- `object`, schema: `GenerationResult`
  - **`status` (required)**: `string`

    Human-readable status message
  - **`success` (required)**: `boolean`

    Whether generation completed successfully
  - **`audio_base64`**: `string | null`

    Base64-encoded audio output (WAV format)
  - **`error_code`**: `string | null`

    Machine-readable failure code when success is false
  - **`error_detail`**: `string | null`

    Extra detail for the failure code

**One of:**

- *Schema `GenerationStartedResponse` is shown above.*
- *Schema `GenerationResult` is shown above.*

**Example:**

```json
{
  "started": true,
  "queue_position": 0
}
```

### 422 Invalid speaker ID. Use \`GET /api/v1/tts/speakers\` to list valid IDs.

### 504 Sync generation timed out (600s limit).

## Schemas

- `GenerationParamsModel` — shown above.
- `GenerationResult` — shown above.
- `GenerationStartedResponse` — shown above.
- `TTSRequest` — shown above.
