Documentation

API URL


POST /api/v1/translate (POST single/batch), /api/v1/translate/languages (GET)

Headers
Code
Content-Type: application/json
Body Parameters


Example Request

Code
POST https://datpaq.com/api/v1/translate?api_key=your-api-key | Body: {"text":"Hello world","targetLang":"es"}

Successful Response

Status
HTML
200 OK
Body
Code
{
  "success": true,
  "translations": [
    {
      "translatedText": "Hola mundo",
      "detectedSourceLang": "en"
    }
  ],
  "model": "m2m100-1.2b-int8",
  "charsProcessed": 11,
  "correlationId": "req_abc123",
  "metadata": {
    "api_token_name": null,
    "rate_limit": {
      "limit": null,
      "remaining": null,
      "reset": null
    }
  },
  "updatedAt": "2026-10-14T12:00:00.000Z",
  "processingTime": "42ms"
}

Error Response

Example
Code
HTTP 400 ValidationError: Missing/invalid text texts targetLang or sourceLang or detection failed — Request rejected before any engine call; HTTP 401 AuthenticationError: Gateway authentication failure — Request rejected due to missing or invalid API credentials; HTTP 404 NotFound: Unknown endpoint path — Request path does not map to available translate routes; HTTP 413 PayloadTooLarge: Request exceeds 30000 total characters — Character cap enforced before any engine call; HTTP 429 RateLimitError: More than 120 requests in 15 minutes — Request rejected by service rate limiter; HTTP 502 UpstreamUnavailable: Translation engine failed or unreachable — Engine returned an error or could not be reached; HTTP 503 EngineSaturated: Engine at capacity — Retry after the Retry-After interval; HTTP 504 UpstreamTimeout: Engine did not respond within 30 seconds — Request timed out at the engine proxy; HTTP 500 InternalError: Unexpected translation failure — Translation could not complete

Last Updated:  May 4, 2026