POST Traduction
Traduit un texte d'une langue vers une autre — bambara ↔ français / anglais et grandes langues internationales — avec détection automatique de la langue source.
POST/v1/translations
Corps JSON. Autorisation requise : mt.
Traduit un texte d'une langue vers une autre — bambara ↔ français / anglais et grandes langues internationales — avec détection automatique de la langue source.
Corps JSON. Autorisation requise : mt.
| Nom | Type | Description |
|---|---|---|
textrequis | string | Le texte à traduire (5 000 caractères max). |
targetoption | string | Langue cible (voir Langues). Défaut bam_Latn. |
sourceoption | string | Langue source. Absent ou auto = détection automatique. |
modeloption | string | Version du modèle de traduction bambara : bambara-1.75 (défaut), bambara-1.7 ou bambara-1.6. Toute autre valeur est refusée (422 invalid_model). |
| Champ | Type | Description |
|---|---|---|
text | string | Le texte traduit. |
source | string | Langue source retenue (utile si auto). |
target | string | Langue cible. |
translations | array | Liste des traductions {text, source, target}. |
Facturé au caractère du texte source — même tarif quel que soit model.
curl https://api.kooma.ai/v1/translations \
-H "Authorization: Bearer sk-intermo-VOTRE_CLE" \
-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-VOTRE_CLE"},
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-VOTRE_CLE",
"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"
}
]
}