Abena AI API

Add African-language Text-to-Speech (speech from text) and Speech Recognition (text from speech) to any app. It works over plain HTTP, so you can use it from a website, a phone app, a server, or even just a terminal — no special library required.

The base URL for every endpoint is:

https://abena.mobobi.com/playground/api/v1

New here? Start free.

You can try the API with no account and no API key. Speech Recognition includes 10 free transcriptions; TTS includes 20 free character-metered credits. See Free Tier below.

Free Tier (No Sign-Up)

You can try every endpoint without creating an account. Just leave out the API key.

  • Speech Recognition API: 10 free transcriptions as a guest or 15 with a standard API key.
  • The recognition Playground is separate: 10 guest or 20 signed-in transcriptions.
  • The Speech Playground currently offers a separate 20-credit lifetime trial, with no monthly refill. Visitors on the same network may share this allowance. After the trial, add prepaid credits or use Abena AI free on Android.
  • Free REST requests without an API key are limited to 20 per minute and 100 per hour per IP address, in addition to credit limits. On HTTP 429, wait for Retry-After before retrying. These rate windows do not replenish credits.
  • Download the audio returned with your request. Dashboard audio copies are optional: saving pauses when the shared 5 GiB audio cap or 5 GiB free-disk reserve is reached. Normal API synthesis/transcription results still return. Older save-to-URL requests may return HTTP 503 without charging a credit.
  • TTS API: 20 free credits without a key, or 20 for a standard account. Free and purchased TTS credits use the same per-character rates: Lite 0.02, Medium 0.04, High 0.06. Individual grants retain their configured limits.
  • Perfect for testing, demos, and learning how the API works.
  • Ready to build? Create a free account for your own API key — the dashboard lets you track usage and manage your keys.

The first request to a voice can take longer

A voice may need to load before it can speak. Response time depends on text length, voice quality and current demand. On a busy response, wait for Retry-After before retrying.

Use purchased speech credits

New credit purchases are valid for 12 months after payment. Existing purchases and earlier checkouts keep their original no-expiry terms. Free allowance is used first, then purchased credits expiring soonest. See each remaining amount and expiry date on your credit page; reminders are sent around 30 and 7 days before expiry. Returned credits from a failed request retain their deadline or receive 30 days to use them, whichever is later. A new top-up does not reset older expiry dates.

Send your usual text and voice with your API key. TTS uses your free allowance first, then automatically uses your purchased balance for the remaining cost. No activation header is needed, and your payment method is never charged automatically. See rates or add credits.

Both balances use the same rates per normalized character: Lite 0.02, Medium 0.04 and High 0.06 credits. Letters, spaces and punctuation count. The 500-character API and 280-character Playground limits still apply. Failed generation returns reserved credits; insufficient combined credit does not start generation.

For authenticated requests, send a unique Idempotency-Key (1–128 letters, digits, dots, underscores, colons or hyphens) for each new generation. Reuse that key and identical input on retries, even if the first attempt used free credits. Follow Retry-After for pending requests. A returned billing_quote can also be reused with the same input. Do not use a new key for a request whose outcome is still unknown.

Responses report free and purchased usage separately. HTTP 402 means there is not enough combined credit. The older explicit quote flow using X-Abena-Use-Credits: confirmed remains supported for clients that deliberately approve a purchased-only request.

A confirmed prepaid speech request takes priority over waiting free speech requests. Running audio is not interrupted. You can also use prepaid credits in Web Studio. ASR remains a separate free service with usage limits.

Your First Request

Copy this into a terminal. It turns text into speech using the Ghanaian-accent English voice akua_eng and saves the result to speech.wav. No API key needed.

curl -s -X POST https://abena.mobobi.com/playground/api/v1/tts/synthesize/ \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello! Welcome to Abena AI.", "voice": "akua_eng"}' \
  | python3 -c "import sys,json,base64; open('speech.wav','wb').write(base64.b64decode(json.load(sys.stdin)['audio_base64'])); print('Saved speech.wav')"

