---
title: "Generate speech"
method: POST
path: "/audio/speech"
tags: ["Audio"]
---

# Generate speech

`POST /audio/speech`

Text-to-speech served by XTTS, Bark, or Qwen3-TTS depending on the pipeline. Audio requests are sent once; do not rely on Idempotency-Key to deduplicate retries.

## Request body

- SpeechRequest
  - `model` string, required
  - `input` string, required
  - `voice` string
  - `response_format` 'mp3' | 'wav' | 'flac' | 'opus' | 'aac' | 'pcm'
  - `speed` number

## Response `200`

Audio bytes

## Other responses

- `400` — Malformed request
- `401` — Missing or invalid API key
- `402` — Insufficient credits
- `403` — Key scope mismatch or plan limit exceeded
- `404` — Model or deployment not found
- `409` — Idempotency conflict
- `429` — Rate limit exceeded
- `500` — Unexpected gateway error
- `502` — Upstream serving backend transient failure
- `503` — Endpoint stopped, provisioning, or at capacity
- `504` — Gateway timeout

---

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