# Stream cloned speech

- **Method:** `POST`
- **Path:** `/api/v1/generation/clone/stream`
- **Operation ID:** `start_clone_stream_api_v1_generation_clone_stream_post`
- **Tags:** Clone

Start a streaming voice clone session.

Returns a `session_id` immediately. Connect to
`GET /api/v1/streaming/{session_id}/audio` to receive chunked WAV audio
as it is generated. Call `POST /api/v1/streaming/{session_id}/finalize`
when done to get the complete audio as base64.

Cancels any in-progress generation to prioritize the stream.

## Effective servers

- `http://127.0.0.1:8100`

  Voice Creator Pro on this computer

## Request body

**Required:** `true`

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

schema: `CloneRequest`

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

  Text to generate speech for
- **`emotion`**: `string | null`

  Emotion to apply. If set and not 'neutral', uses emotional clone. Query GET /api/v1/models/active for supported emotions.
- **`generation_params`**: `object | null`, schema: `GenerationParamsModel`

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

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

  Emotion intensity (very\_mild/mild/normal/strong/extreme). Defaults to 'normal' when emotion is set.
- **`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. Triggers auto-load if needed.
- **`quality`**: `string | null`

  Quality/variant tier. Query GET /api/v1/models/active for available tiers.
- **`ref_audio_base64`**: `string | null`

  Base64-encoded reference audio (WAV). Optional if voice\_id is provided.
- **`ref_text`**: `string`, default: `""`

  Transcript of the reference audio
- **`voice_id`**: `string | null`

  Voice ID for prompt caching. If provided, saved audio is used as fallback when ref\_audio\_base64 is omitted.

**Example:**

```json
{
  "ref_audio_base64": "UklGRi4AAABXQVZFZm10IBAAAA...",
  "ref_text": "Hello, this is a sample of my voice.",
  "target_text": "Welcome to the voice cloning demo.",
  "language": "English",
  "voice_id": "a1b2c3d4",
  "quality": "higher_quality",
  "generation_params": {
    "seed": 42,
    "additionalProperty": "anything"
  },
  "model_family": "qwen3-tts",
  "emotion": "angry",
  "intensity": "normal"
}
```

## Responses

### 200 Successful Response

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

schema: `StreamStartedResponse`

- **`queue_position` (required)**: `integer`

  Position in the generation queue
- **`session_id` (required)**: `string`

  Unique session ID for streaming endpoints
- **`started` (required)**: `boolean`

  Whether the streaming session was created

**Example:**

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

### 422 Validation Error

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

schema: `HTTPValidationError`

- **`detail`**: `array`

  **Items:**

  schema: `ValidationError`
  - **`loc` (required)**: `array of (string | integer)`
  - **`msg` (required)**: `string`
  - **`type` (required)**: `string`
  - **`ctx`**: `object`
  - **`input`**: `any`

**Example:**

```json
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": null,
      "ctx": {}
    }
  ]
}
```

## Schemas

- `CloneRequest` — shown above.
- `GenerationParamsModel` — shown above.
- `HTTPValidationError` — shown above.
- `StreamStartedResponse` — shown above.
- `ValidationError` — shown above.
