---
title: "Create Speech Task"
method: POST
path: "/v1/tts/lyra"
tags: ["Voice AI Beta — Lyra"]
---

# Create Speech Task

`POST /v1/tts/lyra`

Create a Text-to-Speech task with Lyra. Provide **exactly one** of `voice_id` (preset voice from `GET /v1/tts/lyra/voices`) or `voice_asset_id` (your voice clone). Lyra requires an explicit `language` (defaults to `vi`) and supports `speed`, `volume` and `emotion` controls. Cost: `characters` credits (1 : 1), refunded automatically on failure.

### Example
```bash
curl -X POST https://genaipro.io/api/v1/tts/lyra \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "Xin chào, đây là GenAIPro", "voice_id": "694f1b24-...", "language": "vi", "speed": 1.0}'
```
> **Rate limit:** 30 requests/minute

## Request body

- object
  - `title` string — Optional title (derived from content when empty)
  - `content` string, required — Text to convert to speech
  - `voice_id` string — Preset voice id (from `GET /v1/tts/lyra/voices`). Provide exactly one of `voice_id` / `voice_asset_id`.
  - `voice_asset_id` string — Voice clone id (from `POST /v1/tts/voice-assets`). Provide exactly one of `voice_id` / `voice_asset_id`.
  - `language` string — ISO-639-1 language code (42 supported, e.g. `vi`, `en`, `ja`, `ko`, `zh`, `fr`, `de`, `es`). Unsupported codes → `400`.
  - `speed` number — Speaking speed (values outside the range are clamped)
  - `volume` number — Output volume (values outside the range are clamped)
  - `emotion` 'neutral' | 'angry' | 'excited' | 'content' | 'sad' | 'scared' — Optional emotion (unknown values are ignored)
  - `callback_url` string — Optional webhook — receives the task object when the task completes or fails

## Response `200`

Task created

- TtsTaskCreated — Create-task acknowledgement
  - `id` string — Task ID (poll via the provider's `GET /{id}`)
  - `status` 'pending' | 'cloning' | 'queued' | 'processing' | 'merging' | 'process_merging' | 'completed' | 'failed' — Voice AI Beta task lifecycle: `pending` → `cloning` (clone flow only) → `queued` → `processing` → `merging` → `process_merging` → `completed` | `failed`.
  - `provider` string
  - `total_length` integer — Billable characters (encoder units ≈ UTF-8 bytes)

## Other responses

- `400` — Invalid request (voice selection, language, credit, callback)
- `429` — Rate limit exceeded
- `503` — Voice verification temporarily unavailable — retry

---

[API](https://skmtc.dev/genaipro/apis/genaipro-api.md) · [All operations](https://skmtc.dev/genaipro/apis/genaipro-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/genaipro/genaipro-api/revisions/91f814eaecbd/schema)
