Cedar AI API
Zero-friction multilingual AI for Ghana. Translation, voice, and chat in Twi, Ewe, Ga, Dagbani, Fante, and English.
✓ No API key
✓ Streaming
✓ Voice ASR/TTS
✓ Translation
Endpoints
POST
https://ai.cedar-pro.services/v1/chat/completions
POST
https://ai.cedar-pro.services/api/asr
POST
https://ai.cedar-pro.services/api/translate
POST
https://ai.cedar-pro.services/api/tts
6
Languages
4
API Endpoints
8
Use Cases
0
Auth Required
Models
| Model | Description |
|---|---|
cedar-ai | Free general-purpose multilingual model. Smart, fast, supports all Ghanaian languages. |
cedar-ai-pro | Premium model with higher accuracy. Best for translation and complex queries. |
cedar-ai-multilingual | Optimized for multilingual conversations. Handles code-switching (mixing languages). |
cedar-ai-translate | Dedicated translation-optimized model. Best for English to Ghanaian language translation. |
Supported Languages
| Code | Language | Region | Speakers |
|---|---|---|---|
tw | Twi (Akan) | Ashanti, Eastern, Central | ≈ 9M |
fat | Fante | Central, Western | ≈ 3M |
ee | Ewe (Eʋegbe) | Volta | ≈ 4M |
gaa | Ga (Ģ) | Greater Accra | ≈ 1M |
dag | Dagbani (Dagbanli) | Northern | ≈ 3M |
en | English | National | All |
Limits
| Limit | Value |
|---|---|
| Max tokens per response | 4096 (set max_tokens to control) |
| Rate limit | 60 requests / minute per IP (HTTP 429 if exceeded) |
| Max request size | 16K chars per message · 400K chars total |
| Authentication | None required |
| Max audio size (ASR) | 50 MB |
| Max text length (Translation) | ~400 tokens per request (longer text is truncated) |
Request Parameters
| Param | Type | Default | Required | Description |
|---|---|---|---|---|
model | string | — | Yes | One of: cedar-ai, cedar-ai-pro, cedar-ai-multilingual, cedar-ai-translate |
messages | array | — | Yes | Array of {role, content} objects |
temperature | number | 1.0 | No | 0–2. Lower = more precise |
max_tokens | number | 4096 | No | Max response length |
stream | bool | false | No | SSE streaming |
lang | string | en | No | Response language: en, tw, fat, ee, gaa, dag |
Language Parameter
Set lang in the request body to make Cedar AI respond in a specific Ghanaian language. The AI will reply in that language naturally.
| Lang Code | Behavior |
|---|---|
en | Always reply in English |
tw | Reply in Twi (Akan) |
fat | Reply in Fante |
ee | Reply in Ewe (Eʋegbe) |
gaa | Reply in Ga (Ģ) |
dag | Reply in Dagbani (Dagbanli) |
Message Roles
| Role | Purpose |
|---|---|
system | Sets assistant behavior, constraints, and language preference |
user | Your questions or instructions |
assistant | Previous AI replies for multi-turn context |
Response Format
{
// standard chat completion response
"model": "cedar-ai",
"choices": [{
"message": { "content": "Akwaaba! Me din ne Cedar AI." },
"finish_reason": "stop"
}],
"usage": { "total_tokens": 52 }
}
Error Codes
| Code | Cause |
|---|---|
400 | Missing or unknown model |
413 | Message too long (max 16K chars per message, 400K total) |
429 | Rate limited — please slow down |
500 | Server error — try again |
502 | Upstream unavailable — try again shortly |
Use Cases
Every example below was tested live against the API. Pick a category, copy the code, and run it.
Translation
Voice & Speech
Multilingual Chat
Agriculture
Healthcare
Education
Finance
Tourism
1
Tested
English → Twi Translation
curl
Translate English to Twi (Akan) using the Cedar AI LLM. Set
lang to tw and ask for translation.curl https://ai.cedar-pro.services/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cedar-ai-translate",
"lang": "tw",
"messages": [
{"role": "system", "content": "Translate the following English text to Twi (Akan). Only respond with the translation."},
{"role": "user", "content": "Good morning, how are you today?"}
]
}'import requests
resp = requests.post(
"https://ai.cedar-pro.services/v1/chat/completions",
json={
"model": "cedar-ai-translate",
"lang": "tw",
"messages": [
{"role": "system", "content": "Translate the following English text to Twi (Akan). Only respond with the translation."},
{"role": "user", "content": "Good morning, how are you today?"}
]
},
)
print(resp.json()["choices"][0]["message"]["content"])const resp = await fetch("https://ai.cedar-pro.services/v1/chat/completions", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "cedar-ai-translate",
lang: "tw",
messages: [
{ role: "system", content: "Translate the following English text to Twi (Akan). Only respond with the translation." },
{ role: "user", content: "Good morning, how are you today?" }
],
}),
});
const data = await resp.json();
console.log(data.choices[0].message.content);from openai import OpenAI
client = OpenAI(
base_url="https://ai.cedar-pro.services/v1",
api_key="x",
)
resp = client.chat.completions.create(
model="cedar-ai-translate",
extra_body={"lang": "tw"},
messages=[
{"role": "system", "content": "Translate the following English text to Twi (Akan). Only respond with the translation."},
{"role": "user", "content": "Good morning, how are you today?"}
],
)
print(resp.choices[0].message.content)
2
Tested
Twi → English Translation
curl
Translate Twi to English. Useful when someone speaks to you in Twi and you need the English meaning.
curl https://ai.cedar-pro.services/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cedar-ai",
"messages": [
{"role": "system", "content": "Translate the following Twi to English. Only respond with the translation."},
{"role": "user", "content": "Me pɛ sɛ me kɔ sukuu no mu."}
]
}'import requests
resp = requests.post(
"https://ai.cedar-pro.services/v1/chat/completions",
json={
"model": "cedar-ai",
"messages": [
{"role": "system", "content": "Translate the following Twi to English. Only respond with the translation."},
{"role": "user", "content": "Me pɛ sɛ me kɔ sukuu no mu."}
]
},
)
print(resp.json()["choices"][0]["message"]["content"])const resp = await fetch("https://ai.cedar-pro.services/v1/chat/completions", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "cedar-ai",
messages: [
{ role: "system", content: "Translate the following Twi to English. Only respond with the translation." },
{ role: "user", content: "Me pɛ sɛ me kɔ sukuu no mu." }
],
}),
});
const data = await resp.json();
console.log(data.choices[0].message.content);
3
Tested
English → Ewe Translation
curl
Translate English to Ewe (Eʋegbe), the language of the Volta Region. Use
lang: ee.curl https://ai.cedar-pro.services/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cedar-ai",
"lang": "ee",
"messages": [
{"role": "system", "content": "Translate the following English text to Ewe (Eʋegbe). Only respond with the translation."},
{"role": "user", "content": "Welcome to our village celebration!"}
]
}'import requests
resp = requests.post(
"https://ai.cedar-pro.services/v1/chat/completions",
json={
"model": "cedar-ai",
"lang": "ee",
"messages": [
{"role": "system", "content": "Translate the following English text to Ewe (Eʋegbe). Only respond with the translation."},
{"role": "user", "content": "Welcome to our village celebration!"}
]
},
)
print(resp.json()["choices"][0]["message"]["content"])const resp = await fetch("https://ai.cedar-pro.services/v1/chat/completions", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "cedar-ai",
lang: "ee",
messages: [
{ role: "system", content: "Translate the following English text to Ewe (Eʋegbe). Only respond with the translation." },
{ role: "user", content: "Welcome to our village celebration!" }
],
}),
});
const data = await resp.json();
console.log(data.choices[0].message.content);
4
Tested
Speech-to-Text (ASR) — Record Voice
Python
Upload an audio file (speech in Twi, Ewe, Ga, or English) and get back transcribed text. Uses Whisper ASR.
curl https://ai.cedar-pro.services/api/asr \
-F "audio=@recording.webm" \
-F "language=tw"import requests
resp = requests.post(
"https://ai.cedar-pro.services/api/asr",
files={"audio": open("recording.webm", "rb")},
data={"language": "tw"},
)
print(resp.json()["text"])const form = new FormData();
form.append("audio", audioBlob, "recording.webm");
form.append("language", "tw");
const resp = await fetch("https://ai.cedar-pro.services/api/asr", {
method: "POST",
body: form,
});
const data = await resp.json();
console.log(data.text);
5
Tested
Text-to-Speech (TTS) — Hear Responses
curl
Convert any text into spoken audio. Cedar AI will read the text aloud in a natural voice. Saves an MP3 file.
curl https://ai.cedar-pro.services/api/tts \
-H "Content-Type: application/json" \
-d '{"text": "Akwaaba! Mema wo akwaaba.", "language": "tw"}' \
--output speech.mp3import requests
resp = requests.post(
"https://ai.cedar-pro.services/api/tts",
json={"text": "Akwaaba! Mema wo akwaaba.", "language": "tw"},
)
with open("speech.mp3", "wb") as f:
f.write(resp.content)const resp = await fetch("https://ai.cedar-pro.services/api/tts", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
text: "Akwaaba! Mema wo akwaaba.",
language: "tw",
}),
});
const blob = await resp.blob();
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url; a.download = "speech.mp3"; a.click();
6
Tested
Chat in Twi — Full Conversation
curl
Have a full conversation in Twi. Set
lang: tw and Cedar AI will respond in Twi naturally. Great for building Twi-language chatbots.curl https://ai.cedar-pro.services/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cedar-ai-multilingual",
"lang": "tw",
"messages": [
{"role": "system", "content": "Respond in Twi (Akan) only."},
{"role": "user", "content": "Hello! What is your name?"}
]
}'import requests
resp = requests.post(
"https://ai.cedar-pro.services/v1/chat/completions",
json={
"model": "cedar-ai-multilingual",
"lang": "tw",
"messages": [
{"role": "system", "content": "Respond in Twi (Akan) only."},
{"role": "user", "content": "Hello! What is your name?"}
]
},
)
print(resp.json()["choices"][0]["message"]["content"])const resp = await fetch("https://ai.cedar-pro.services/v1/chat/completions", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "cedar-ai-multilingual",
lang: "tw",
messages: [
{ role: "system", content: "Respond in Twi (Akan) only." },
{ role: "user", content: "Hello! What is your name?" }
],
}),
});
const data = await resp.json();
console.log(data.choices[0].message.content);from openai import OpenAI
client = OpenAI(
base_url="https://ai.cedar-pro.services/v1",
api_key="x",
)
resp = client.chat.completions.create(
model="cedar-ai-multilingual",
extra_body={"lang": "tw"},
messages=[
{"role": "system", "content": "Respond in Twi (Akan) only."},
{"role": "user", "content": "Hello! What is your name?"}
],
)
print(resp.choices[0].message.content)
7
Tested
Farming Advice — Crop Disease in Twi
curl
A farmer in Ashanti can ask about crop diseases in Twi and get advice. Cedar AI understands the local context.
curl https://ai.cedar-pro.services/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cedar-ai",
"lang": "tw",
"messages": [
{"role": "user", "content": "Me kokoo dua no ahaban redwo. Dʍn na meyʍ?"}
]
}'import requests
resp = requests.post(
"https://ai.cedar-pro.services/v1/chat/completions",
json={
"model": "cedar-ai",
"lang": "tw",
"messages": [
{"role": "user", "content": "Me kokoo dua no ahaban redwo. Dʍn na meyʍ?"}
]
},
)
print(resp.json()["choices"][0]["message"]["content"])
8
Tested
Health Information — Malaria Symptoms in Ewe
curl
A patient in Volta Region can ask about malaria symptoms in Ewe. Cedar AI provides health information in their mother tongue.
curl https://ai.cedar-pro.services/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cedar-ai",
"lang": "ee",
"messages": [
{"role": "user", "content": "Nye dɔléle dɔ asi le yem. Azɔ?"}
]
}'import requests
resp = requests.post(
"https://ai.cedar-pro.services/v1/chat/completions",
json={
"model": "cedar-ai",
"lang": "ee",
"messages": [
{"role": "user", "content": "Nye dɔléle dɔ asi le yem. Azɔ?"}
]
},
)
print(resp.json()["choices"][0]["message"]["content"])
9
Tested
Math Tutoring in Ga
curl
Students in Greater Accra can get math tutoring in Ga. Cedar AI explains concepts in their first language.
curl https://ai.cedar-pro.services/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cedar-ai",
"lang": "gaa",
"messages": [
{"role": "user", "content": "Minawo lɛ nɔ, 2+2 ya?"}
]
}'import requests
resp = requests.post(
"https://ai.cedar-pro.services/v1/chat/completions",
json={
"model": "cedar-ai",
"lang": "gaa",
"messages": [
{"role": "user", "content": "Minawo lɛ nɔ, 2+2 ya?"}
]
},
)
print(resp.json()["choices"][0]["message"]["content"])
10
Tested
Mobile Money Help in Dagbani
curl
Users in Northern Region can ask about mobile money (MoMo) in Dagbani. Cedar AI helps with financial literacy.
curl https://ai.cedar-pro.services/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cedar-ai",
"lang": "dag",
"messages": [
{"role": "user", "content": "N yi bɔri ni n tum liɣiri mobile money zuɣu, bo n-nyɛ dini?"}
]
}'import requests
resp = requests.post(
"https://ai.cedar-pro.services/v1/chat/completions",
json={
"model": "cedar-ai",
"lang": "dag",
"messages": [
{"role": "user", "content": "N yi bɔri ni n tum liɣiri mobile money zuɣu, bo n-nyɛ dini?"}
]
},
)
print(resp.json()["choices"][0]["message"]["content"])
11
Tested
Tourist Guide — Kakum Park in Fante
curl
A visitor to Central Region can ask about Kakum National Park in Fante. Cedar AI provides tourism info.
curl https://ai.cedar-pro.services/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cedar-ai",
"lang": "fat",
"messages": [
{"role": "user", "content": "Kakum National Park no ho nsʍm ka kyerew me?"}
]
}'import requests
resp = requests.post(
"https://ai.cedar-pro.services/v1/chat/completions",
json={
"model": "cedar-ai",
"lang": "fat",
"messages": [
{"role": "user", "content": "Kakum National Park no ho nsʍm ka kyerew me?"}
]
},
)
print(resp.json()["choices"][0]["message"]["content"])LLM Chat API
POSThttps://ai.cedar-pro.services/v1/chat/completions
OpenAI-compatible chat completions. No API key required. Supports streaming, multilingual responses, and all standard parameters.
Speech-to-Text API
POSThttps://ai.cedar-pro.services/api/asr
Upload audio files (webm, wav, mp3, m4a) and get transcribed text. Supports Twi, Ewe, Ga, Dagbani, and English.
| Parameter | Type | Required | Description |
|---|---|---|---|
audio | file | Yes | Audio file (webm, wav, mp3, m4a). Max 50MB. |
language | string | No | Hint: en, tw, fat, ee, gaa, dag |
Translation API
POSThttps://ai.cedar-pro.services/api/translate
Translate text between English and any Ghanaian language using NLLB-200.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to translate |
source_lang | string | No | Source language code (default: en) |
target_lang | string | No | Target language code (default: tw) |
Text-to-Speech API
POSThttps://ai.cedar-pro.services/api/tts
Convert text to natural-sounding speech audio (MP3 format).
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to convert to speech |
language | string | No | Language code (default: en) |
Note All languages are currently voiced with a clear multilingual speech engine that reads Ghanaian-language text phonetically. Native-accent voices for Twi, Ewe, Ga and Dagbani are on the roadmap.
cURL
curl https://ai.cedar-pro.services/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "cedar-ai", "lang": "tw", "messages": [{"role": "user", "content": "Hello!"}] }'
Python
import requests resp = requests.post( "https://ai.cedar-pro.services/v1/chat/completions", json={"model": "cedar-ai", "lang": "tw", "messages": [{"role": "user", "content": "Hello!"}]}, ) print(resp.json()["choices"][0]["message"]["content"])
JavaScript (Fetch)
const resp = await fetch("https://ai.cedar-pro.services/v1/chat/completions", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ model: "cedar-ai", lang: "tw", messages: [{ role: "user", content: "Hello!" }], }), }); const data = await resp.json(); console.log(data.choices[0].message.content);
OpenAI Python SDK
from openai import OpenAI client = OpenAI( base_url="https://ai.cedar-pro.services/v1", api_key="x", ) resp = client.chat.completions.create( model="cedar-ai", extra_body={"lang": "tw"}, messages=[{"role": "user", "content": "Hello!"}], ) print(resp.choices[0].message.content)
Tip Use the OpenAI Python SDK — just set
base_url to our endpoint and anything as api_key. Add extra_body={"lang": "tw"} to get responses in Ghanaian languages.