---
title: "Unified Text To Speech"
method: POST
path: "/text-to-speech"
---

# Unified Text To Speech

`POST /text-to-speech`

## Request

- Base URL: `https://backend.praktiki.io` (the document declares no server; this is the origin it was published from)
- URL: `https://backend.praktiki.io/text-to-speech`
- Auth: none declared

Unified text-to-speech endpoint supporting Gemini and ElevenLabs providers.

Provider is automatically detected from model_id:
- Models starting with "gemini" → Gemini
- All others → ElevenLabs

For single speaker:
- Provide: text, model_id, voice_id

For multi-speaker (Gemini only):
- Provide: transcript, model_id, speakers list (each with voice_id and optional prompt)

## Request body

- UnifiedTTSRequest
  - `text` string, nullable
  - `transcript` string, nullable
  - `model_id` string, required
  - `voice_id` string, nullable
  - `grapheme` string, nullable
  - `phoneme_ipa` string, nullable
  - `speakers` SpeakerConfig[], nullable
    - `speaker_name` string, required
    - `voice_id` string, required
    - `prompt` string, nullable
  - `temperature` number, nullable
  - `use_pronunciation_dictionary` boolean, nullable
  - `locale` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/praktiki/apis/praktiki-api.md) - [All operations](https://skmtc.dev/praktiki/apis/praktiki-api/llms.txt) - [OpenAPI document](https://skmtc.dev/praktiki/apis/praktiki-api/revisions/3428f9e0a922?raw)
