API URL
POST /api/v1/translate (POST single/batch), /api/v1/translate/languages (GET)
Headers
Code
Content-Type: application/jsonBody Parameters
Param
Type
Description
text
required
string
Single text to translate (1-5000 chars)
texts
required
array
Batch texts (1-50 items max 5000 chars each 30000 per request)
targetLang
required
string
Target language ISO 639-1 from supported set
sourceLang
optional
string
Source language ISO 639-1 or auto (default auto)
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 OKBody
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"
}Field
Type
success
boolean
translations
array
translations_translatedText
string
translations_detectedSourceLang
string
model
string
charsProcessed
number
languages
array
pairs
number
correlationId
string
status
string
service
string
version
string
error
object
metadata
object
metadata_correlationId
string
metadata_timestamp
string
metadata_api_token_name
string
metadata_rate_limit
object
updatedAt
string
processingTime
string
reason
string
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 completeLast Updated: May 4, 2026