Public API
Generate Translations
Translate multiple strings from a single source language to a single target language.
POST
/
api
/
public
/
translate
Generate translations
curl --request POST \
--url https://app.prismy.io/api/public/translate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetLanguage": "fr-FR",
"sourceLanguage": "en-US",
"textsToTranslate": [
"Welcome to our application",
"Click here to get started",
"Your account has been created successfully"
],
"useOrgDescription": true,
"useGlossary": true,
"useSimilarity": true,
"useCustomInstructions": true,
"instructionsSource": "github",
"instructionsBundle": "",
"instructionsRepository": "",
"additionalInstructions": ""
}
'import requests
url = "https://app.prismy.io/api/public/translate"
payload = {
"targetLanguage": "fr-FR",
"sourceLanguage": "en-US",
"textsToTranslate": ["Welcome to our application", "Click here to get started", "Your account has been created successfully"],
"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({
targetLanguage: 'fr-FR',
sourceLanguage: 'en-US',
textsToTranslate: [
'Welcome to our application',
'Click here to get started',
'Your account has been created successfully'
],
useOrgDescription: true,
useGlossary: true,
useSimilarity: true,
useCustomInstructions: true,
instructionsSource: 'github',
instructionsBundle: '',
instructionsRepository: '',
additionalInstructions: ''
})
};
fetch('https://app.prismy.io/api/public/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://app.prismy.io/api/public/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([
'targetLanguage' => 'fr-FR',
'sourceLanguage' => 'en-US',
'textsToTranslate' => [
'Welcome to our application',
'Click here to get started',
'Your account has been created successfully'
],
'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"
payload := strings.NewReader("{\n \"targetLanguage\": \"fr-FR\",\n \"sourceLanguage\": \"en-US\",\n \"textsToTranslate\": [\n \"Welcome to our application\",\n \"Click here to get started\",\n \"Your account has been created successfully\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetLanguage\": \"fr-FR\",\n \"sourceLanguage\": \"en-US\",\n \"textsToTranslate\": [\n \"Welcome to our application\",\n \"Click here to get started\",\n \"Your account has been created successfully\"\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")
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 \"targetLanguage\": \"fr-FR\",\n \"sourceLanguage\": \"en-US\",\n \"textsToTranslate\": [\n \"Welcome to our application\",\n \"Click here to get started\",\n \"Your account has been created successfully\"\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[
"Bienvenue dans notre application",
"Cliquez ici pour commencer",
"Votre compte a été créé avec succès"
]{
"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
application/json
The language code to translate to (e.g., "fr-FR", "es-ES", "de-DE")
Example:
"fr-FR"
The language code of the source text (e.g., "en-US", "fr-FR", "es-ES")
Example:
"en-US"
Array of text strings to translate
Example:
[
"Welcome to our application",
"Click here to get started",
"Your account has been created successfully"
]
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
Translations generated successfully
Example:
[
"Bienvenue dans notre application",
"Cliquez ici pour commencer",
"Votre compte a été créé avec succès"
]
Previous
Generate Translations (Multilang)Translate multiple strings across multiple source languages and target languages.
Next
⌘I
Generate translations
curl --request POST \
--url https://app.prismy.io/api/public/translate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetLanguage": "fr-FR",
"sourceLanguage": "en-US",
"textsToTranslate": [
"Welcome to our application",
"Click here to get started",
"Your account has been created successfully"
],
"useOrgDescription": true,
"useGlossary": true,
"useSimilarity": true,
"useCustomInstructions": true,
"instructionsSource": "github",
"instructionsBundle": "",
"instructionsRepository": "",
"additionalInstructions": ""
}
'import requests
url = "https://app.prismy.io/api/public/translate"
payload = {
"targetLanguage": "fr-FR",
"sourceLanguage": "en-US",
"textsToTranslate": ["Welcome to our application", "Click here to get started", "Your account has been created successfully"],
"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({
targetLanguage: 'fr-FR',
sourceLanguage: 'en-US',
textsToTranslate: [
'Welcome to our application',
'Click here to get started',
'Your account has been created successfully'
],
useOrgDescription: true,
useGlossary: true,
useSimilarity: true,
useCustomInstructions: true,
instructionsSource: 'github',
instructionsBundle: '',
instructionsRepository: '',
additionalInstructions: ''
})
};
fetch('https://app.prismy.io/api/public/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://app.prismy.io/api/public/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([
'targetLanguage' => 'fr-FR',
'sourceLanguage' => 'en-US',
'textsToTranslate' => [
'Welcome to our application',
'Click here to get started',
'Your account has been created successfully'
],
'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"
payload := strings.NewReader("{\n \"targetLanguage\": \"fr-FR\",\n \"sourceLanguage\": \"en-US\",\n \"textsToTranslate\": [\n \"Welcome to our application\",\n \"Click here to get started\",\n \"Your account has been created successfully\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetLanguage\": \"fr-FR\",\n \"sourceLanguage\": \"en-US\",\n \"textsToTranslate\": [\n \"Welcome to our application\",\n \"Click here to get started\",\n \"Your account has been created successfully\"\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")
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 \"targetLanguage\": \"fr-FR\",\n \"sourceLanguage\": \"en-US\",\n \"textsToTranslate\": [\n \"Welcome to our application\",\n \"Click here to get started\",\n \"Your account has been created successfully\"\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[
"Bienvenue dans notre application",
"Cliquez ici pour commencer",
"Votre compte a été créé avec succès"
]{
"message": "You have reached the limit of AI translations for this month, do not hesitate to contact us."
}