Skip to main content

Endpoint

POST /v2/translate
This endpoint provides compatibility with the official DeepL API format. It accepts both JSON and form-encoded requests and returns responses in the official DeepL API structure.

Authentication

If an access token is configured on the server, include it in one of the following ways:
POST /v2/translate?token=your_access_token

Request Body

This endpoint accepts requests in two formats:
text
array
required
Array of text strings to be translated. Multiple texts will be joined with newlines.
target_lang
string
required
The target language code (e.g., “EN”, “DE”, “FR”, “ZH”).
source_lang
string
The source language code. Omit or leave empty for automatic detection.
tag_handling
string
Specifies how to handle tags in the text. Allowed values: html or xml.

Response

The response follows the official DeepL API format:
translations
array
Array of translation objects
detected_source_language
string
The detected or specified source language
text
string
The translated text

Examples

curl -X POST http://localhost:1188/v2/translate \
  -H "Content-Type: application/json" \
  -d '{
    "text": ["Hello, world!", "How are you?"],
    "target_lang": "DE"
  }'

Success Response

{
  "translations": [
    {
      "detected_source_language": "EN",
      "text": "Hallo, Welt!\nWie geht es dir?"
    }
  ]
}

Error Responses

{
  "code": 400,
  "message": "Invalid request payload"
}
Returned when the request body cannot be parsed or required fields are missing.
{
  "code": 401,
  "message": "Invalid access token"
}
Returned when the provided access token doesn’t match the server configuration.
{
  "code": 429,
  "message": "Too many requests"
}
Returned when rate limits are exceeded.

Notes

  • Official Format Compatibility: This endpoint mimics the official DeepL API response structure
  • Multiple Text Support: When using JSON format with an array of texts, they are joined with newlines
  • Automatic Language Detection: Source language is automatically detected when not specified
  • Form Data Support: Both application/json and application/x-www-form-urlencoded content types are supported
  • Free API Backend: This endpoint uses the DeepL free API (no Pro account required)
  • The response structure matches the official DeepL API for easy migration and compatibility

Comparison with Official DeepL API

This endpoint is designed to be a drop-in replacement for the official DeepL API /v2/translate endpoint:
  • ✅ Same request format (JSON and form data)
  • ✅ Same response structure
  • ✅ Compatible with official DeepL client libraries
  • ✅ Supports same authentication methods (Bearer token, DeepL-Auth-Key)
  • ⚠️ Uses free API backend instead of paid API
  • ⚠️ May have different rate limits and quotas

Build docs developers (and LLMs) love