Now open speech.wav and listen. That's it — you've used the API.

Text-to-Speech

Send some text and a voice; get back audio. The audio is returned as Base64-encoded WAV inside a JSON response (this makes it easy to use from any language and from the browser).

Endpoint

POST https://abena.mobobi.com/playground/api/v1/tts/synthesize/

Request body (JSON)

FieldRequiredDescription
textYesThe text to speak. Up to 500 characters.
voiceYesA voice ID, e.g. akua_eng, chioma_eng, chioma_whispering_eng, abena_twi_high. See TTS Voices.
speedNoSpeaking speed. 1.0 is normal, 0.5 is slowest, 2.0 is fastest. Default 1.0.

Response (JSON)

{
  "status": "success",
  "voice": "abena_twi_high",
  "audio_base64": "UklGRiQ...",   // the WAV file, Base64-encoded
  "duration_seconds": 2.91,
  "mime_type": "audio/wav",
  "quality": "high"
}

abena_twi_high always uses the High voice. If the voice service is temporarily at capacity, retry the request after the interval returned by the API.

Example: curl

curl -X POST https://abena.mobobi.com/playground/api/v1/tts/synthesize/ \
  -H "Content-Type: application/json" \
  -d '{"text": "Akwaaba, wo ho te sen?", "voice": "abena_twi_high", "speed": 1.0}'

Twi tip

Choose abena_twi_medium for the recommended natural Twi voice. Abena, Ama and Yaa each offer Medium and High quality. Medium balances natural speech and resource use; High is also available when you need it. abena_twi_lite remains a lightweight option for API and speech-playground use, but is not used for new Studio podcasts or drama.

Write normal Akan Twi, including ɛ and ɔ. Send numbers, acronyms and currency symbols as written; do not replace letters or pre-expand numbers for these three natural voices. Voice identity and requested quality stay unchanged during capacity retries.

Speech Recognition

Send an audio file; get back the text. Upload the file as a normal form field named audio_file (this is multipart/form-data, the same thing a web form uses to upload a file).

Endpoint

POST https://abena.mobobi.com/playground/api/v1/asr/transcribe/

Form fields

FieldRequiredDescription
audio_fileYesYour audio file, up to 25 MB. Twi and Pidgin High recordings may be up to 60 seconds (or the current configured server limit). English and Ghanaian Pidgin Lite recordings may be up to 120 seconds. Longer accepted recordings are split internally without dropping the remaining audio.
languageNoUse twi-en for Twi, English, or Twi-English code-switching (recommended and selected by default). Other options are twi-only, en, gpe (Ghanaian Pidgin Lite), gpe-high (Ghanaian Pidgin High), and pcm (Nigerian Pidgin High). See ASR Languages.
reference_textNoIf you know the correct text, include it to also get accuracy/WER scores.

Supported audio formats: WAV/PCM, MP3, M4A/AAC, FLAC, OGG, and other common formats that FFmpeg can decode. For the most predictable batch evaluations, use mono 16-bit PCM WAV at 16 kHz; files already in that format are used directly. Other valid files are normalized before transcription.

Response (JSON)

{
  "text": "Mepɛ sɛ mede sika kɔ ma Kwame",
  "transcription": "Mepɛ sɛ mede sika kɔ ma Kwame",
  "language": "twi-en",
  "duration_seconds": 3.2,
  "credits_remaining": 9,
  "credit_limit": 10
}

Example: curl

curl -X POST https://abena.mobobi.com/playground/api/v1/asr/transcribe/ \
  -F "audio_file=@recording.wav" \
  -F "language=twi-en"

Which Twi mode should I use?

Use twi-en for Twi, English, and Twi-English code-switching. Choose twi-only only when the entire recording is spoken in Twi; English words may be missed. A twi-only response includes a short reminder.

Ghanaian and Nigerian Pidgin

Choose gpe-high or pcm for High recognition, including English code-switching. Both use the same recognition model and shared capacity. Existing gpe requests keep using Ghanaian Pidgin Lite. Nigerian Pidgin has High only.

