Add multilingual chat, speech-to-text, text-to-speech, and translation for Twi, Fante, Ewe and English to any web app. No API key, no build step.
Drop in a single script tag — that's it.
<script src="https://ai.cedar-pro.services/sdk/cedar-ai.js"></script>
Or import it as a module:
import CedarAI from 'https://ai.cedar-pro.services/sdk/cedar-ai.js';
Create a client and start a conversation in any Ghanaian language.
const ai = new CedarAI();
// Chat — reply in Twi
const res = await ai.chat('Good morning, how are you?', { lang: 'tw' });
console.log(res.content); // → Maakye! Wo ho te sɛn?
baseURL is https://ai.cedar-pro.services. Pass { baseURL } to point at your own deployment.Stream tokens as they arrive for a live, typewriter feel.
await ai.chat('Tell me about Ghana', {
stream: true,
onChunk: (c) => process.stdout.write(c.content),
onDone: (r) => console.log('\ndone:', r.content.length, 'chars'),
});
Speech-to-text, text-to-speech, and translation in a few calls.
// 🎤 Speech-to-text (Twi audio → text)
const { text } = await ai.asr(audioBlob, { lang: 'tw' });
// 🔊 Text-to-speech (returns a playable clip)
const speech = await ai.tts('Akwaaba', { lang: 'tw' });
speech.play();
// 🌍 Translation
const { translatedText } = await ai.translate('Welcome', {
sourceLang: 'en', targetLang: 'tw',
});
chat(input, opts)Send a message or message array. Returns { content, usage }, or streams via onChunk.
asr(audio, opts)Speech-to-text from an audio Blob/File. Returns { text, detectedLanguage }.
tts(text, opts)Text-to-speech. Returns { blob, url, play() }.
translate(text, opts)Translate text. Returns { translatedText, sourceLang, targetLang }.
batchTranslate(texts, opts)Translate an array of strings in one request.
opts: sourceLang, targetLanggetLanguages()List supported languages and their codes.
→ [{ code, name }]| Code | Language | Voice |
|---|---|---|
en | English | Live |
tw | Twi (Akan) | Live |
fat | Fante | Live |
ee | Ewe (Eʋegbe) | Live |
gaa | Ga (Gã) | Coming soon |
dag | Dagbani | Coming soon |