---
title: "Text to Speech Conversion"
method: POST
path: "/v1/audio/speech"
tags: ["Audio"]
---

# Text to Speech Conversion

`POST /v1/audio/speech`

## Request

- Base URL: `https://apipie.ai`
- URL: `https://apipie.ai/v1/audio/speech`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Convert text to speech using the specified model and voice settings.

## Request body

- AudioSpeechRequest
  - `provider` string, required: Name of the audio provider, default to 'openai'.
  - `model` string, required: Model identifier for the speech synthesis.
  - `input` string, required: Text input to be converted into speech.
  - `voice` string, required: Voice setting for the speech synthesis. Query /v1/models?voices for complete list.
  - `voiceSettings` object: Additional settings for voice modulation.
    - `stability` integer: Stability of the voice modulation, 0-1.
    - `similarity_boost` integer: Boost the similarity of the voice modulation, 0-1.
    - `style` integer: Style of the voice modulation, 0-1.
    - `use_speaker_boost` boolean: Whether to use speaker boost.
  - `responseFormat` string: The audio format of the response (e.g., mp3, opus) defaults mp3 (openai).
  - `speed` number, float: Speed of the speech playback (openai).
  - `stream` boolean: Whether to stream the response.

## Response `200`

The audio file or stream returned successfully. Additional usage details are provided in the 'X-Audio-Details' header.

## Other responses

- `400`: Invalid request parameters.

---

[API](https://skmtc.dev/apipie/apis/introduction.md) · [All operations](https://skmtc.dev/apipie/apis/introduction/llms.txt) · [OpenAPI document](https://skmtc.dev/apipie/apis/introduction/revisions/f8386be4eb3f?raw)
