Docs
TTS API

TTS API

Generates audio from the input text.

Official Guide
We provide this cost friendly API for high throughput scenarios, there's no rate limit 🚀! For more detailed API spec, see platform.openai.com/docs/api-reference/audio/createSpeech


Available models:

  1. tts-1
  2. tts-1-hd

Pricing
The price of tts call is 75% of the price of OpenAI official website. Details: LLM API | PPU Quota | Endpoint Usage


POST

https://api.goapi.ai/v1/audio/speech

Generates audio from the input text.

Parameters:

Header
NameTypeRequiredDescription
Authorizationstring✔️Bearer YOUR-GOAPI-KEY
Body
NameTypeRequiredDescription
modelstring✔️'tts-1' or 'tts-1-hd'
inputstring✔️The text to generate audio for. The maximum length is 4096 characters.
voicestring✔️The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`.
response_formatstringThe format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`.
speednumberThe speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default.

Response Codes:

200: OK
Successful Response
400: Bad Request
The request format does not meet the requirements.
401: Unauthorized
The API key is incorrect
500: Internal Server Error
Service is experiencing an error

Request Example

curl https://api.goapi.ai/v1/audio/speech \
  -H "Authorization: Bearer $YOUR_GOAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
  }' \
  --output speech.mp3