POST Translation
Translates text from one language to another — Bambara ↔ French / English and major international languages — with automatic source-language detection.
POST/v1/translations
Body JSON. Required permission: mt.
Translates text from one language to another — Bambara ↔ French / English and major international languages — with automatic source-language detection.
Body JSON. Required permission: mt.
| Name | Type | Description |
|---|---|---|
textrequired | string | The text to translate (5,000 characters max). |
targetoption | string | Target language (see Languages). Default bam_Latn. |
sourceoption | string | Source language. Absent or auto = automatic detection. |
modeloption | string | Bambara translation model version: bambara-1.75 (default), bambara-1.7 or bambara-1.6. Any other value is rejected (422 invalid_model). |
| Field | Type | Description |
|---|---|---|
text | string | The translated text. |
source | string | Detected source language (useful if auto). |
target | string | Target language. |
translations | array | List of translations {text, source, target}. |
Billed per character of source text — same rate whatever model.
curl https://api.kooma.ai/v1/translations \
-H "Authorization: Bearer sk-intermo-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Bonjour, comment allez-vous ?",
"target": "bam_Latn",
"model": "bambara-1.75"
}'
import requests
r = requests.post(
"https://api.kooma.ai/v1/translations",
headers={"Authorization": "Bearer sk-intermo-YOUR_KEY"},
json={"text": "Bonjour, comment allez-vous ?", "target": "bam_Latn"},
)
print(r.json()["text"])
const r = await fetch("https://api.kooma.ai/v1/translations", {
method: "POST",
headers: {
"Authorization": "Bearer sk-intermo-YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ text: "Bonjour, comment allez-vous ?", target: "bam_Latn" }),
});
const { text } = await r.json();
{
"text": "I ni ce, i ka kɛnɛ wa?",
"source": "fra_Latn",
"target": "bam_Latn",
"translations": [
{
"text": "I ni ce, i ka kɛnɛ wa?",
"source": "fra_Latn",
"target": "bam_Latn"
}
]
}