Skip to main content
Machine Translation API

Tilde MT API integration

Integrate machine translation into your application or website with Tilde MT API.

  • Translate text and files effortlessly: Tilde MT API supports plaintext as well as most common office files, images, web and interchange formats.
  • Customize text translations: Apply saved glossaries, send request-specific terminology, or add source-target examples to guide wording, style, and context.

Explore the Swagger API specification: https://translate.tilde.ai/api-description

Try the .NET library: Github repository

See the list of supported languages: Language support


Service endpoint​

A service endpoint is a base URL that specifies the network address of an API service. Tilde MT service has the following service endpoint and all URIs below are relative to this service endpoint:

https://translate.tilde.ai/api/

Text translation is accessible at: https://translate.tilde.ai/api/translate/text

File translation is accessible at: https://translate.tilde.ai/api/translate/file

Language detection is accessible at: https://translate.tilde.ai/api/language


Authentication​

The API uses an access key for authentication. Log into the Tilde MT platform, and create a new access key https://translate.tilde.ai/access-keys. Read more about access keys: Create an access key on Tilde MT platform.

You must include an X-Api-Key header in your request with your unique key.

Header Example:

X-Api-Key: YOUR_API_KEY

Replace YOUR_API_KEY with your actual access key. Requests without a valid access key in the X-Api-Key header will be rejected.


Translate text​

To translate text, you'll make a POST request to the /translate/text endpoint. This endpoint translates one or more text segments from a source language to a target language. The request body must be in JSON format (application/json).

Example request
POST {BASE_URL}/api/translate/text HTTP/2
Host: {host_URL}
accept: text/plain
content-length: 141
content-type: application/json
x-api-key: YOUR_API_KEY

{
"srcLang": "en",
"trgLang": "de",
"domain": "tildeopen",
"text": [
"Hello, world!",
"How are you?"
],
"termCollections": []
}
Example response
{
"domain": "tildeopen",
"translations": [
{
"translation": "Hallo Welt!"
},
{
"translation": "Wie geht es dir?"
}
],
"detectedLanguage": null
}

Request parameters​

The main object in your request body should contain the following fields:

ParameterTypeRequiredDescription
textArray of StringsYesAn array of text segments to be translated. Each string is treated as an individual segment.
srcLangString (max 10 chars)NoThe language code of the source text (e.g., en, lv). If omitted, the API attempts to auto-detect the language.
trgLangString (max 10 chars)YesThe language code for the desired translation (e.g., fr, de).
domainString (max 200 chars)NoSpecifies a subject area or domain for the translation to use a domain-specific translation engine. Available domains are general, general ai and tildeopen with custom domains for private engines.
engineIdString (UUID)NoThe unique identifier of a specific custom translation engine to use.
termCollectionsArray of Strings (UUID)NoA list of unique identifiers for term collections (glossaries) to be applied during translation. If a glossary is selected when creating an access key on the platform or set as default glossary this field can be left empty.
additionalTermsObjectNoMaps source words or phrases to arrays of preferred target strings for this request. The mappings apply to the entire text array.
examplesArray of ObjectsNoSource-target example pairs that guide similar translations. Supports up to 50 pairs; sourceText and targetText must each contain 1–100,000 characters. The examples apply to the entire text array.

Customize text translations​

The text translation endpoint supports three ways to customize the result: stored term collections, request-specific terminology, and source-target examples. additionalTerms and examples apply to every segment in the text array and only to the current request. Include them again in each request that needs the same guidance.

These features guide the translation model. They do not perform deterministic text replacement or guarantee that literals and markup remain unchanged.

Choose a customization method​

NeedFieldBest suited for
Reusable, centrally managed terminologytermCollectionsGlossaries stored on the Tilde MT platform and referenced by UUID.
Terminology selected for one requestadditionalTermsProduct labels, technical terms, and entries retrieved from a CMS or external termbase.
Guidance through translated examplesexamplesTone, style, word sense, product-name treatment, abbreviations, and recurring formatting conventions.

You can use these fields separately or together. When you combine them, keep their guidance consistent.

Send request-specific terminology​

Use additionalTerms to send preferred translations for words or phrases with a text translation request. Each property is a source word or phrase, and its value is an array of preferred target strings.

Typical uses include:

  • Product catalog or CMS: Read the approved target-language label from the product or component record and add it to the request.
  • External termbase: Select the entries relevant to the content being translated and send those mappings with the job.
  • Translation review: Retry an affected passage with wording approved by a reviewer.
  • Technical or branded content: Guide translations of product names, component labels, and domain-specific terms.

