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 required

Translate text between languages

Parameters

NameTypeRequiredDescription
textstringrequiredText to translate (max 5000 chars)
sourcestringoptionalSource language code (ISO 639-1). Omit for auto-detect.
targetstringrequiredTarget language code (ISO 639-1)
modestringoptional"auto" (DeepL/Google) or "ai" (Claude AI)
tonestringoptionalAI mode only: "neutral", "formal", "informal", "academic", "creative"
contextstringoptionalAI mode only: context for better translation
glossarystringoptionalAI 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/languages

List 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