High modes share the existing ASR credits and queue limits; changing language does not grant extra credits. Busy responses include a retry hint. No training or model files are exposed by the API.

TTS Voices

Use the preferred voice ID below in your request. You can always fetch the live list from GET /playground/api/v1/tts/voices.json. Older short IDs and playground model IDs like akua, en-ng-chioma, en-ng-chioma-whispering, swahili, and nigerian_pidgin_s are still accepted as aliases. For Twi, choose an explicit Medium, High or Lite ID from the table. Write natural Twi, including ɛ, ɔ, numbers and acronyms; do not replace letters or supply pronunciation symbols.

Voice IDNameLanguageCountryGender
abena_twi_mediumGhanaAbena Medium · RecommendedTwi (Akan)GhanaFemale
abena_twi_highGhanaAbena HighTwi (Akan)GhanaFemale
ama_twi_mediumGhanaAma MediumTwi (Akan)GhanaFemale
ama_twi_highGhanaAma HighTwi (Akan)GhanaFemale
yaa_twi_mediumGhanaYaa MediumTwi (Akan)GhanaFemale
yaa_twi_highGhanaYaa HighTwi (Akan)GhanaFemale
abena_twi_liteGhanaAbena LiteTwi (Akan, lighter voice)GhanaFemale
kofi_twi_mediumGhanaKofi MediumTwi (Akan)GhanaMale
kofi_twi_highGhanaKofi HighTwi (Akan)GhanaMale
kobby_gpe_liteGhanaKobby Lite · FastGhanaian Pidgin EnglishGhanaMale
kobby_gpe_mediumGhanaKobby MediumGhanaian Pidgin EnglishGhanaMale
kobby_gpe_highGhanaKobby HighGhanaian Pidgin EnglishGhanaMale
akua_engGhanaAkua Lite · FastEnglish (Ghanaian accent)GhanaFemale
kwabena_engGhanaKwabena Lite · FastEnglish (Ghanaian accent)GhanaMale
akua_eng_mediumAkua MediumEnglish (Ghanaian accent)GhanaFemale
akua_eng_highAkua HighEnglish (Ghanaian accent)GhanaFemale
kwabena_eng_mediumKwabena MediumEnglish (Ghanaian accent)GhanaMale
kwabena_eng_highKwabena HighEnglish (Ghanaian accent)GhanaMale
chioma_engChiomaEnglish (Nigerian accent, energetic)NigeriaFemale
chioma_whispering_engChiomaEnglish (Nigerian accent, whispering)NigeriaFemale
mawuli_eweMawuliEweGhanaMale
james_pcm_liteJames Lite · FastNigerian Pidgin EnglishNigeriaMale
james_pcm_mediumJames MediumNigerian Pidgin EnglishNigeriaMale
james_pcm_highJames HighNigerian Pidgin EnglishNigeriaMale
amani_swhAmaniSwahiliKenyaFemale
abubakar_hauAbubakarHausaNigeriaMale
folami_yorFolamiYorubaNigeriaFemale

Lite · Fast identifies the existing fast voices. The display names have changed; API voice IDs and aliases are unchanged.

Kofi is the male Akan Twi voice: choose kofi_twi_medium for balanced quality or kofi_twi_high for highest quality. Kofi has no Lite option. Send normal Twi text with ɛ and ɔ; the server prepares it for speech internally without changing your displayed text. Select through voice. Requested tiers are never silently changed; on HTTP 503, wait for Retry-After before retrying.

Ghana English offers Akua (female) and Kwabena (male) in three tiers. Use akua_eng or kwabena_eng for Lite · Fast, akua_eng_medium or kwabena_eng_medium for balanced quality, and akua_eng_high or kwabena_eng_high for highest quality. Select the tier through voice, not a separate quality field. Historical aliases gh-eng-accent-medium_v3 and gh-eng-accent-male-medium_v3 still select the original Lite voices. Requested tiers are never silently downgraded; on HTTP 503, wait for Retry-After before retrying.

