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.
| Endpoint | Usage | API Endpoint | 
|---|---|---|
| Speech | Convert text to audio | https://api.groq.com/openai/v1/audio/speech | 
| Model ID | Model Card | Supported Language(s) | Description | 
|---|---|---|---|
| playai-tts | Card | English | High-quality TTS model for English speech generation. | 
| playai-tts-arabic | Card | Arabic | High-quality TTS model for Arabic speech generation. | 
The speech endpoint takes four key inputs:
playai-tts or playai-tts-arabic"wav"The Groq SDK package can be installed using the following command:
pip install groqThe 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:
import os
from groq import Groq
client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
speech_file_path = "speech.wav" 
model = "playai-tts"
voice = "Fritz-PlayAI"
text = "I love building and shipping new features for our users!"
response_format = "wav"
response = client.audio.speech.create(
    model=model,
    voice=voice,
    input=text,
    response_format=response_format
)
response.write_to_file(speech_file_path)| Parameter | Type | Required | Value | Description | 
|---|---|---|---|---|
| model | string | Yes | playai-ttsplayai-tts-arabic | Model ID to use for TTS. | 
| input | string | Yes | - | User input text to be converted to speech. Maximum length is 10K characters. | 
| voice | string | Yes | See available English and Arabic voices. | The voice to use for audio generation. There are currently 26 English options for playai-ttsand 4 Arabic options forplayai-tts-arabic. | 
| response_format | string | Optional | "wav" | Format of the response audio file. Defaults to currently supported "wav". | 
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:
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: