---
title: "Text to speech"
method: POST
path: "/api/audio/speech"
tags: ["multimodal"]
---

# Text to speech

`POST /api/audio/speech`

Convert text to speech through the Respan gateway with automatic logging.

## Headers

- `Authorization` string, required
- `X-Data-Respan-Params` string

## Request body

- object
  - `model` 'tts-1' | 'tts-1-hd', required — TTS model.
  - `input` string, required — Text to generate audio for. Max 4096 characters.
  - `voice` 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer', required — Voice to use.
  - `response_format` 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm' — Audio output format.
  - `speed` number, double — Audio speed (0.25 to 4.0).
  - `customer_credentials` ApiAudioSpeechPostRequestBodyContentApplicationJsonSchemaCustomerCredentials — Per-customer LLM provider credentials.
  - `disable_log` boolean — When `true`, omits input/output from the log. Metrics still recorded.
  - `metadata` ApiAudioSpeechPostRequestBodyContentApplicationJsonSchemaMetadata — Custom key-value metadata.
  - `customer_identifier` string — End user identifier.
  - `thread_identifier` string — Conversation thread ID.

## Response `200`

Audio content in the requested format.

## Other responses

- `401` — Unauthorized

## Changes

- **2026-08-13** `4e064cf81dae` — 1 breaking, 1 warning, 4 info
  - removed the media type `application/json` for the response with the status `200`
  - deleted the `query` request parameter `format`
  - added the new optional `header` request parameter `X-Data-Respan-Params`
  - added optional request body
  - …2 more
- **2026-07-31** `c26d550029f8` — 2 breaking, 1 warning, 3 info
  - removed the request body
  - removed the media type `application/octet-stream` for the response with the status `200`
  - deleted the `header` request parameter `X-Data-Respan-Params`
  - added the new optional `query` request parameter `format`
  - …2 more

[Change history](https://skmtc.dev/keywordsai/apis/api-reference/changes/api/audio/speech/post.md)

---

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