API v1
API Documentation
Integrate LinguaFor translations into your applications.
Quick Start
Base URL: https://dev.linguafor.com
Authentication
Pass your API key in the X-API-Key header:
curl -X POST https://dev.linguafor.com/api/v1/translate \
-H "Content-Type: application/json" \
-H "X-API-Key: lf_your_api_key" \
-d '{"text": "Hello world", "target": "ro"}'AI Translation
curl -X POST https://dev.linguafor.com/api/v1/translate \
-H "Content-Type: application/json" \
-H "X-API-Key: lf_your_api_key" \
-d '{
"text": "Please review the contract",
"target": "de",
"mode": "ai",
"tone": "formal",
"context": "legal document"
}'POST
/api/v1/translateAuth requiredTranslate text between languages
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
text | string | required | Text to translate (max 5000 chars) |
source | string | optional | Source language code (ISO 639-1). Omit for auto-detect. |
target | string | required | Target language code (ISO 639-1) |
mode | string | optional | "auto" (DeepL/Google) or "ai" (Claude AI) |
tone | string | optional | AI mode only: "neutral", "formal", "informal", "academic", "creative" |
context | string | optional | AI mode only: context for better translation |
glossary | string | optional | AI mode only: custom term mappings |
REQUEST BODY
{
"text": "Hello, how are you?",
"source": "en",
"target": "ro",
"mode": "auto"
}RESPONSE
{
"translated_text": "Bună ziua, ce mai faci?",
"source_language": "en",
"target_language": "ro",
"provider": "deepl+google",
"mode": "auto",
"characters": 19,
"latency_ms": 245
}GET
/api/v1/languagesList all supported languages
RESPONSE
{
"source_languages": [
{ "code": "en", "name": "English" },
{ "code": "ro", "name": "Romanian" },
...
],
"target_languages": [...],
"total_source": 134,
"total_target": 137
}Error Codes
401Invalid or missing API key
400Missing required fields or text too long
429Rate limit exceeded
500Translation service error
Rate Limits
Free: 100 requests/day, 5,000 chars/request
Starter: 1,000 requests/day, 5,000 chars/request
Pro: 10,000 requests/day, 10,000 chars/request
Business: 100,000 requests/day, 50,000 chars/request