POST/api/translation
Translates text from one language to another. The source language can be auto-detected or specified explicitly.
Request Body
| Field | Type | Required | Description |
|---|
| text | string | Yes | The text to translate |
| targetLanguage | string | Yes | Language to translate into (e.g. "English", "Spanish") |
| sourceLanguage | string | null | No | Source language, or null for auto-detection |
Response
| Field | Type | Description |
|---|
| originalText | string | The original input text |
| translatedText | string | The translated output |
| detectedLanguage | string | null | Detected source language (when auto-detected) |
Example: Auto-detect source language
curl -X POST https://api.lingua-franca.ai/api/translation \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Bonjour le monde",
"sourceLanguage": null,
"targetLanguage": "English"
}'
{
"originalText": "Bonjour le monde",
"translatedText": "Hello world",
"detectedLanguage": "French"
}
Example: Specify source language
curl -X POST https://api.lingua-franca.ai/api/translation \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Hola mundo",
"sourceLanguage": "Spanish",
"targetLanguage": "Japanese"
}'
{
"originalText": "Hola mundo",
"translatedText": "こんにちは世界",
"detectedLanguage": null
}
GET/api/credits/balance
Returns your current credit balance, monthly allocation, and last reset date.
Example
curl https://api.lingua-franca.ai/api/credits/balance \
-H "Authorization: ApiKey YOUR_API_KEY"
{
"currentMonthCredits": 4850,
"monthlyAllocation": 5000,
"lastReset": "2026-02-01T00:00:00Z"
}