API Documentation
9jaLingo API Reference
Official Python and Node.js SDKs for African languages. Generate natural, expressive speech in Hausa, Igbo, Yoruba, and Pidgin English with 240+ speaker voices and real-time streaming.
Text to Speech
Natural speech in 4 African 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.
Install the Python or Node.js SDK, or call the REST API directly with cURL.
terminal
# 1) Install the official SDK (Python 3.11+)pip install naijalingo# 2) Copy your real key from https://9jalingo.org/dashboard# 3) Paste it below — replace YOUR_API_KEY (do not leave this as-is)export NAIJALINGO_API_KEY="YOUR_API_KEY"
YOUR_API_KEY with your real key from 9jalingo.org/dashboard. Leaving the placeholder returns {"detail":"Invalid API Key"} and saves a broken audio file. Later examples assume NAIJALINGO_API_KEY is already set in your shell.Get speech output in under 60 seconds.
quickstart
from naijalingo import NaijaLingo# Uses NAIJALINGO_API_KEY from step 1 (do not hard-code nl-... placeholders)client = NaijaLingo()# voice/speaker = speaker ID · lang/language = language codeaudio = client.tts.generate( "Bawo ni, I dey greet you!", voice="adeola_yo", lang="yo",)audio.save("greeting.wav")audio = client.tts.generate("Sannu da zuwa!", speaker="aisha_ha", language="ha")audio.save("output.wav")
Generate speech with a speaker ID in voice / speaker(e.g. ada_pcm) and an optional language in lang / language(ha / ig / yo / pcm). Returns WAV by default. Use response_format to export to MP3, FLAC, AAC, OGG, ALAC, or PCM.
tts-generate
from naijalingo import NaijaLingo# Uses NAIJALINGO_API_KEY from step 1client = NaijaLingo()# voice/speaker = speaker ID · lang/language = language codeaudio = client.tts.generate("How you dey?", voice="ada_pcm", lang="pcm")audio.save("output.wav")# speaker= / language= aliasesaudio = client.tts.generate( "Nnoo, kedu ka i mere?", speaker="adaeze_ig", language="ig",)audio.save("adaeze_greeting.wav")# Export to MP3, FLAC, AAC, OGG, ALAC, or PCMaudio = client.tts.generate( "Make we test compressed audio.", voice="ada_pcm", lang="pcm", response_format="mp3",)audio.save("output.mp3")# Fine-tune generation parametersaudio = client.tts.generate( "Na so life be sometimes.", voice="ada_pcm", lang="pcm", temperature=0.8, top_p=0.9, repetition_penalty=1.2,)
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | required | The text to synthesize. (SDK: first positional arg to generate/stream.) |
model | string? | optional | Model ID, e.g. "9jalingo-tts-1". Defaults to the active model if omitted. |
voice | string? | optional | Speaker ID (e.g. ada_pcm, adaeze_ig). Alias: speaker. Not a language code. |
speaker | string? | optional | Alias of voice — speaker ID. Takes precedence over voice when both are set. |
lang | string? | optional | Language code: ha · ig · yo · pcm. Alias: language. Auto-inferred from speaker suffix if omitted. |
language | string? | optional | Alias of lang. |
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. |