Quickstart
Create an account, then create an API key in your dashboard. Keys start with nlb_. Set it as an environment variable and send your first request:
curl https://asr.naijallm.com/v1/audio/transcriptions \ -H "Authorization: Bearer $NAIJA_ASR_KEY" \ -F file=@audio.wav \ -F language=ha
import os, requests
r = requests.post(
"https://asr.naijallm.com/v1/audio/transcriptions",
headers={"Authorization": f"Bearer {os.environ['NAIJA_ASR_KEY']}"},
files={"file": open("audio.wav", "rb")},
data={"language": "ha"},
)
r.raise_for_status()
print(r.json()["text"])
const form = new FormData();
form.append("file", audioBlob, "audio.wav");
form.append("language", "yo");
const r = await fetch("https://asr.naijallm.com/v1/audio/transcriptions", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.NAIJA_ASR_KEY}` },
body: form,
});
const { text } = await r.json();
console.log(text);
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["NAIJA_ASR_KEY"], base_url="https://asr.naijallm.com/v1")
with open("audio.wav", "rb") as f:
result = client.audio.transcriptions.create(model="ncair-asr", file=f, language="ig")
print(result.text)
Authentication
Send your API key in the Authorization header of every request:
Authorization: Bearer nlb_...
Keep keys on your server. Don't put them in front-end code or mobile apps. You can create several keys, for example one per project, and revoke any of them from the dashboard.
Transcribe audio
POST https://asr.naijallm.com/v1/audio/transcriptions
The body is multipart/form-data with these fields:
| Field | Type | Description |
|---|---|---|
file | file, required | WAV, FLAC or OGG. Mono or stereo, any sample rate. Up to 10 MB and 60 seconds. |
language | string, required | ha, ig, yo or en. Optional if model sets the language. |
model | string | Defaults to ncair-asr, which picks the model for language. See models. |
response_format | string | json (default) or text. |
Response
{
"text": "A wannan lokaci na tarihin Tarayyan Turai, cocin Katolika ...",
"language": "ha",
"duration": 10.7,
"model": "ncair-asr-hausa",
"attribution": "Powered by NCAIR / N-ATLaS ASR models: ..."
}duration is the length of the audio in seconds. To send MP3 or M4A, convert it first, for example with ffmpeg -i in.mp3 -ar 16000 -ac 1 audio.wav.
Models and languages
| Language | Code | Model | Source |
|---|---|---|---|
| Hausa | ha | ncair-asr-hausa | NCAIR1/Hausa-ASR |
| Igbo | ig | ncair-asr-igbo | NCAIR1/Igbo-ASR |
| Yoruba | yo | ncair-asr-yoruba | NCAIR1/Yoruba-ASR |
| Nigerian English | en | ncair-asr-english | NCAIR1/NigerianAccentedEnglish |
The three-letter codes hau, ibo, yor and eng also work.
Pricing and limits
The API is free to use. Each key is limited to:
| Requests per minute | 10 |
| Requests per day | 1,000 |
| File size | 10 MB |
| Audio length | 60 seconds |
Responses include X-RateLimit-Limit and X-RateLimit-Remaining headers for the per-minute limit. Need higher limits? Contact us.
Errors
Errors return a JSON body in the same format as OpenAI:
{"error": {"type": "invalid_request_error", "message": "...", "code": "missing_language"}}| Status | Code | Meaning |
|---|---|---|
| 400 | missing_language, missing_file | A field is missing or invalid. The message says which. |
| 401 | invalid_api_key | The key is missing, wrong or revoked. |
| 413 | file_too_large, audio_too_long | The file is over 10 MB or 60 seconds. |
| 415 | unsupported_audio | The audio could not be decoded. |
| 429 | rate_limit_exceeded | Over the per-minute limit. Retry after Retry-After seconds. |
| 429 | daily_limit_exceeded | Over the daily limit. |
| 503 | service_unavailable | Temporarily unavailable. Retry later. |
Other endpoints
GET /v1/models | List the available models. |
GET /v1/usage | Request counts for your account. Requires a key. |
GET /v1/health | Service status. |
Accuracy
Word error rate (lower is better) on the FLEURS test set, from the Naija LLM Benchmarks leaderboard:
| Language | WER |
|---|---|
| Hausa | 35.0% |
| Igbo | 44.0% |
| Yoruba | 57.5% |
Results vary with recording quality, accent and subject. Review transcripts where accuracy matters.
Licence and attribution
The models are released by NCAIR and Awarri Technologies for non-commercial use. Show this attribution wherever you use the output publicly. It is also returned with every transcript.
Powered by NCAIR / N-ATLaS ASR models: Awarri Technologies in an initiative of the Federal Ministry of Communications, Innovation and Digital Economy.
For commercial use, contact NCAIR / Awarri for a licence.
Acceptable use
By using the API you agree to these terms and to the NCAIR model licence. Do not use it for:
- surveillance or monitoring people without their consent
- profiling people or making decisions about them based on sensitive traits
- fraud, impersonation or harassment
- military or weapons purposes
- commercial products, without a licence from NCAIR / Awarri
Only send recordings you have the right to use. Audio is processed in memory and not stored. We log the time, language, audio length and status of each request. Accounts that break these terms may be suspended. The service is provided as is, without warranty.