Text Generator Brain Text Generator
Text Generator > Blog > New AI Text To Speech API

Text Generator.io now can talk!

Finally Affordable Text to Speech API

The pricing is 6.99 USD per month, The API supports speaking up to around 500 words in a single request and will soon be raised

Wildly affordable, better than the rest

Will be available in the self hosted version

Step 1 - Get an API Key

Sign Up to Text-Generator.io then get your API key

Step 2 - Profit

import requests
import os

API_KEY = os.getenv("TEXT_GENERATOR_API_KEY")
if API_KEY is None:
    raise Exception(
        "Please set TEXT_GENERATOR_API_KEY environment variable, login to https://text-generator.io to get your API key")
headers = {"secret": API_KEY}


def create_speech(text, output_file):
    audio_params = {
        "text": text,
        "speaker": "Male fast",
    }
    response = requests.post("https://api.text-generator.io/api/v1/generate_speech", json=audio_params, headers=headers)
    binary_file_response = response.content
    with open(output_file, "wb") as f:
        f.write(binary_file_response)

create_speech("Text-Generator.io is bringing the cost of intelligence toward zero.", "test.wav")
Results
Details

There are also other voices and more on their way! Try them out!

Full list:

    • Male fast
      Male default
      Male slower
      Female 1
      Female 2
  • Under the hood

    Under the hood there is a large audio model and large language model which both analyse the audio at different resolutions to generate the transcribed text using a gpt-2 tokenization scheme, token by token via beam search.

    They have been jointly trained on speech to text, text to text and text to speech, as well as other domains like our web crawler and image understanding modules to enable Text-Generator to unify the understanding of images/text/code/speech.

    In future audio feature analysis will be integrated into our text generation API and crawler, allowing classification, question answering and analysis of conversations with embedded linked audio or video files, as well as transcribing and anonymising existing audio (already possible by using text generator.io to translate to text then back to speech, but soon this will be possible without doing two API calls and having the timestamps match up).

    Plug

    We are on a mission to bring about affordable AI for everyone

    Text Generator offers an API for text, speech and code generation. With rich content understanding built in. Secure (no PII is stored on our servers), affordable, flexible and accurate.

    Try examples yourself at: Text Generator Docs