Get started
Introduction
One API key gives you four tasks for Hausa, Igbo, Yoruba and Nigerian English: speech to text, text to speech, translation, and speech translation. Speech to text and text to speech follow OpenAI's API, so code written for OpenAI needs only a new base URL (see OpenAI compatibility).
Free for non-commercial use. For commercial use, email us; see licence.
| Language | Code | Speech to text | Text to speech | Translation and speech translation |
|---|---|---|---|---|
| Hausa | ha | ✓ | ✓ | ✓ any pair |
| Igbo | ig | ✓ | ✓ | ✓ any pair |
| Yoruba | yo | ✓ | ✓ | ✓ any pair |
| Nigerian English | en | ✓ | ✓ | ✓ any pair |
Base URL: https://asr.naijallm.com/v1. The three-letter codes hau, ibo, yor and eng work everywhere too.
Quickstart
- Create an account and verify your email.
- Create an API key in your dashboard. Keys start with
nlb_. - Save it as an environment variable and send a request:
export NAIJA_ASR_KEY="nlb_..."
curl https://asr.naijallm.com/v1/audio/transcriptions \ -H "Authorization: Bearer $NAIJA_ASR_KEY" \ -F file=@voice-note.m4a \ -F language=ha
curl https://asr.naijallm.com/v1/audio/speech \
-H "Authorization: Bearer $NAIJA_ASR_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "Ina kwana? Yau rana ce mai kyau.", "language": "ha"}' \
-o hello.mp3
curl https://asr.naijallm.com/v1/translations \
-H "Authorization: Bearer $NAIJA_ASR_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Please call me when you get home.", "source": "en", "target": "yo"}'
curl https://asr.naijallm.com/v1/audio/translations \ -H "Authorization: Bearer $NAIJA_ASR_KEY" \ -F file=@voice-note.m4a \ -F language=ha \ -F target=en
Each task's section below has the same examples in Python, JavaScript and the OpenAI SDK.
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 (see browser and mobile apps). You can have up to 10 keys, for example one per project, and revoke any of them from the dashboard. Limits apply to each key separately.
Playground
Try every task in your browser before writing code: record or upload audio, type text to hear it spoken, or translate a sentence. Each result shows the matching API call, ready to copy. The playground uses its own key on your account, with the same limits as any other key.
Changelog
Everything is under /v1. We add fields and endpoints without notice, so ignore fields you don't know; anything that would break existing code will get a new version.
- 13 November 2026. Errors now include
paramandrequest_id, and every response hasX-Request-Id. Wrong methods return405. New error codes:invalid_body,invalid_text,invalid_input,invalid_authorization_header,unsupported_parameter. Translation and speech translation work between any two languages. Speech to text is more accurate on recordings over 30 seconds. Failed requests no longer count toward daily limits. Speech translation returnsattribution./v1/healthreports speech translation.
Speech to text
Transcribe audio
Send a recording and the language spoken in it; get back the text.
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"])
// Node 18+
import fs from "node:fs";
const form = new FormData();
form.append("file", new Blob([fs.readFileSync("audio.wav")]), "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,
});
if (!r.ok) throw new Error((await r.json()).error.message);
const { text } = await r.json();
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)
Request
The body is multipart/form-data:
| Field | Type | Description |
|---|---|---|
file | file, required | WAV, MP3, M4A, FLAC, OGG or WebM. Any sample rate. Up to 25 MB and 5 minutes. |
language | string, required unless model is a per-language model | ha, ig, yo or en. There is no automatic detection. |
model | string | Defaults to ncair-asr, which picks the model for language. See languages and models. |
response_format | string | json (default), text (plain text), verbose_json, srt or vtt. See subtitles. |
timestamp_granularities[] | string | segment only. Word timestamps aren't available yet. |
Set the right language. There is no automatic language detection yet, and audio sent with the wrong language returns poor text, not an error.
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: ..."
}| Field | Description |
|---|---|
text | The transcript. |
language | The language you sent, as a two-letter code. |
duration | Length of the audio in seconds. |
model | The model that transcribed it. |
attribution | The credit line to show with the transcript (see licence). |
Recordings longer than 30 seconds are split at pauses and transcribed in parts, so a 5-minute file takes around 30 to 40 seconds.
Subtitles and timestamps
Set response_format to srt or vtt to get a subtitle file you can load into a video player or editor. Lines are at most 42 characters, two lines per caption.
curl https://asr.naijallm.com/v1/audio/transcriptions \ -H "Authorization: Bearer $NAIJA_ASR_KEY" \ -F file=@interview.m4a \ -F language=yo \ -F response_format=srt > interview.srt
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["NAIJA_ASR_KEY"], base_url="https://asr.naijallm.com/v1")
with open("interview.m4a", "rb") as f:
srt = client.audio.transcriptions.create(
model="ncair-asr", file=f, language="yo", response_format="srt"
)
open("interview.srt", "w").write(srt)
1 00:00:01,040 --> 00:00:03,150 Aristotle masanin falsafa ne. 2 00:00:03,890 --> 00:00:09,970 Ya yi tunanin cewa komai ya ƙunshi cakuɗa ɗaya ...
For timestamps in JSON, use verbose_json. It returns the full text plus a segments list, the same shape as OpenAI's:
{
"task": "transcribe",
"language": "ha",
"duration": 68.6,
"text": "...",
"model": "ncair-asr-hausa",
"attribution": "Powered by NCAIR / N-ATLaS ASR models: ...",
"segments": [
{"id": 0, "start": 0.98, "end": 3.09, "text": "Aristotle masanin falsafa ne."},
{"id": 1, "start": 3.82, "end": 10.94, "text": "Ya yi tunanin cewa komai ..."}
]
}Segments follow pauses in the speech and are at most 12 seconds long. Word-level timestamps are not available yet. vtt is the same as srt with a WEBVTT header and . before the milliseconds.
Languages and models
| 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 |
ncair-asr picks the right model from language; the per-language names are for code that needs a fixed model.
Accuracy
Word error rate (lower is better) on the FLEURS test set, from the Naija LLM Benchmarks leaderboard:
| Language | WER |
|---|---|
| Hausa | 35.0% |
| Igbo | 43.8% |
| Yoruba | 57.5% |
| Nigerian English | not measured yet |
Yoruba drops to 30.6% when tone marks are ignored. Results vary with recording quality, accent and subject; review transcripts where accuracy matters. See how these models compare →
Text to speech
Generate speech
Send text and a language or voice; get back an audio file.
curl https://asr.naijallm.com/v1/audio/speech \
-H "Authorization: Bearer $NAIJA_ASR_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "Ina kwana? Yau rana ce mai kyau.", "language": "ha"}' \
-o hello.mp3
import os, requests
r = requests.post(
"https://asr.naijallm.com/v1/audio/speech",
headers={"Authorization": f"Bearer {os.environ['NAIJA_ASR_KEY']}"},
json={"input": "Ina kwana? Yau rana ce mai kyau.", "language": "ha"},
)
r.raise_for_status()
open("hello.mp3", "wb").write(r.content)
// Node 18+
import fs from "node:fs";
const r = await fetch("https://asr.naijallm.com/v1/audio/speech", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.NAIJA_ASR_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ input: "Ẹ kú àárọ̀, ṣé dáadáa ni?", language: "yo" }),
});
if (!r.ok) throw new Error((await r.json()).error.message);
fs.writeFileSync("hello.mp3", Buffer.from(await r.arrayBuffer()));
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["NAIJA_ASR_KEY"], base_url="https://asr.naijallm.com/v1")
with client.audio.speech.with_streaming_response.create(
model="naija-tts", voice="igbo_female2", input="Ụtụtụ ọma. Kedụ ka ị mere?"
) as speech:
speech.stream_to_file("hello.mp3")
Request
The body is JSON:
| Field | Type | Description |
|---|---|---|
input | string, required | The text to speak, up to 1,000 characters. |
language | string | ha, ig, yo or en. Required unless you set a voice, which implies its language. |
voice | string | A voice from the list. Defaults to the clearest voice for the language. |
model | string | naija-tts. Optional; the OpenAI SDK requires it. |
response_format | string | mp3 (default), wav, opus (in an Ogg file) or flac. |
speed | number | Only 1 for now. Other values return unsupported_parameter. |
Response
The audio file itself (Content-Type audio/mpeg, audio/wav, audio/ogg or audio/flac), with headers X-Audio-Seconds (its length), X-Voice and X-Language. Errors come back as JSON. Long text is spoken sentence by sentence; each sentence takes about 1 to 3 seconds to generate.
Write numbers and abbreviations as words in the language you want, for example huɗu rather than 4. Yoruba and Igbo are spoken without tone marks, so some words may sound flat. Listen to the output before you publish it.
Voices
Each voice speaks one language. The first one listed is the default. GET /v1/audio/voices returns the same list, and ?language=ha filters it:
{"object": "list", "data": [{"id": "hausa_male2", "language": "ha", "default": true}, ...]}| Language | Voices |
|---|---|
| Hausa | hausa_male2, hausa_female1, hausa_female2, hausa_male1, hausa_clear |
| Igbo | igbo_female2, igbo_male2, igbo_female1 |
| Yoruba | yoruba_male2, yoruba_female2, yoruba_female1, yoruba_clear |
| Nigerian English | idera, emma, jude, osagie, tayo, zainab, joke, regina, remi, umar, chinenye, onye |
The _clear voices pronounce words most clearly but sound less natural. Listen to all of them in the playground.
Translation
Translate text
Send text with its language and the language you want; get back the translation.
curl https://asr.naijallm.com/v1/translations \
-H "Authorization: Bearer $NAIJA_ASR_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Please call me when you get home.", "source": "en", "target": "yo"}'
import os, requests
r = requests.post(
"https://asr.naijallm.com/v1/translations",
headers={"Authorization": f"Bearer {os.environ['NAIJA_ASR_KEY']}"},
json={"text": "Please call me when you get home.", "source": "en", "target": "ha"},
)
r.raise_for_status()
print(r.json()["text"])
const r = await fetch("https://asr.naijallm.com/v1/translations", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.NAIJA_ASR_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ text: "Ụtụtụ ọma. Kedụ ka ị mere?", source: "ig", target: "en" }),
});
if (!r.ok) throw new Error((await r.json()).error.message);
const { text } = await r.json();
Request
The body is JSON:
| Field | Type | Description |
|---|---|---|
text | string, required | The text to translate, up to 2,000 characters. Line breaks are kept. |
source | string, required | Language of the text: ha, ig, yo or en. |
target | string, required | Language to translate into: ha, ig, yo or en. Any pair works; see languages. |
model | string | naija-translate. Optional. |
Response
{
"text": "Jọwọ pe mi nigbati o ba de ile.",
"source": "en",
"target": "yo",
"model": "naija-translate",
"characters": 33
}characters is the length of your text, which counts toward the daily character limit.
Languages and quality
| From | To |
|---|---|
English (en) | Hausa, Igbo, Yoruba |
| Hausa, Igbo, Yoruba | English (en) |
| Hausa, Igbo, Yoruba | Each other, for example Hausa to Yoruba |
Between two Nigerian languages, for example Hausa to Yoruba, the text is translated into English and then out of it, in one request. Mistakes from both steps can add up, so check these translations more carefully.
Quality on the FLORES benchmark (chrF++, 0 to 100, higher is better; above about 50 is usually understandable, below 30 needs heavy correction):
| Language | From English | Into English |
|---|---|---|
| Hausa | 50.0 | 55.8 |
| Igbo | 40.5 | 52.0 |
| Yoruba | 26.4 | 44.7 |
Check before you publish. Translating into English is more accurate than translating out of it. Hausa is the strongest of the three; Yoruba and Igbo output often leaves out tone marks. Text is translated sentence by sentence, about 1 to 2 seconds each. Have a fluent speaker review medical, legal or financial text.
Speech translation
Translate speech
Send a recording and the language you want; get back the translation as speech, or as text. Behind it, the audio is transcribed, the transcript is translated, and the translation is spoken, in one request. Any pair of Hausa, Igbo, Yoruba and English works. Between two Nigerian languages (Hausa to Yoruba, for example) the text goes through English, which adds a second or two.
# Hausa speech in, English speech out (MP3) curl https://asr.naijallm.com/v1/audio/translations \ -H "Authorization: Bearer $NAIJA_ASR_KEY" \ -F file=@voice-note.m4a \ -F language=ha \ -F target=en \ -F response_format=mp3 \ -o english.mp3
import os, requests
from urllib.parse import unquote
r = requests.post(
"https://asr.naijallm.com/v1/audio/translations",
headers={"Authorization": f"Bearer {os.environ['NAIJA_ASR_KEY']}"},
files={"file": open("voice-note.m4a", "rb")},
data={"language": "yo", "target": "en", "response_format": "mp3"},
)
r.raise_for_status()
open("english.mp3", "wb").write(r.content)
print(unquote(r.headers["X-Transcript"]), "->", unquote(r.headers["X-Translation"]))
// Node 18+. Text only (the default): the transcript and its translation as JSON
import fs from "node:fs";
const form = new FormData();
form.append("file", new Blob([fs.readFileSync("voice-note.m4a")]), "voice-note.m4a");
form.append("language", "en");
form.append("target", "ig");
const r = await fetch("https://asr.naijallm.com/v1/audio/translations", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.NAIJA_ASR_KEY}` },
body: form,
});
if (!r.ok) throw new Error((await r.json()).error.message);
const { transcript, text } = await r.json();
Request
The body is multipart/form-data, like speech to text:
| Field | Type | Description |
|---|---|---|
file | file, required | The recording: WAV, MP3, M4A, FLAC, OGG or WebM, up to 25 MB and 60 seconds. |
language | string, required | Language spoken in the recording: ha, ig, yo or en. |
target | string | Language to translate into: ha, ig, yo or en. Default en. |
response_format | string | json (default) for text only; mp3, wav, opus or flac for speech. |
voice | string | A voice of the target language. Default: that language's first voice. |
model | string | naija-speech-translate. Optional. |
Response
With response_format=json:
{
"text": "Please call me when you get home.",
"transcript": "Don Allah ka kira ni idan ka isa gida.",
"language": "ha",
"target": "en",
"duration": 3.2,
"model": "naija-speech-translate",
"attribution": "Powered by NCAIR / N-ATLaS ASR models: ..."
}With an audio format, the body is the speech. The headers X-Transcript and X-Translation carry the two texts,
URL-encoded (decode them with decodeURIComponent or Python's urllib.parse.unquote), plus X-Voice, X-Language, X-Target and X-Audio-Seconds.
If the translation is too long to speak (over 1,000 characters), you get 413 input_too_long: ask for json instead, or send a shorter clip.
What to expect. A request takes about 10 to 20 seconds. A mistake in the transcript carries into the translation, so check
transcript when a translation looks wrong. When a step is down, the 503 response names it in X-Failed-Step (speech-to-text, translation or text-to-speech);
if only the last step failed, X-Transcript and X-Translation are still sent. Nigerian Pidgin isn't supported yet. A request counts once toward the request limits, and its audio toward the daily audio minutes.
Reference
Limits
The API is free for non-commercial use. Each key has these limits. "Per day" means the last 24 hours, not a calendar day. Requests to every endpoint count toward the same request totals.
| Requests per minute | 10 |
| Requests per day | 1,000 |
| Speech to text | |
| Audio per day | 120 minutes |
| File size / length per request | 25 MB / 5 minutes |
| Text to speech | |
| Characters per day | 100,000 |
| Characters per request | 1,000 |
| Translation | |
| Characters per day | 100,000 |
| Characters per request | 2,000 |
| Speech translation | |
| Audio per day | shared with speech to text |
| Length per request | 60 seconds |
What counts. The per-minute limit counts every request, including ones that fail. The daily limits count only successful requests, so a request that fails (any 4xx or 5xx) doesn't use up your day. Characters are counted as Unicode code units, so a Yoruba letter with a tone mark can count as two.
Successful responses include X-RateLimit-Limit and X-RateLimit-Remaining for the per-minute limit. A 429 for the per-minute limit has Retry-After: 30; for a daily limit, Retry-After: 3600. Need higher limits? Email us.
Long text and audio
Every model has a limit on how much it can take in at once, and quality can drop well before that limit. So no model here ever sees a whole long request: we cut it into short pieces first, and join the results.
| Task | What we do with long input | Per request |
|---|---|---|
| Translation | Translated one sentence at a time (very long sentences are cut at about 60 words), then joined, keeping your line breaks. In our tests, quality doesn't change with sentence length. | 2,000 characters |
| Text to speech | Spoken one sentence at a time (long sentences are cut at commas, about 24 words), joined with short pauses. | 1,000 characters |
| Speech to text | Audio over 30 seconds is cut at pauses into pieces of up to 25 seconds (12 seconds when you ask for timestamps), transcribed one by one, and joined. Very short bits of sound are joined to a neighbouring piece, since models tend to invent words for them. | 25 MB, 5 minutes |
| Speech translation | As speech to text, then translation, then text to speech. | 60 seconds |
Each sentence is translated on its own, without the sentences around it. In a long document a name, a term or a pronoun can come out differently from one sentence to the next, so check long documents for consistency.
If a request is over the limit, you get 413 with code input_too_long (text) or file_too_large / audio_too_long (audio). The message gives the length you sent and the limit. Nothing is cut off silently. To translate a longer document, send it in parts, for example one or a few paragraphs per request:
import os, requests
BASE = "https://asr.naijallm.com/v1"
H = {"Authorization": f"Bearer {os.environ['NAIJA_ASR_KEY']}"}
def translate(text, source, target):
r = requests.post(f"{BASE}/translations", headers=H, json={"text": text, "source": source, "target": target}, timeout=300)
r.raise_for_status()
return r.json()["text"]
def translate_long(text, source, target, limit=2000):
parts, cur = [], ""
for para in text.split("\n"):
if cur and len(cur) + len(para) + 1 > limit:
parts.append(cur); cur = ""
cur = f"{cur}\n{para}" if cur else para # a single paragraph over the limit: split it at sentence ends
parts.append(cur)
return "\n".join(translate(p, source, target) for p in parts)Errors
Errors return a JSON body in the same format as OpenAI. code is stable, so branch on it rather than on message, which may change. param names the field at fault (or is null), and request_id identifies the request: please quote it if you contact us. Every response also has an X-Request-Id header.
{"error": {"type": "invalid_request_error", "message": "source must be ha, ig, yo or en (or hau, ibo, yor, eng); got 'fr'.",
"code": "unsupported_language", "param": "source", "request_id": "req_3f2a…"}}| Status | Code | Meaning |
|---|---|---|
| 400 | missing_text, missing_input, missing_file, missing_language, missing_source, missing_target | A required field is missing. |
| 400 | invalid_body, invalid_json, invalid_content_type, invalid_multipart, invalid_text, invalid_input | The body isn't in the expected format: JSON objects for translation and text to speech (text fields as strings), multipart form data for audio. |
| 400 | unsupported_language, same_language, language_model_mismatch | The language isn't one of ha, ig, yo, en, or doesn't fit the model. param says which field. |
| 400 | model_not_found, voice_not_found, voice_language_mismatch, unsupported_response_format, unsupported_timestamp_granularity, unsupported_parameter, empty_file | A value isn't supported. The message lists the valid ones. |
| 401 | missing_api_key, invalid_api_key, invalid_authorization_header | The key is missing, wrong or revoked, or the header isn't Authorization: Bearer nlb_…. |
| 400 | bad_request | The input was valid but couldn't be processed. The message says why. |
| 403 | account_suspended | The account can't use the API right now. |
| 404, 405 | not_found, method_not_allowed | No such endpoint, or the wrong HTTP method (the Allow header gives the right one). |
| 413 | input_too_long, file_too_large, audio_too_long | Over the size limit for that task, or (speech translation) the translation is too long to speak. See long text and audio. |
| 415 | unsupported_audio | The audio could not be decoded. |
| 422 | no_speech | Speech translation: no speech was heard in the recording. |
| 429 | rate_limit_exceeded | Over the per-minute limit. Retry after Retry-After seconds. |
| 429 | daily_limit_exceeded | Over a daily request, audio or character limit. Retry-After is 3600. |
| 429 | quota_exceeded | The key has used its total quota (type insufficient_quota). Retrying won't help; email us. |
| 500 | internal_error | Something went wrong on our side. We're alerted automatically; retry, and contact us with the request_id if it keeps happening. |
| 503 | service_unavailable | Temporarily unavailable. We're alerted automatically. Retry later; GET /v1/health shows the status of each task. |
type is one of invalid_request_error, authentication_error, permission_error, rate_limit_error, insufficient_quota, service_unavailable or server_error.
Retries and timeouts
- Retry
429,500and503, waiting longer each time (for example 2, 4, 8, 16 seconds), or as long asRetry-Aftersays. Requests change nothing on our side, so retrying is safe. - Don't retry other
4xxerrors without fixing the request: they will fail the same way. - Set a client timeout of at least 300 seconds. After a quiet period, the first request can take up to a minute or two while the models load; a 5-minute recording then takes about 30 to 40 seconds more.
import time, requests
def post_with_retry(url, tries=5, **kw):
for i in range(tries):
r = requests.post(url, timeout=300, **kw)
if r.status_code not in (429, 500, 503) or i == tries - 1:
return r
time.sleep(int(r.headers.get("Retry-After", 2 ** (i + 1))))Response headers
| Header | On | Meaning |
|---|---|---|
X-Request-Id | every response | The request's ID, also in error bodies as request_id. |
X-RateLimit-Limit, X-RateLimit-Remaining | successful requests | The per-minute limit and what's left of it. |
X-Quota-Limit, X-Quota-Remaining | keys with a total quota | The key's total requests and what's left. |
Retry-After | 429 | Seconds to wait before retrying. |
Allow | 405 | The HTTP method the endpoint takes. |
X-Audio-Seconds, X-Voice, X-Language | audio responses | Length of the audio, the voice used, and its language. |
X-Target, X-Transcript, X-Translation | speech translation audio | The target language, and the two texts (URL-encoded). |
X-Failed-Step | speech translation 503 | Which step was unavailable. |
All of these can be read from browser JavaScript.
Browser and mobile apps
The API allows requests from any web page (CORS), which is handy for prototypes. In a public app, don't ship your key: anyone can copy it from the page or the app and use your limits. Instead, call the API from your own server and have your app talk to that server. The playground works this way.
OpenAI compatibility
Point the official OpenAI SDKs at our base URL and use your Naija API key:
client = OpenAI(api_key=os.environ["NAIJA_ASR_KEY"], base_url="https://asr.naijallm.com/v1")
| Task | SDK call | Model |
|---|---|---|
| Speech to text | client.audio.transcriptions.create(...) | ncair-asr |
| Text to speech | client.audio.speech.create(...) | naija-tts |
| Translation | no SDK method; call POST /v1/translations directly | naija-translate |
| Speech translation | client.audio.translations.create(model="naija-speech-translate", file=f, extra_body={"language": "ha", "target": "en"}). Formats json or audio only. | naija-speech-translate |
Differences from OpenAI: language is required for speech to text; voices are ours (see voices); OpenAI's speech translation only goes into English, ours goes between any pair and can return speech; word-level timestamps and streaming are not available yet.
Other endpoints
GET /v1/models | The available models. Each has a task: speech-to-text, text-to-speech, translation or speech-translation. |
GET /v1/audio/voices | The text-to-speech voices; ?language=ha filters them. See voices. |
GET /v1/usage | Requests in the last 24 hours and in total, across all your keys, and your per-key rate limits. Requires a key. |
GET /v1/health | {"online", "services": {"speech-to-text", "text-to-speech", "translation", "speech-translation"}, "checked_at"}, each true or false. No key needed. |
Building with an AI coding assistant? Point it at /llms.txt, a plain-text summary of this API.
Policies
Licence and attribution
The speech-to-text models are released by NCAIR and Awarri Technologies for non-commercial use. Show this attribution wherever you use transcripts 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.
Speech from /v1/audio/speech, translations from /v1/translations and speech translations are free for non-commercial use. Speech translations start from a transcript, so show the attribution above with them too. For commercial use, email us. The hausa_clear and yoruba_clear voices are for non-commercial use only, because of their model's licence.
Models we use
The API is built on these openly released models. We thank their authors.
| Used for | Model | By | Licence |
|---|---|---|---|
| Speech to text | NCAIR ASR (Hausa, Igbo, Yoruba, Nigerian English) | NCAIR and Awarri Technologies | NCAIR model licence, non-commercial |
Translation (naija-translate) | AfriqueQwen3.5-9B-50Langs-Instruct | McGill NLP | CC BY 4.0 |
Speech (naija-tts), most voices | YarnGPT2 | saheedniyi | Apache 2.0 |
| Speech: the audio codec YarnGPT2 uses | WavTokenizer | novateur | MIT |
Speech: hausa_clear, yoruba_clear | MMS-TTS | Meta | CC BY-NC 4.0, non-commercial |
Speech translation (/v1/audio/translations) chains the speech-to-text, translation and speech models above. We may change the models behind each API model name as better ones become available; this list is kept up to date.
Privacy and data
- Your audio and text aren't kept by us. We don't save them to our database or logs. To process audio, it's uploaded to our servers at Hugging Face as a temporary file, which is deleted within an hour.
- What we log: for each request, the time, task, language, audio length, text length, status and how long it took, tied to your key. We use it for limits, usage figures and fixing problems.
- We don't train models on your data and don't share it.
- No outside AI services. Every request is handled by the models listed under models we use, on our own servers.
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, including speech that pretends to be a real person
- military or weapons purposes
- commercial products, without a licence from NCAIR / Awarri
Only send recordings and text you have the right to use (see privacy and data). Accounts that break these terms may be suspended. The service is provided as is, without warranty.