curl --request POST \
--url https://api.voxnexus.ai/v1/translate \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"texts": [
"第一句",
"第二句"
],
"target_language": "eng_Latn",
"model_id": "vn-translate-basic",
"source_language": "zho_Hans"
}
'import requests
url = "https://api.voxnexus.ai/v1/translate"
payload = {
"texts": ["第一句", "第二句"],
"target_language": "eng_Latn",
"model_id": "vn-translate-basic",
"source_language": "zho_Hans"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
texts: ['第一句', '第二句'],
target_language: 'eng_Latn',
model_id: 'vn-translate-basic',
source_language: 'zho_Hans'
})
};
fetch('https://api.voxnexus.ai/v1/translate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voxnexus.ai/v1/translate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'texts' => [
'第一句',
'第二句'
],
'target_language' => 'eng_Latn',
'model_id' => 'vn-translate-basic',
'source_language' => 'zho_Hans'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voxnexus.ai/v1/translate"
payload := strings.NewReader("{\n \"texts\": [\n \"第一句\",\n \"第二句\"\n ],\n \"target_language\": \"eng_Latn\",\n \"model_id\": \"vn-translate-basic\",\n \"source_language\": \"zho_Hans\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voxnexus.ai/v1/translate")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"texts\": [\n \"第一句\",\n \"第二句\"\n ],\n \"target_language\": \"eng_Latn\",\n \"model_id\": \"vn-translate-basic\",\n \"source_language\": \"zho_Hans\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voxnexus.ai/v1/translate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"texts\": [\n \"第一句\",\n \"第二句\"\n ],\n \"target_language\": \"eng_Latn\",\n \"model_id\": \"vn-translate-basic\",\n \"source_language\": \"zho_Hans\"\n}"
response = http.request(request)
puts response.read_body[
{
"text": "Hello",
"detected_source_language": "zho_Hans"
}
]{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}Translate Text
Translate one or more texts into a single target language. Source language is auto-detected when not specified.
curl --request POST \
--url https://api.voxnexus.ai/v1/translate \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"texts": [
"第一句",
"第二句"
],
"target_language": "eng_Latn",
"model_id": "vn-translate-basic",
"source_language": "zho_Hans"
}
'import requests
url = "https://api.voxnexus.ai/v1/translate"
payload = {
"texts": ["第一句", "第二句"],
"target_language": "eng_Latn",
"model_id": "vn-translate-basic",
"source_language": "zho_Hans"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
texts: ['第一句', '第二句'],
target_language: 'eng_Latn',
model_id: 'vn-translate-basic',
source_language: 'zho_Hans'
})
};
fetch('https://api.voxnexus.ai/v1/translate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voxnexus.ai/v1/translate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'texts' => [
'第一句',
'第二句'
],
'target_language' => 'eng_Latn',
'model_id' => 'vn-translate-basic',
'source_language' => 'zho_Hans'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voxnexus.ai/v1/translate"
payload := strings.NewReader("{\n \"texts\": [\n \"第一句\",\n \"第二句\"\n ],\n \"target_language\": \"eng_Latn\",\n \"model_id\": \"vn-translate-basic\",\n \"source_language\": \"zho_Hans\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voxnexus.ai/v1/translate")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"texts\": [\n \"第一句\",\n \"第二句\"\n ],\n \"target_language\": \"eng_Latn\",\n \"model_id\": \"vn-translate-basic\",\n \"source_language\": \"zho_Hans\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voxnexus.ai/v1/translate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"texts\": [\n \"第一句\",\n \"第二句\"\n ],\n \"target_language\": \"eng_Latn\",\n \"model_id\": \"vn-translate-basic\",\n \"source_language\": \"zho_Hans\"\n}"
response = http.request(request)
puts response.read_body[
{
"text": "Hello",
"detected_source_language": "zho_Hans"
}
]{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}{
"error": "Invalid request parameters",
"code": "INVALID_REQUEST",
"details": "Detailed error information",
"request_id": "req_1234567890"
}Authorizations
Authenticate using X-Api-Key header
Body
Text translation request
Texts to translate (max 100 items / 50,000 characters)
["第一句", "第二句"]
Target language code (required). Same format as source_language; see GET /v1/models/{model_id} → translate_capability.target_languages for the codes a model supports.
"eng_Latn"
Translation model ID (e.g. vn-translate-basic).
"vn-translate-basic"
Source language code. Omit (or pass auto) for automatic detection; providing this forces the source language.
VoxNexus translation language codes use the <ISO 639-3>_<Script> form: an ISO 639-3 language code, _, and an ISO 15924 script code, e.g. eng_Latn, arb_Arab, hin_Deva, zho_Hans, zho_Hant. Other common forms are accepted and normalized, case-insensitively and with - or _: ISO 639-1 (en, ar), ISO 639-3 (eng) and BCP 47 tags (zh-Hans, zh-TW, pt-BR). A region subtag only selects the script and is then dropped (zh-TW → zho_Hant, pt-BR → por_Latn).
"zho_Hans"
Response
Translation successful
Translated text
"Hello"
When source_language is specified (not blank or auto), it is echoed unchanged (e.g. en, EN_us) and takes precedence over the detected language. Otherwise the detected language is returned as a <ISO 639-3>_<Script> code (e.g. zho_Hans, eng_Latn).
"zho_Hans"

