Skip to main content
POST
/
api
/
public
/
translate-multilang
Generate translations (Multilang)
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

Authorization
string
header
required

API token from your organization settings

Body

application/json
sourceValues
object[]
required

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).

targetLanguages
string[]
required

Language codes to translate into (e.g. ["es-ES", "it-IT"])

Example:
["es-ES", "it-IT"]
useOrgDescription
boolean
default:true

Use organization description for context

useGlossary
boolean
default:true

Use organization glossary for consistent terminology

useSimilarity
boolean
default:true

Use similarity matching for better translations

useCustomInstructions
boolean
default:true

Use custom translation instructions

instructionsSource
string
default:github

Source of custom instructions

instructionsBundle
string
default:""

Bundle name for instructions

instructionsRepository
string
default:""

Repository name for instructions

additionalInstructions
string
default:""

Additional custom instructions

Response

Consolidated translations: array of objects, each object = input item plus target-language keys

{key}
string