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 | |
text | string | Yes | Text to translate. |
source | string | No | Source language name (e.g. "english", "chinese") or "auto" for detection. Default: "auto" |
target | string | Yes | Target language name (e.g. "chinese", "vietnamese", "thai"). |
response_format | json | verbose_json | No | Default: json |
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 |
Verbose (verbose_json)
| Field | Type | Description |
|---|---|---|
translated_text | string | |
source_language | string | |
target_language | string |
Errors
| Status | Description |
|---|---|
401 | Missing or invalid API key |
402 | Insufficient credits |