Generate Translations (Multilang)
Translate multiple strings across multiple source languages and target languages.
curl --request POST \
--url https://app.prismy.io/api/public/translate-multilang \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceValues": [
{
"en-US": "hello world",
"fr-FR": "bonjour le monde"
}
],
"targetLanguages": [
"es-ES",
"it-IT"
],
"useOrgDescription": true,
"useGlossary": true,
"useSimilarity": true,
"useCustomInstructions": true,
"instructionsSource": "github",
"instructionsBundle": "",
"instructionsRepository": "",
"additionalInstructions": ""
}
'import requests
url = "https://app.prismy.io/api/public/translate-multilang"
payload = {
"sourceValues": [
{
"en-US": "hello world",
"fr-FR": "bonjour le monde"
}
],
"targetLanguages": ["es-ES", "it-IT"],
"useOrgDescription": True,
"useGlossary": True,
"useSimilarity": True,
"useCustomInstructions": True,
"instructionsSource": "github",
"instructionsBundle": "",
"instructionsRepository": "",
"additionalInstructions": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceValues: [{'en-US': 'hello world', 'fr-FR': 'bonjour le monde'}],
targetLanguages: ['es-ES', 'it-IT'],
useOrgDescription: true,
useGlossary: true,
useSimilarity: true,
useCustomInstructions: true,
instructionsSource: 'github',
instructionsBundle: '',
instructionsRepository: '',
additionalInstructions: ''
})
};
fetch('https://app.prismy.io/api/public/translate-multilang', 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://app.prismy.io/api/public/translate-multilang",
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([
'sourceValues' => [
[
'en-US' => 'hello world',
'fr-FR' => 'bonjour le monde'
]
],
'targetLanguages' => [
'es-ES',
'it-IT'
],
'useOrgDescription' => true,
'useGlossary' => true,
'useSimilarity' => true,
'useCustomInstructions' => true,
'instructionsSource' => 'github',
'instructionsBundle' => '',
'instructionsRepository' => '',
'additionalInstructions' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.prismy.io/api/public/translate-multilang"
payload := strings.NewReader("{\n \"sourceValues\": [\n {\n \"en-US\": \"hello world\",\n \"fr-FR\": \"bonjour le monde\"\n }\n ],\n \"targetLanguages\": [\n \"es-ES\",\n \"it-IT\"\n ],\n \"useOrgDescription\": true,\n \"useGlossary\": true,\n \"useSimilarity\": true,\n \"useCustomInstructions\": true,\n \"instructionsSource\": \"github\",\n \"instructionsBundle\": \"\",\n \"instructionsRepository\": \"\",\n \"additionalInstructions\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.prismy.io/api/public/translate-multilang")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceValues\": [\n {\n \"en-US\": \"hello world\",\n \"fr-FR\": \"bonjour le monde\"\n }\n ],\n \"targetLanguages\": [\n \"es-ES\",\n \"it-IT\"\n ],\n \"useOrgDescription\": true,\n \"useGlossary\": true,\n \"useSimilarity\": true,\n \"useCustomInstructions\": true,\n \"instructionsSource\": \"github\",\n \"instructionsBundle\": \"\",\n \"instructionsRepository\": \"\",\n \"additionalInstructions\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.prismy.io/api/public/translate-multilang")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourceValues\": [\n {\n \"en-US\": \"hello world\",\n \"fr-FR\": \"bonjour le monde\"\n }\n ],\n \"targetLanguages\": [\n \"es-ES\",\n \"it-IT\"\n ],\n \"useOrgDescription\": true,\n \"useGlossary\": true,\n \"useSimilarity\": true,\n \"useCustomInstructions\": true,\n \"instructionsSource\": \"github\",\n \"instructionsBundle\": \"\",\n \"instructionsRepository\": \"\",\n \"additionalInstructions\": \"\"\n}"
response = http.request(request)
puts response.read_body[
{
"en-US": "hello world",
"fr-FR": "bonjour le monde",
"es-ES": "hola mundo",
"it-IT": "ciao mondo"
}
]{
"message": "You have reached the limit of AI translations for this month, do not hesitate to contact us."
}Authorizations
API token from your organization settings
Body
Array of objects keyed by language code. Each item may have one or more source languages (e.g. en-US, fr-FR); not all items need all languages. The AI receives whatever source(s) are present per item to translate into the target language(s).
Show child attributes
Show child attributes
Language codes to translate into (e.g. ["es-ES", "it-IT"])
["es-ES", "it-IT"]
Use organization description for context
Use organization glossary for consistent terminology
Use similarity matching for better translations
Use custom translation instructions
Source of custom instructions
Bundle name for instructions
Repository name for instructions
Additional custom instructions
Response
Consolidated translations: array of objects, each object = input item plus target-language keys
curl --request POST \
--url https://app.prismy.io/api/public/translate-multilang \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceValues": [
{
"en-US": "hello world",
"fr-FR": "bonjour le monde"
}
],
"targetLanguages": [
"es-ES",
"it-IT"
],
"useOrgDescription": true,
"useGlossary": true,
"useSimilarity": true,
"useCustomInstructions": true,
"instructionsSource": "github",
"instructionsBundle": "",
"instructionsRepository": "",
"additionalInstructions": ""
}
'import requests
url = "https://app.prismy.io/api/public/translate-multilang"
payload = {
"sourceValues": [
{
"en-US": "hello world",
"fr-FR": "bonjour le monde"
}
],
"targetLanguages": ["es-ES", "it-IT"],
"useOrgDescription": True,
"useGlossary": True,
"useSimilarity": True,
"useCustomInstructions": True,
"instructionsSource": "github",
"instructionsBundle": "",
"instructionsRepository": "",
"additionalInstructions": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceValues: [{'en-US': 'hello world', 'fr-FR': 'bonjour le monde'}],
targetLanguages: ['es-ES', 'it-IT'],
useOrgDescription: true,
useGlossary: true,
useSimilarity: true,
useCustomInstructions: true,
instructionsSource: 'github',
instructionsBundle: '',
instructionsRepository: '',
additionalInstructions: ''
})
};
fetch('https://app.prismy.io/api/public/translate-multilang', 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://app.prismy.io/api/public/translate-multilang",
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([
'sourceValues' => [
[
'en-US' => 'hello world',
'fr-FR' => 'bonjour le monde'
]
],
'targetLanguages' => [
'es-ES',
'it-IT'
],
'useOrgDescription' => true,
'useGlossary' => true,
'useSimilarity' => true,
'useCustomInstructions' => true,
'instructionsSource' => 'github',
'instructionsBundle' => '',
'instructionsRepository' => '',
'additionalInstructions' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.prismy.io/api/public/translate-multilang"
payload := strings.NewReader("{\n \"sourceValues\": [\n {\n \"en-US\": \"hello world\",\n \"fr-FR\": \"bonjour le monde\"\n }\n ],\n \"targetLanguages\": [\n \"es-ES\",\n \"it-IT\"\n ],\n \"useOrgDescription\": true,\n \"useGlossary\": true,\n \"useSimilarity\": true,\n \"useCustomInstructions\": true,\n \"instructionsSource\": \"github\",\n \"instructionsBundle\": \"\",\n \"instructionsRepository\": \"\",\n \"additionalInstructions\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.prismy.io/api/public/translate-multilang")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceValues\": [\n {\n \"en-US\": \"hello world\",\n \"fr-FR\": \"bonjour le monde\"\n }\n ],\n \"targetLanguages\": [\n \"es-ES\",\n \"it-IT\"\n ],\n \"useOrgDescription\": true,\n \"useGlossary\": true,\n \"useSimilarity\": true,\n \"useCustomInstructions\": true,\n \"instructionsSource\": \"github\",\n \"instructionsBundle\": \"\",\n \"instructionsRepository\": \"\",\n \"additionalInstructions\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.prismy.io/api/public/translate-multilang")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourceValues\": [\n {\n \"en-US\": \"hello world\",\n \"fr-FR\": \"bonjour le monde\"\n }\n ],\n \"targetLanguages\": [\n \"es-ES\",\n \"it-IT\"\n ],\n \"useOrgDescription\": true,\n \"useGlossary\": true,\n \"useSimilarity\": true,\n \"useCustomInstructions\": true,\n \"instructionsSource\": \"github\",\n \"instructionsBundle\": \"\",\n \"instructionsRepository\": \"\",\n \"additionalInstructions\": \"\"\n}"
response = http.request(request)
puts response.read_body[
{
"en-US": "hello world",
"fr-FR": "bonjour le monde",
"es-ES": "hola mundo",
"it-IT": "ciao mondo"
}
]{
"message": "You have reached the limit of AI translations for this month, do not hesitate to contact us."
}