Learn how to instantly generate lifelike audio from text.

The Groq API speech endpoint provides fast text-to-speech (TTS), enabling you to convert text to spoken audio in seconds with our available TTS models.

With support for 23 voices, 19 in English and 4 in Arabic, you can instantly create life-like audio content for customer support agents, characters for game development, and more.

EndpointUsageAPI Endpoint
SpeechConvert text to audiohttps://api.groq.com/openai/v1/audio/speech
Model IDModel CardSupported Language(s)Description
playai-ttsCard EnglishHigh-quality TTS model for English speech generation.
playai-tts-arabicCard ArabicHigh-quality TTS model for Arabic speech generation.

Quick Start

The speech endpoint takes four key inputs:

  • model: playai-tts or playai-tts-arabic
  • input: the text to generate audio from
  • voice: the desired voice for output
  • response format: defaults to "wav"

The Groq SDK package can be installed using the following command:

pip install groq

The following is an example of a request using playai-tts. To use the Arabic model, use the playai-tts-arabic model ID and an Arabic prompt:

1import os
2from groq import Groq
3
4client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
5
6speech_file_path = "speech.wav" 
7model = "playai-tts"
8voice = "Fritz-PlayAI"
9text = "I love building and shipping new features for our users!"
10response_format = "wav"
11
12response = client.audio.speech.create(
13    model=model,
14    voice=voice,
15    input=text,
16    response_format=response_format
17)
18
19response.write_to_file(speech_file_path)

Parameters

ParameterTypeRequiredValueDescription
modelstringYesplayai-tts
playai-tts-arabic
Model ID to use for TTS.
inputstringYes-User input text to be converted to speech. Maximum length is 10K characters.
voicestringYesSee available English and Arabic voices.The voice to use for audio generation. There are currently 26 English options for playai-tts and 4 Arabic options for playai-tts-arabic.
response_formatstringOptional"wav"Format of the response audio file. Defaults to currently supported "wav".

Available English Voices

The playai-tts model currently supports 19 English voices that you can pass into the voice parameter (Arista-PlayAI, Atlas-PlayAI, Basil-PlayAI, Briggs-PlayAI, Calum-PlayAI, Celeste-PlayAI, Cheyenne-PlayAI, Chip-PlayAI, Cillian-PlayAI, Deedee-PlayAI, Fritz-PlayAI, Gail-PlayAI, Indigo-PlayAI, Mamaw-PlayAI, Mason-PlayAI, Mikail-PlayAI, Mitch-PlayAI, Quinn-PlayAI, Thunder-PlayAI).

Experiment to find the voice you need for your application:

Arista-PlayAI
0:000:00
Atlas-PlayAI
0:000:00
Basil-PlayAI
0:000:00
Briggs-PlayAI
0:000:00
Calum-PlayAI
0:000:00
Celeste-PlayAI
0:000:00
Cheyenne-PlayAI
0:000:00
Chip-PlayAI
0:000:00
Cillian-PlayAI
0:000:00
Deedee-PlayAI
0:000:00
Fritz-PlayAI
0:000:00
Gail-PlayAI
0:000:00
Indigo-PlayAI
0:000:00
Mamaw-PlayAI
0:000:00
Mason-PlayAI
0:000:00
Mikail-PlayAI
0:000:00
Mitch-PlayAI
0:000:00
Quinn-PlayAI
0:000:00
Thunder-PlayAI
0:000:00

Available Arabic Voices

The playai-tts-arabic model currently supports 4 Arabic voices that you can pass into the voice parameter (Ahmad-PlayAI, Amira-PlayAI, Khalid-PlayAI, Nasser-PlayAI).

Experiment to find the voice you need for your application:

Ahmad-PlayAI
0:000:00
Amira-PlayAI
0:000:00
Khalid-PlayAI
0:000:00
Nasser-PlayAI
0:000:00