Ghana Pidgin has three tiers: kobby_gpe_lite is the existing lightweight voice, kobby_gpe_medium is the compressed neural voice, and kobby_gpe_high is the full-precision neural voice. The legacy kobby_gpe, kobby, and gpe-medium_v1 IDs remain aliases for Lite. Responses and new inference logs use the explicit tier ID. A requested tier is never silently downgraded; on HTTP 503, wait for Retry-After before retrying.

Nigerian Pidgin also has three tiers: james_pcm_lite is the existing lightweight voice, james_pcm_medium is the conservatively compressed neural voice, and james_pcm_high is the full-precision neural voice. The older james_pcm, james, nigerian_pidgin_p, and nigerian_pidgin_s IDs still select Lite. Select the tier through voice, not a separate quality field. Responses and new logs identify the actual tier; historical records stay unchanged. No silent downgrade is used. Write natural Nigerian Pidgin; the neural voices normalize symbols such as ₦ to naira.

ASR Languages

Use the language code below for transcription. You can also fetch the live list from GET /playground/api/v1/asr/voices.json.

CodeLanguageCountry
twi-enGhanaAkan Twi + English (Recommended)Ghana
twi-onlyGhanaAkan Twi (No English)Ghana
enGhanaEnglish (Ghanaian accent)Ghana
gpeGhanaGhanaian Pidgin English · LiteGhana
gpe-highGhanaGhanaian Pidgin English · HighGhana
pcmNigerian Pidgin English · HighNigeria

Errors & Limits

Every error returns JSON with a helpful message (TTS) or error (ASR) field. Common status codes:

StatusMeaningWhat to do
200SuccessUse the result.
400Bad requestCheck your fields (e.g. missing text, unknown voice, speed out of range).
401Authentication requiredCheck the API key. If guest TTS returns reason: free_allowance_exhausted, follow the credit or free-app links. Paid quotes require an active API key.
402Credits or confirmation requiredFor TTS, inspect the JSON error before retrying. If out of credits, top up or use the free app. Buying credits does not extend ASR allowances.
413Too largeShorten the text (TTS, 500 chars) or use an audio file no larger than 25 MB.
429Too many requestsSlow down and retry in a moment.
500Server issueRetry shortly. If it persists, contact support.
503At capacityWait for the Retry-After interval, then retry the same request.

Try It Live

This runs right here in your browser, using the free tier (no key). Type something, pick a voice, and press the button. Remember: the first time you use a voice it may take ~10–15 seconds to warm up.

Use From Any Language

The API is just HTTP + JSON, so it works everywhere. Here are the most common ways to call Text-to-Speech and Speech Recognition.

JavaScript (browser or Node.js)

const res = await fetch(
  "https://abena.mobobi.com/playground/api/v1/tts/synthesize/",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ text: "Hello!", voice: "akua_eng" })
  }
);
const data = await res.json();
// data.audio_base64 is a Base64 WAV you can play or save
new Audio("data:audio/wav;base64," + data.audio_base64).play();

Python

Uses Python's built-in HTTP client, so there is no extra package to install.

import base64, json
from urllib.request import Request, urlopen

payload = json.dumps({"text": "Hello!", "voice": "akua_eng"}).encode("utf-8")
req = Request(
    "https://abena.mobobi.com/playground/api/v1/tts/synthesize/",
    data=payload,
    headers={"Content-Type": "application/json", "Accept": "application/json"},
    method="POST",
)
with urlopen(req, timeout=120) as res:
    data = json.loads(res.read().decode("utf-8"))

with open("speech.wav", "wb") as f:
    f.write(base64.b64decode(data["audio_base64"]))
print("Saved speech.wav")

Speech Recognition (Python)

import json, mimetypes, uuid
from pathlib import Path
from urllib.request import Request, urlopen

audio_path = Path("recording.wav")
boundary = "----abena-" + uuid.uuid4().hex
audio_bytes = audio_path.read_bytes()
content_type = mimetypes.guess_type(audio_path.name)[0] or "application/octet-stream"

