Generate Translations API

The Public API allows you to generate AI-powered translations for your text content using Prismy’s translation engine.

Endpoint

POST /api/public/generate-translations

Authentication

This endpoint requires API token authentication. You need to:
  1. Generate an API token from your organization settings in the Prismy dashboard
  2. Include the token in the Authorization header of your requests

Headers

HeaderValueDescription
AuthorizationBearer {your-api-token}Your organization’s API token
Content-Typeapplication/jsonRequired for JSON request body

Request Body

ParameterTypeRequiredDefaultDescription
targetLanguagestring-The language code to translate to (e.g., “fr-FR”, “es-ES”, “de-DE”)
sourceLanguagestring-The language code of the source text (e.g., “en-US”, “fr-FR”, “es-ES”)
textsToTranslatestring[]-Array of text strings to translate
useOrgDescriptionbooleantrueUse organization description for context
useGlossarybooleantrueUse organization glossary for consistent terminology
useSimilaritybooleantrueUse similarity matching for better translations
useCustomInstructionsbooleantrueUse custom translation instructions
instructionsSourcestring"github"Source of custom instructions
instructionsBundlestring""Bundle name for instructions
instructionsRepositorystring""Repository name for instructions
additionalInstructionsstring""Additional custom instructions

Example Request

curl -X POST https://api.prismy.io/api/public/generate-translations \
  -H "Authorization: Bearer your-api-token-here" \
  -H "Content-Type: application/json" \
  -d '{
    "targetLanguage": "fr-FR",
    "sourceLanguage": "en-EN",
    "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",
    "instructionsRepository": "my-repo",
    "instructionsBundle": "web-app",
    "additionalInstructions": "Keep the tone professional and friendly"
  }'

Request Body Only

{
  "targetLanguage": "fr",
  "sourceLanguage": "en",
  "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",
  "instructionsRepository": "my-repo",
  "instructionsBundle": "web-app",
  "additionalInstructions": "Keep the tone professional and friendly"
}

Response

Success Response (200)

Returns an array of translated strings in the same order as the input:
[
  "Bienvenue dans notre application",
  "Cliquez ici pour commencer",
  "Votre compte a été créé avec succès"
]

Error Responses

Rate Limited (429)

{
  "message": "You have reached the limit of AI translations for this month, do not hesitate to contact us."
}

Features

Organization Description

When useOrgDescription is enabled, the translation engine uses your organization’s description to provide better context and maintain brand consistency.

Glossary Integration

When useGlossary is enabled, the system automatically extracts terms from your source texts and applies consistent translations based on your organization’s glossary.

Similarity Learning

When useSimilarity is enabled, the system leverages previously translated similar content to improve translation quality and consistency.

Custom Instructions

When useCustomInstructions is enabled, you can specify:
  • Instructions Source: Where to pull instructions from (e.g., “github”)
  • Repository: Specific repository for instructions
  • Bundle: Specific bundle/project within the repository
  • Additional Instructions: Extra context or requirements for the translation