The following Latvian-to-Estonian request asks the service to prefer juhtpult when translating vadības panelis:

Example request with additionalTerms
{
"srcLang": "lv",
"trgLang": "et",
"text": [
"Celtņa vadības panelis atrodas kabīnē pa labi no sēdekļa.",
"Preses vadības panelis ir aprīkots ar sarkanu avārijas apturēšanas pogu."
],
"additionalTerms": {
"vadības panelis": [
"juhtpult"
]
}
}

The mapping applies to both items in text. The entries in the response's translations array remain in the same order as the source segments.

For example, the terminology guidance can change the selected word while preserving the rest of the sentence:

RequestExample translation
Without the mappingKraana juhtpaneel asub kabiinis istmest paremal.
With vadības panelis → juhtpultKraana juhtpult asub kabiinis istmest paremal.

Use termCollections when the terminology is stored as a reusable glossary on the Tilde MT platform. Use additionalTerms when the calling application supplies the mappings for a particular request.

additionalTerms is translation guidance, not a find-and-replace operation. The service may adapt a term to the grammar of the sentence, and the requested wording is not guaranteed in every context. Batch together segments for which the same terminology is appropriate. Review the intended term, its grammatical form, the surrounding meaning, and related concepts where the term should not appear.

Guide translations with few-shot examples​

Use examples to send approved source and target text pairs with the text to translate. Each pair demonstrates a choice the service can apply to similar content.

Use caseWhat an example can demonstrate
Product and brand namesThat Compass is an application name rather than the physical instrument.
Ambiguous words or abbreviationsWhether claim means a request for compensation or an assertion, or whether POC means a contact person or a proof of concept.
Tone and formalityFormal or informal address, or the preferred tone for support replies.
Domain-specific wordingThe intended meaning and phrasing for a particular subject area.
Formatting conventionsHow similar labels, placeholders, or recurring sentence patterns should be handled.

The following request provides one English-to-Latvian example showing that Compass is a product name:

Example request with examples
{
"srcLang": "en",
"trgLang": "lv",
"text": [
"To send a waypoint, tap the share icon in Compass."
],
"examples": [
{
"sourceText": "To view the map, open Compass.",
"targetText": "Atveriet lietotni Compass, lai skatītu karti."
}
]
}

Each item in examples contains the following fields:

FieldTypeDescription
sourceTextStringAn approved example in the request's source language.
targetTextStringIts translation in the request's target language.

The pair must match the language direction specified by srcLang and trgLang. You can send up to 50 pairs, and each sourceText and targetText value must contain 1–100,000 characters.

Examples apply to every item in the request's text array. They are not saved for later requests. Send them again whenever they are needed, and batch together only text for which the same examples are relevant.

Choose effective examples​

  1. Start with one short, approved pair. Choose a natural translation that clearly demonstrates the intended behavior.
  2. Match the new content. Use examples with the same language direction, subject, audience, and purpose as the text to translate.
  3. Add only useful variations. Add another pair when it demonstrates a different grammatical form or a distinct context. More examples are not automatically better.
  4. Keep the guidance consistent. Avoid examples that demonstrate conflicting meanings, terminology, levels of formality, or formatting conventions.
  5. Use non-sensitive data. Do not put personal or confidential information in examples. Apply deterministic masking in your application before sending sensitive values.

Relevant context matters. An insurance example can guide claim toward a request for compensation, while a journalism example can guide the same word toward an assertion. An unrelated example can therefore introduce the wrong meaning into the translation.

Examples can also affect more than the intended word or style choice. Check facts and grammar even when the desired wording appears. Do not rely on examples alone to preserve placeholders, identifiers, code, URLs, or HTML.

Use terminology and examples together​

You can include additionalTerms and examples in the same request. Use the same preferred target wording in the terminology mapping and in every relevant targetText.

Example request with terminology and examples
{
"srcLang": "lv",
"trgLang": "et",
"text": [
"Šķirošanas iekārtas vadības panelis ir piestiprināts pie rāmja ar četrām skrūvēm."
],
"additionalTerms": {
"vadības panelis": [
"juhtpult"
]
},
"examples": [
{
"sourceText": "Piltuves vadības panelis ir uzstādīts blakus pārbaudes lūkai.",
"targetText": "Punkri juhtpult on paigaldatud kontroll-luugi kõrvale."
}
]
}