body = (
    f"--{boundary}\r\n"
    'Content-Disposition: form-data; name="language"\r\n\r\n'
    "twi-en\r\n"
    f"--{boundary}\r\n"
    f'Content-Disposition: form-data; name="audio_file"; filename="{audio_path.name}"\r\n'
    f"Content-Type: {content_type}\r\n\r\n"
).encode("utf-8") + audio_bytes + f"\r\n--{boundary}--\r\n".encode("utf-8")

req = Request(
    "https://abena.mobobi.com/playground/api/v1/asr/transcribe/",
    data=body,
    headers={
        "Content-Type": f"multipart/form-data; boundary={boundary}",
        "Accept": "application/json",
    },
    method="POST",
)
with urlopen(req, timeout=120) as res:
    data = json.loads(res.read().decode("utf-8"))
print(data["text"])

Example App

Here is a complete, working web page. Save it as index.html and open it in any browser — no installation, no build step, no API key. It's the same idea as the live demo above.

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Abena AI — Text to Speech</title>
</head>
<body style="font-family: sans-serif; max-width: 600px; margin: 40px auto;">
  <h1>Text to Speech</h1>

  <textarea id="text" rows="3" style="width:100%">Akwaaba! Welcome to Abena AI.</textarea>

  <select id="voice">
    <option value="akua_eng">Akua Lite · Fast (English, Ghana)</option>
    <option value="chioma_eng">Chioma energetic (English, Nigeria)</option>
    <option value="chioma_whispering_eng">Chioma whispering (English, Nigeria)</option>
    <option value="abena_twi_medium">Abena Medium — Recommended (Twi)</option>
    <option value="abena_twi_high">Abena High (Twi)</option>
    <option value="ama_twi_medium">Ama Medium (Twi)</option>
    <option value="ama_twi_high">Ama High (Twi)</option>
    <option value="yaa_twi_medium">Yaa Medium (Twi)</option>
    <option value="yaa_twi_high">Yaa High (Twi)</option>
    <option value="abena_twi_lite">Abena Lite (Twi)</option>
    <option value="kobby_gpe_lite">Kobby Lite · Fast (Ghanaian Pidgin)</option>
    <option value="kobby_gpe_medium">Kobby Medium (Ghanaian Pidgin)</option>
    <option value="kobby_gpe_high">Kobby High (Ghanaian Pidgin)</option>
    <option value="james_pcm_lite">James Lite · Fast (Nigerian Pidgin)</option>
    <option value="james_pcm_medium">James Medium (Nigerian Pidgin)</option>
    <option value="james_pcm_high">James High (Nigerian Pidgin)</option>
  </select>

  <button onclick="speak()">Speak</button>
  <p id="status"></p>
  <audio id="player" controls></audio>

  <script>
    const API = "https://abena.mobobi.com/playground/api/v1/tts/synthesize/";

    async function speak() {
      const status = document.getElementById("status");
      status.textContent = "Generating… (first use of a voice can take ~15s)";

      const res = await fetch(API, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
          text: document.getElementById("text").value,
          voice: document.getElementById("voice").value
        })
      });

      const data = await res.json();
      if (data.status === "success") {
        document.getElementById("player").src =
          "data:audio/wav;base64," + data.audio_base64;
        document.getElementById("player").play();
        status.textContent = "Done (" + data.duration_seconds + "s)";
      } else {
        status.textContent = "Error: " + (data.message || "try again");
      }
    }
  </script>
</body>
</html>

Want the full source plus more examples (Python, Node.js)? See abena-ai-api on GitHub.

API Keys (Optional)

You do not need an API key for the free tier examples above. Just send a request and it works.

When you are ready to build beyond the no-account allowance, create a free account from your dashboard and include your key in one of these ways:

# Option 1 (recommended): Authorization header
Authorization: Bearer YOUR_API_KEY

# Option 2: X-API-Key header
X-API-Key: YOUR_API_KEY