Skip to main content
POST
Basic Text-to-Speech

Overview

Generate high-quality speech from text using the default voice. This is the simplest way to convert text to speech.

Request Body

string
required
The text to convert to speech
string
default:"en"
Language code (e.g., “en”, “es”, “fr”). See supported languages
string
Optional Google Cloud voice name (e.g., en-US-Wavenet-D). Use GET /tts/voices to discover available voices.
number
default:"1.0"
Speaking rate. Values < 1.0 slow down the voice, values > 1.0 make it faster.
number
default:"0.0"
Pitch adjustment in semitones. Positive values raise the pitch, negative values lower it.
number
default:"0.0"
Volume gain in decibels. Range is typically between -96.0 and +16.0.
string
required
Your GistMag API key

Example Request

Response

The response is an audio file (WAV format) with the generated speech. Content-Type: audio/wav Content-Disposition: attachment; filename=output.wav

Credit Cost

1 credit per 1,000 characters, with a minimum of 1 credit for any request.

Examples:

  • 10 characters = 1 credit (minimum charge)
  • 500 characters = 1 credit (minimum charge)
  • 999 characters = 1 credit (minimum charge)
  • 1,000 characters = 1 credit
  • 1,001 characters = 2 credits (rounded up)
  • 2,500 characters = 3 credits (rounded up)
  • 5,000 characters = 5 credits

Example Usage

Python

JavaScript

Text Length Limits

  • Maximum: 10,000 characters per request
  • Recommended: For longer text, use the batch endpoint
For very long text, consider using the batch endpoint which automatically splits text into manageable chunks.