Avoid conflicts between termCollections, additionalTerms, and examples. If guidance overlaps, test the result with your content instead of relying on an assumed precedence.

Validate customized translations​

Before using terminology or examples in production:

  1. Translate representative input with and without the guidance while keeping the language direction, domain, engine, and other options unchanged.
  2. Check the requested wording and the meaning of the surrounding sentence.
  3. Include cases where the terminology or demonstrated choice should not apply.
  4. Verify names, identifiers, placeholders, numbers, dates, units, negation, and timing separately.
  5. Check code, URLs, HTML structure, and other required literals with application-level validation.
  6. Test the grammatical forms, content types, and complete text batches used in production.
  7. Repeat the checks whenever you add, remove, rewrite, or reorder examples.

Terminology and examples guide translation; they are not protection mechanisms for exact tokens, markup, or sensitive values. Preprocess values that require deterministic handling and validate required literals in your application.

Responses​

200 - OK​

Example value
{
"domain": "string",
"translations": [
{
"translation": "string"
}
],
"detectedLanguage": "string"
}

400 - Missing or incorrect parameters​

This error occurs when a required parameter of the request is missing or one of the specified parameters is not supported, is misspelled, or the value is wrong.

404 - Language direction is not found​

This error occurs when the requested language direction is not supported or available. Refer to the supported language list and check your access key configuration on the Tilde MT platform if you've limited it to specific translation languages.

413 - Maximum text size limit reached for the request​

This error occurs when the request size reaches the size limit.

To avoid request size limits and potential timeouts, segment large text bodies into smaller chunks (like paragraphs or sentences) and send each in a separate API call.

429 - Too many requests​

If you receive this error, retry the request after a short delay. If it persists, progressively increase the delay between retries until the request is successful.

500 - An unexpected error occured​

50X are internal errors. You should contact support and provide as much detail as possible about the request, including the data sent and the time of the error, so we can investigate.

504 - Request timed out​

To avoid potential timeouts, segment large text bodies into smaller chunks (like paragraphs or sentences) and send each in a separate API call. If the error persists contact support.


Translate files​

Tilde MT API supports the following file formats: .docx, .doc, .docm, .xlsx, .pptx, .pdf, .odt, .odp, .ods, .txt, .rtf, .pages, .sxw, .jpg, .jpeg, .png, .bmp, .sdlxliff, .sdlxlf, .ttx, .tmx, .xlf, .xlif, .xliff, .html, .htm, .json, .xhtml, .xht, .tex, .srt. Maximum file size is 25MB.

Methods​

MethodTypeDescription
/translate/filePOSTUploads file and creates translation task. Returns task id, status and other details.
/translate/file/{task}GETGets details about translation task including translation status.
/translate/file/{task}/{file}GETDownloads the translated file associated with the translation task.

Step 1: Upload file​

To translate a file you'll make a POST multipart/form-data request to the /translate/file endpoint. The request uploads a file and creates a file translation task. It is queued for translation and the call returns the task id. The id is used in further requests to query the translation status and download the translated file.

Example request
curl -X 'POST' \
'{BASE_URL}/api/translate/file' \
-H 'accept: text/plain' \
-H 'Content-Type: multipart/form-data' \
-H 'X-Api-Key: YOUR_API_KEY' \
-F 'file=@my_example_file.docx;type=application/vnd.openxmlformats-officedocument.wordprocessingml.document' \
-F 'srcLang=en' \
-F 'trgLang=lv' \
-F 'domain=tildeopen' \
-F 'engineId=' \
-F 'options.breakSegmentsOnBr=true'
Example response
{
"id": "17fcb9d6-2e5e-437e-ab7a-57c94f86ef72", //Task ID
"userId": "YOUR_API_KEY",
"srcLang": "en",
"trgLang": "lv",
"domain": "tildeopen",
"engineId": "b7657380-8e1b-498e-89bd-a39bae2b3086",
"fileName": "my_example_file.docx",
"createdAt": "2025-06-09T06:17:57.9042898Z",
"status": "Queuing",
"substatus": "Unspecified",
"segments": 0,
"translatedSegments": 0,
"files": [],
"options": {
"breakSegmentsOnBr": false
},
"pdfPageLimit": 0,
"translationCharacterLimit": 0,
"termCollections": []
}

Request body fields​

Request body should contain the following fields:

