Translate text
Translate text from a source language to a target language.
This endpoint requires authentication. Include your API key in the Authorization header.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | valsea-translate | Yes | Public translation model name. Always valsea-translate. |
text | string | Yes | Text to translate. Maximum 10,000 characters; longer requests are rejected with 413 (not truncated). |
source | string | No | Source language name (e.g. "english", "chinese") or "auto" for detection. Default: "auto". When "auto" is used with response_format=verbose_json, the response's source_language reflects the detected language. |
target | string | Yes | Target language name (e.g. "chinese", "vietnamese", "thai"). |
response_format | json | verbose_json | No | Default: json |
Supported targets: english, chinese, japanese, korean, vietnamese, thai, french,
spanish, german, russian, indonesian, malay, filipino, tamil, khmer, and lao.
Code Examples
curl -X POST https://api.valsea.ai/v1/translations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "valsea-translate",
"text": "Hello, world",
"target": "chinese"
}'
Response
Minimal (json)
| Field | Type | Description |
|---|---|---|
translated_text | string | The translated text in the target language. |
Verbose (verbose_json)
| Field | Type | Description |
|---|---|---|
translated_text | string | The translated text in the target language. |
source_language | string | Returns the actual detected language if source was "auto". Otherwise, returns the source value you sent. If detection fails, defaults back to "auto". |
target_language | string | The target language the translation was produced in (echoes the target you sent). |
Errors
| Status | Description |
|---|---|
400 | Invalid request — malformed body, unsupported model, or unsupported target language |
401 | Missing or invalid API key |
402 | Insufficient credits |
413 | Text exceeds the 10,000-character limit |
429 | Rate limit exceeded |