Translation Memory
Overview​
Translation Memory (TM) is your account's own store of translations. You can import into it, search it, export it, and clear it through the endpoints below. It is per-account and fully isolated: no other account can read yours.
Separately from TM, repeated translations are reused automatically. When your account translates the exact same text to the same language again within an hour, the stored result is returned immediately and is not billed. See Billing below.
Enabling Translation Memory​
Add translationMemory: true to your translate request:
{
"q": "Hello world",
"target": "nl",
"translationMemory": true
}
Default behavior:
- API requests: TM is off by default (backwards compatibility)
- To enable, set
translationMemory: trueexplicitly
How repeated translations are reused​
- You send a translation request.
- If your account translated that exact text to the same target language within the past hour, the stored result is returned immediately.
- Otherwise the text is translated normally and the result is stored for the next hour.
A match has to be exact: the same source text, the same language pair, and the same options (formality, glossary, context, instructions). Change any of those and it counts as a new translation.
Billing​
A repeat within the hour is free. It is not charged, and it does not use up any of the 500,000 characters included each month. Only the first translation of a given text counts.
To make that concrete:
- First request,
"Hello, world!"to Dutch: translated and billed as 13 characters. - Second request, same text and language, ten minutes later: returned from the store, billed as 0 characters.
- Same request again the next day: the hour has passed, so it is translated and billed again.
One nuance worth knowing: reuse is scoped to your own account. If a different account happens to have translated the same sentence, that does not make it free for you, because for your account it is still a first translation.
If an hour is too short for your workload, tell us at support@langbly.com and we will look at what your traffic actually needs.
Limits​
- Maximum 100,000 entries per account
- When the limit is reached, the oldest entries are automatically removed (FIFO)
API endpoints​
Get TM statistics​
GET /v2/translation-memory/stats
Response:
{
"data": {
"totalEntries": 1523,
"totalHits": 4891,
"languagePairs": [
{ "sourceLang": "en", "targetLang": "nl", "entryCount": 1200 },
{ "sourceLang": "en", "targetLang": "de", "entryCount": 323 }
]
}
}
Delete TM entries​
Delete all entries:
DELETE /v2/translation-memory
Delete a specific language pair:
DELETE /v2/translation-memory?sourceLang=en&targetLang=nl
Response:
{
"deleted": 1200
}
Export TM entries​
Retrieve your stored TM entries as JSON. Useful for backup or migrating to another system.
GET /v2/translation-memory/entries
Query parameters (all optional):
| Parameter | Type | Description |
|---|---|---|
sourceLang | string | Filter by source language code (e.g. en) |
targetLang | string | Filter by target language code (e.g. nl) |
limit | number | Max entries to return (default and max: 50,000) |
Example:
curl "https://api.langbly.com/v2/translation-memory/entries?sourceLang=en&targetLang=nl" \
-H "X-API-Key: YOUR_API_KEY"
Response:
{
"data": {
"entries": [
{
"sourceText": "Hello world",
"targetText": "Hallo wereld",
"sourceLang": "en",
"targetLang": "nl"
}
],
"count": 1
}
}
You can convert the JSON output to TMX (Translation Memory eXchange) format for use in other translation tools.
Import TM entries​
Bulk import entries into your translation memory. Duplicate entries (same source text and language pair) are updated with the new target text.
POST /v2/translation-memory/import
Request body:
{
"entries": [
{
"sourceText": "Hello world",
"targetText": "Hallo wereld",
"sourceLang": "en",
"targetLang": "nl"
},
{
"sourceText": "Good morning",
"targetText": "Goedemorgen",
"sourceLang": "en",
"targetLang": "nl"
}
]
}
Entry fields:
| Field | Type | Required | Description |
|---|---|---|---|
sourceText | string | Yes | The original text |
targetText | string | Yes | The translation |
sourceLang | string | Yes | Source language code |
targetLang | string | Yes | Target language code |
Response:
{
"data": {
"imported": 2
}
}
Limits: Maximum 50,000 entries per import request. Entries with empty fields are silently skipped.
Best practices​
- Enable TM for repetitive content: UI strings, product descriptions, support templates
- TM works best with consistent source text. Small changes (capitalization, punctuation) create separate entries
- Combine TM with glossaries for consistent terminology across all translations