Voice AI Beta — Lyra

Create Speech Task

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

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

post/v1/tts/lyra

Request body

titlestring

Optional title (derived from content when empty)

contentstring required

Text to convert to speech

voice_idstring

Preset voice id (from GET /v1/tts/lyra/voices). Provide exactly one of voice_id / voice_asset_id.

voice_asset_idstring

Voice clone id (from POST /v1/tts/voice-assets). Provide exactly one of voice_id / voice_asset_id.

languagestring

ISO-639-1 language code (42 supported, e.g. vi, en, ja, ko, zh, fr, de, es). Unsupported codes → 400.

speednumber

Speaking speed (values outside the range are clamped)

volumenumber

Output volume (values outside the range are clamped)

emotion'neutral' | 'angry' | 'excited' | 'content' | 'sad' | 'scared'

Optional emotion (unknown values are ignored)

callback_urlstring

Optional webhook — receives the task object when the task completes or fails

Example request

{
  "content": "Xin chào, đây là GenAIPro"
}

Response

Task created

idstring

Task ID (poll via the provider's GET /{id})

status'pending' | 'cloning' | 'queued' | 'processing' | 'merging' | 'process_merging' | 'completed' | 'failed'

Voice AI Beta task lifecycle: pendingcloning (clone flow only) → queuedprocessingmergingprocess_mergingcompleted | failed.

providerstring
total_lengthinteger

Billable characters (encoder units ≈ UTF-8 bytes)

Example response

{
  "status": "completed",
  "provider": "lyra"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.