API Documentation
9jaLingo API Reference
The official SDK for Nigerian Languages. Generate natural, expressive speech in Hausa, Igbo, Yoruba, and Nigerian Pidgin with 240+ speaker voices and real-time streaming.
Text to Speech
Natural speech in 4 Nigerian languages with 240+ voices.
Real-time Streaming
Stream audio chunks as they are generated for long texts.
Voice Cloning
Clone any voice from a short reference audio sample.
Multi-language
Hausa, Igbo, Yoruba, and Nigerian Pidgin.
1Installation
Install the Python SDK, or use the REST API directly with any HTTP client.
terminal
# Install the official 9jaLingo Python SDK (Python 3.11+)pip install naijalingo# Set your API key as an environment variableexport NAIJALINGO_API_KEY="nl-..."
Set
NAIJALINGO_API_KEY as an environment variable to avoid hard-coding your key. Get your key at 9jalingo.org/dashboard.2Quick start
Get speech output in under 60 seconds.
quickstart
from naijalingo import NaijaLingoclient = NaijaLingo(api_key="nl-...")# Generate speech in Yorubaaudio = client.tts.generate("Bawo ni, I dey greet you!", voice="yo")audio.save("greeting.wav")# Or rely on the NAIJALINGO_API_KEY environment variableclient = NaijaLingo()audio = client.tts.generate("Sannu da zuwa!", voice="ha")audio.save("output.wav")
Text-to-Speech
Generate speech from text using any supported language and speaker. Returns WAV by default. Use response_format to export to MP3, FLAC, AAC, OGG, ALAC, or PCM.
POST/v1/audio/speech
tts-generate
from naijalingo import NaijaLingoclient = NaijaLingo(api_key="nl-...")# Basic generation — returns WAV by defaultaudio = client.tts.generate("How you dey?", voice="pcm")audio.save("output.wav")# With a specific speaker voiceaudio = client.tts.generate( "Nnoo, kedu ka i mere?", voice="ig", speaker="adaeze_ig",)audio.save("adaeze_greeting.wav")# Export to MP3, FLAC, AAC, OGG, ALAC, or PCMaudio = client.tts.generate( "Make we test compressed audio.", voice="pcm", response_format="mp3",)audio.save("output.mp3")# Fine-tune generation parametersaudio = client.tts.generate( "Na so life be sometimes.", voice="pcm", temperature=0.8, top_p=0.9, repetition_penalty=1.2,)
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | required | The text to synthesize. |
model | string? | optional | Model ID. Use "9jalingo-tts-1". |
voice | string | required | Language code: ha, ig, yo, or pcm. |
speaker | string? | optional | Speaker voice ID, e.g. adaeze_ig. |
response_format | string? | optional | wav (default) · pcm · mp3 · flac · aac · alac · ogg |
temperature | float? | optional | Sampling temperature (0.0 – 1.5). Default: 0.95. |
top_p | float? | optional | Nucleus sampling (0.0 – 1.0). Default: 0.95. |
repetition_penalty | float? | optional | Repetition penalty (1.0 – 1.5). Default: 1.1. |