Skip to main content

Quick Start Guide

Get up and running with YODI API in just 5 minutes.

Prerequisites​

  • A YODI account
  • An API key (you can create one in your dashboard)
  • cURL, Postman, or any HTTP client

Step 1: Get Your API Key​

  1. Log in to https://console.yodi.tg
  2. Navigate to API Keys
  3. Click Generate New Key
  4. Copy and save your key safely

Step 2: Make Your First Request​

Using cURL​

curl -X POST "https://api.yodi.tg/v1/ai/translate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: 2f18dc23-d167-4f78-a77d-d4da326abf42" \
-H "Content-Type: application/json" \
-d '{
"text": "Bonjour, comment allez-vous?",
"sourceLang": "fra_Latn",
"targetLang": "ewe_Latn"
}'

Using Python​

import requests
import uuid

headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Idempotency-Key': str(uuid.uuid4()),
'Content-Type': 'application/json'
}

data = {
'text': 'Bonjour, comment allez-vous?',
'sourceLang': 'fra_Latn',
'targetLang': 'ewe_Latn'
}

response = requests.post(
'https://api.yodi.tg/v1/ai/translate',
headers=headers,
json=data
)

print(response.json())

Using JavaScript​

const response = await fetch("https://api.yodi.tg/v1/ai/translate", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Bonjour, comment allez-vous?",
sourceLang: "fra_Latn",
targetLang: "ewe_Latn",
}),
});

const data = await response.json();
console.log(data);

Step 3: Check Your Response​

You should receive the standard response envelope. The translation payload is an object so clients can retain the language pair:

{
"message": "SUCCESS",
"error": false,
"data": {
"translatedText": "Akɔtaba me, ɔlɔ ɖe?",
"sourceLang": "fra_Latn",
"targetLang": "ewe_Latn"
},
"meta": { "request_id": "req_example_123", "served_at": "2026-10-29T12:00:00.000Z" },
"status": 200
}

Supported Languages​

YODI supports translation for West African languages:

CodeLanguage
fra_LatnFrench (Français)
ewe_LatnEwe
mina_LatnMina
kbp_LatnKabye

Common Issues​

401 Unauthorized​

Your API key is invalid or missing. Check that:

  • You've included the Authorization header
  • The key format is correct: Bearer YOUR_API_KEY
  • Your key hasn't expired

400 Bad Request​

Check that all required parameters are included in your request.


Next Steps​