Audio

Text to Speech Conversion

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

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

Request body

providerstring required

Name of the audio provider, default to 'openai'.

modelstring required

Model identifier for the speech synthesis.

inputstring required

Text input to be converted into speech.

voicestring required

Voice setting for the speech synthesis. Query /v1/models?voices for complete list.

responseFormatstring

The audio format of the response (e.g., mp3, opus) defaults mp3 (openai).

speednumber float

Speed of the speech playback (openai).

streamboolean

Whether to stream the response.

Example request

{
  "provider": "elevenlabs",
  "model": "eleven_multilingual_v2",
  "input": "why is the sky blue?",
  "voice": "2EiwWnXFnvU5JabPnv8n",
  "voiceSettings": {
    "use_speaker_boost": true
  },
  "speed": 1,
  "stream": true
}

Response

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

Changes

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