Get API Key Get API
Docs

TTS Text-to-Speech

- Support multiple voice models and voice selections

  • Output high-quality audio formats: wav, opus, aac, flac, pcm
  • Maximum input text of 4096 characters

Request example

curl --request POST \
  --url https://api.openveer.com/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-4o-mini-tts",
    "input": "The quick brown fox jumps over the lazy dog.",
    "voice": "alloy",
    "response_format": "opus",
    "speed": 1.0
  }' \
  --output speech.opus

Response example

Binary audio data stream

Authorizations

Authorization string

All APIs require Bearer Token authentication

Get API Key:

Visit API Key Management Page to get your API Key

Add to request header:

Authorization: Bearer YOUR_API_KEY

Body

model string

TTS model name

Available models:

  • gpt-4o-mini-tts - GPT-4o Mini TTS model

Example: "gpt-4o-mini-tts"

input string

The text to convert to speech

Maximum length: 4096 characters

Example: "The quick brown fox jumps over the lazy dog."

voice string

Voice selection

Available voices:

  • alloy - Neutral, balanced voice
  • echo - Male, calm voice
  • fable - British, narrative voice
  • onyx - Male, deep voice
  • nova - Female, energetic voice
  • shimmer - Female, gentle voice

Example: "alloy"

response_format string

Audio output format

Supported formats:

  • wav - WAV format, uncompressed (default)
  • opus - Opus format, for internet streaming
  • aac - AAC format
  • flac - FLAC format, lossless compression
  • pcm - PCM format, raw audio data

Example: "wav"

speed number

Speech playback speed

Range: 0.25 to 4.0

  • 0.25 - Slowest speed (1/4x)
  • 1.0 - Normal speed (default)
  • 4.0 - Fastest speed (4x)

Example: 1.0

Response

Returns binary audio data stream on success, which can be saved as an audio file or played directly.

Returns JSON formatted error information on error, including error code, message, and type.

This documentation is built and hosted on Mintlify, a developer documentation platform.