> ## Documentation Index
> Fetch the complete documentation index at: https://wiz-myvocal.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create speech

> Synthesize text and return the complete audio in the response body.

<sub>**Text to Speech** · Workflow: [TTS quickstart](https://wiz-myvocal.mintlify.site/quickstart.md) · Models: [TTS Models & Migration](https://wiz-myvocal.mintlify.site/api-reference/tts/models.md)</sub>

### Header

**accessKey** `string` *required*

Your API key. See [Authentication](https://wiz-myvocal.mintlify.site/api-reference/authentication.md).

### Body

**voiceId** `string` *required*

Voice ID returned by `GET /sound_clone/api/v1/voices`.
For `myvocal_v3_accent_enhance`, use a voice returned by `GET /sound_clone/api/v1/voices?modelId=myvocal_v3_accent_enhance`.

**title** `string`

Optional title for the generated record. If empty, backend uses a default title.

**text** `string` *required*

Text to synthesize.

**language** `string`

Language selector.
`myvocal_v3_5`: optional model-specific ISO code; omit it for Auto. See the [Model V3.5 language table](https://wiz-myvocal.mintlify.site/api-reference/tts/v35-language-codes.md).
Default/V2 path: required and must use existing mapped language values.
`myvocal_v3`: optional. If provided, it is forwarded to upstream as `language`. If omitted, upstream auto-detect is used.
See supported V3 codes in [V3 Language Codes](https://wiz-myvocal.mintlify.site/api-reference/tts/v3-language-codes.md) (98 languages).
`myvocal_v3_accent_enhance`: optional. Omit it (or send `auto`) for automatic detection. The Accent model has its own code set (40 language codes plus `auto`); see [TTS Models & Migration](https://wiz-myvocal.mintlify.site/api-reference/tts/models.md). A plain V3 code the Accent model does not support (for example `hmn`) is rejected with `code = 10004`. Legacy mapped enum values such as `US_ENGLISH` are not Accent codes; use `en`.

**modelId** `string`

Optional explicit model selector.
Omit it to use the default model path.
Set `myvocal_v3_5` to request Model V3.5 High Quality.
Set `myvocal_v3` to request the V3 path.
Set `myvocal_v3_accent_enhance` to request the Accent model path.
When the Accent model is requested but its execution path is unavailable, the response is the standard generation error envelope (`code = 10003`). The request is never silently served by a different model.

**voiceSettings** `object`

For advanced settings, use suggested values unless you have strong tuning needs.

**Toggle object**

**stability** `number`

Model V3.5 High Quality defaults to `0.5`. Model V2 and Model V3 default to `0.7` when this value is omitted.A decimal in the range `0.1` to `1` inclusive. Values below `0.1` or above `1` are rejected; no fixed step is enforced.When your parameters are set lower, the emotional variation of the TTS audio will be more abundant. Even for the same text, the effects generated multiple times will be different. You can choose the most suitable one by generating the same text's TTS audio multiple times.When your parameters are set higher, the emotion of the TTS audio will tend to be consistent.**Accent model note:** a value inside the normal legal range (`0.1` to `1`) is accepted for compatibility but has no effect on `myvocal_v3_accent_enhance`. An out-of-range value is still rejected with `code = 10006`.

> [!WARNING]
>
> For `myvocal_v3`, explicit legal values are forwarded without rounding into named presets. This API contract does not define additional preset mappings. Continue sending the value in `voiceSettings.stability`, in 0–1 units; a website display value such as 25 corresponds to `0.25`, not 25. Website controls do not change this API's inclusive `0.1`–`1` range: `0` is rejected with `10006` for every model.

> [!WARNING]
>
> For `myvocal_v3_accent_enhance`, plain text is the supported minimal path. The inline `[tag]` prompt control documented for `myvocal_v3` is not documented as equivalent, and the service does not rewrite your text. Send plain text for the Accent model.

### Prompt Control (myvocal\_v3)

> [!NOTE]
>
> Reference capability source: [v3.myvocal.ai](https://v3.myvocal.ai/). Use `[tag]` in text to guide style and delivery.

Basic syntax:

```text theme={null}
[tag] Your text content
```

Examples:

```text theme={null}
[happy] Hello everyone, welcome to MyVocal.
[laughter] That was funny.
```

Representative categories:

* Emotion control: `happy`, `excited`, `sad`, `angry`, `surprised`
* Non-speech sounds: `laughter`, `throat clearing`, `yawning`, `shushing`, `screaming`
* Sound-related effects: `breathing`, `sighing`, `gasping`, `crying`, `murmuring`

Open boundary note:

> The listed tags are representative examples. The model can understand a broader set of sound and emotion prompts.

### Response

**Content-Type** `string`

Success usually returns `audio/mpeg`.

**Body** `stream`

Binary audio stream payload on success.

> [!NOTE]
>
> An HTTP `200` does not by itself mean the request succeeded. Read `Content-Type` before trusting the body:
>
> * `audio/*` (normally `audio/mpeg`): the audio payload described above.
> * any JSON content type: the standard result envelope with a non-success `code` (see Common errors below).
>
> The two paths fail differently. Before any audio is sent, a rejected or failed request is answered with the JSON envelope above. After audio has started, the connection is terminated instead of appending a JSON body, because appending JSON to a partial audio body would corrupt it. Treat a short or interrupted download as a failed request, not as a complete audio file.

```bash Default model path theme={null}
curl --location 'https://api.myvocal.ai/sound_clone/api/v1/tts' \
--header 'accessKey: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
  "voiceId": "<voice_id>",
  "title": "tts-default",
  "text": "Hello from MyVocal default model path.",
  "language": "en",
  "voiceSettings": {
    "stability": 0.7
  }
}' \
--output output-default.mp3
```

```bash Explicit myvocal_v3 with language theme={null}
curl --location 'https://api.myvocal.ai/sound_clone/api/v1/tts' \
--header 'accessKey: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
  "voiceId": "<voice_id>",
  "title": "tts-v3-explicit-language",
  "text": "[happy] Hola, this is a short V3 test.",
  "language": "en",
  "modelId": "myvocal_v3",
  "voiceSettings": {
    "stability": 0.5
  }
}' \
--output output-v3-explicit.mp3
```

```bash Explicit myvocal_v3 with auto-detect (omit language) theme={null}
curl --location 'https://api.myvocal.ai/sound_clone/api/v1/tts' \
--header 'accessKey: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
  "voiceId": "<voice_id>",
  "title": "tts-v3-auto-detect",
  "text": "[happy] Hola, este es un test para auto detect.",
  "modelId": "myvocal_v3",
  "voiceSettings": {
    "stability": 0.5
  }
}' \
--output output-v3-auto.mp3
```

```bash Explicit myvocal_v3_accent_enhance theme={null}
curl --location 'https://api.myvocal.ai/sound_clone/api/v1/tts' \
--header 'accessKey: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
  "voiceId": "<accent_voice_id>",
  "text": "Hello from the Accent model.",
  "modelId": "myvocal_v3_accent_enhance"
}' \
--output output-accent.mp3
```

```text 200 Success theme={null}
audio/mpeg stream (binary)
```

```json 200 Fail theme={null}
{
  "code": 10004,
  "message": "Invalid language option.",
  "data": null
}
```

### Common errors

* `Invalid language option.` (`code = 10004`): non-V3/default path is missing or using an unsupported `language` value; or the Accent model received a code outside its own language list.
* `VOICE_NOT_FOUND` (`code = 10005`): `voiceId` is invalid or not available under this API key.
* `Invalid stability option.` (`code = 10006`): `voiceSettings.stability` is outside the legal range.
* `code = 10003`: the Accent model path was requested but its execution path is unavailable. The request is not silently served by another model.
* `code = -1`: upstream or backend failed to complete generation.

### Model V3.5 High Quality example

```json theme={null}
{
  "voiceId": "<myvocal_voice_id>",
  "text": "Hello from MyVocal.",
  "modelId": "myvocal_v3_5",
  "language": "en",
  "voiceSettings": { "stability": 0.5 }
}
```

Omit `language` for automatic detection. This model has its own language list. Unsupported codes return `10004`; legal stability remains inclusive `0.1`–`1`. Errors before audio use the existing JSON envelope. Errors after audio begins terminate the transfer without appending JSON; retrying is a new request, not an idempotent continuation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.