ParameterTypeRequiredDescription
fileForm Field (File)YesThe document file to be translated. e.g. @my_example_file.docx
srcLangForm Field (String)YesThe language code for the source document (e.g., en for English).
trgLangForm Field (String)YesThe language code for the target translation (e.g., lv for Latvian).
domainForm Field (String)NoSpecifies a translation domain (e.g., general, general ai, tildeopen, custom).
engineIdForm Field (String)NoThe ID of a specific, custom translation engine. Leave empty to use the default engine for the language pair.
options.breakSegmentsOnBrForm Field (Boolean)NoIf true, the system will create a new sentence segment at each <br> tag found in the source text.

Responses​

200 - OK​

Example response
{
"id": "TASK_ID",
"userId": "YOUR_API_KEY",
"srcLang": "string",
"trgLang": "string",
"domain": "string",
"engineId": "string",
"fileName": "string",
"createdAt": "timestamp",
"status": "Queuing",
"substatus": "Unspecified",
"segments": 0,
"translatedSegments": 0,
"files": [],
"options": {
"breakSegmentsOnBr": boolean
},
"pdfPageLimit": 0,
"translationCharacterLimit": 0,
"termCollections": []
}

400 - Missing or incorrect parameters​

This error occurs when a required parameter of the request is missing or one of the specified parameters is not supported, is misspelled, or the value is wrong.

404 - Language direction not found​

This error occurs when the requested language direction is not supported or available. Refer to the supported language list and check your access key configuration on the Tilde MT platform if you've limited it to specific translation languages.

415 - File type is not supported​

This error occurs when the requested file format is not supported. Refer to the supported file format list.

500 - Internal translation error occured​

50X are internal errors. You should contact support and provide as much detail as possible about the request, including the data sent and the time of the error, so we can investigate.

Step 2: Check the status and wait for translation complete​

To get the translation status you'll make a GET request to the /translate/file/{task} endpoint.

We recommend polling the document status with regular intervals and wait for status Completed. Translation time depends on the size of the file and load of the translation engine. Image and .pdf files take longer to process as they are first converted into a translatable format.

Translation status values can be: Queuing, Extracting, Translating, Saving, Completed, Error.

Translated file id will be included in the response once translation is completed, use it in the next step for download.

Example request
curl -X 'GET' \
'{BASE_URL}/api/translate/file/{task_id}' \
-H 'accept: text/plain' \
-H 'X-Api-Key: YOUR_API_KEY'
Example response
{
"id": "3c2c1c71-099c-4ff0-91fc-55943c7bdcd2",
"userId": "YOUR_API_KEY",
"srcLang": "en",
"trgLang": "lv",
"domain": "tildeopen",
"engineId": "b7657380-8e1b-498e-89bd-a39bae2b3086",
"fileName": "my_example_file.docx",
"createdAt": "2025-06-09T07:50:06.421735",
"status": "Completed",
"substatus": "Unspecified",
"segments": 69,
"translatedSegments": 69,
"files": [
{
"id": "c7ce3ec7-cd78-4bbc-8190-7233d7da279d",
"extension": ".docx",
"category": "Source",
"size": 19569
},
{
"id": "fc2fe80a-7933-4437-94ec-67c0c494745e", //Translated file ID
"extension": ".docx",
"category": "Translated",
"size": 17956
}
],
"options": {
"breakSegmentsOnBr": false
},
"pdfPageLimit": 0,
"translationCharacterLimit": 0,
"termCollections": []
}

Step 3: Download translated file​

Once the status of translation process is Completed, the translated file can be downloaded. Make a GET request to /translate/file/{task}/{file} endpoint.

Example request
curl -X 'GET' \
'{BASE_URL}/api/translate/file/{TASK_ID}/{TRANSLATED_FILE_ID}' \
-H 'accept: text/plain' \
-H 'X-Api-Key: YOUR_API_KEY'

Detect language​

To detect the language of a text, you'll make a POST request to the /language endpoint. This endpoint analyzes the provided text and returns the detected language along with a confidence score. The request body must be in JSON format (application/json).

Example request
curl -X 'POST' \
'{BASE_URL}/api/language' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: YOUR_API_KEY' \
-d '{"text":"nosaki valodu"}'
Example response
{
"languages": {
"lv": 1,
"sl": 0,
"hr": 0
},
"detectedLanguage": "lv"
}

Request Parameters​

The main object in your request body should contain the following field:

ParameterTypeRequiredDescription
textStringYesThe text for which to detect the language

Response Parameters​

The response object will contain the following fields:

ParameterTypeDescription
languagesObjectAn object where keys are language codes and values are the confidence scores (0 to 1).
detectedLanguageStringThe language code of the language with the highest confidence score.