Developers
One contract, three transports.
The same request and response shape everywhere: a local REST daemon on your machine (default, private), a hosted convenience API, and MCP tools for AI agents. The default execution target is your hardware — the hosted tier is the fallback, not the product.
Local REST — traxlate serve
One binary, loopback only. Everything runs on your machine; nothing leaves it. Optional bearer token via TRAXLATE_SERVE_TOKEN.
traxlate serve 8027
# traxlate serving on http://127.0.0.1:8027 (on-device)POST /translate
curl -s http://127.0.0.1:8027/translate \
-H 'content-type: application/json' \
-d '{"text":"Ship it before Friday.","target":"fa"}'{
"translation": "…",
"source": "eng_Latn",
"target": "fas_Arab",
"provenance": "on-device",
"seconds": 0.84,
"warnings": []
}Request fields: text (or texts: string[] for a batch, 64 max — returns {"results": [...]}), target (required), source (optional; auto-detected, default eng_Latn when uncertain), tier ("fast" = primary engine + guards, "best" = highest quality, the default), glossary (optional; [{term, translation, caseSensitive?}], 200 max — each term is kept verbatim as your chosen translation; omitted, the daemon applies your ~/.traxlate/glossary.json). Body limit 2 MB.
GET /health · GET /languages
curl -s http://127.0.0.1:8027/health # {"ok":true,"engine":{...}}
curl -s http://127.0.0.1:8027/languages # [{"flores":"eng_Latn","bcp47":"en","name":"English","rtl":false}, ...]Errors are JSON with an error string: 400 missing target / missing text or texts / batch too large (64 max) / unknown language code "xx"; 401 unauthorized when a token is set and missing.
Hosted API — POST /api/v2/translate
Identical contract to the local daemon, with one honest difference: provenance is "server" — this tier runs on our hardware, and says so. Auth is a bearer API key (create one under Account → API keys).
curl -s https://traxlate.com/api/v2/translate \
-H 'authorization: Bearer YOUR_API_KEY' \
-H 'content-type: application/json' \
-d '{"texts":["Hello","Goodbye"],"target":"de","source":"en"}'{
"results": [
{ "translation": "…", "source": "eng_Latn", "target": "deu_Latn",
"provenance": "server", "seconds": 0.61, "warnings": [] },
{ "translation": "…", "source": "eng_Latn", "target": "deu_Latn",
"provenance": "server", "seconds": 0.58, "warnings": [] }
]
}Creating a hosted API key needs Traxlate Pro — this is the one endpoint that runs the engine on our servers instead of your device. Translating on your own machine, through the app or the local API, is free within your page allowance — no per-character billing and no hosted-API quota.
Quota: a durable per-key daily character budget (default 200,000 chars/day; per-key limits configurable). Exceeding it returns 429 {"error":"daily character quota exceeded","remaining":n,"limit":n}. Batches are capped at 64 texts (400). Upstream failures surface as 429/502/504 with an error body — never a silent empty string. GET /api/v2/languages is public (no key) and returns the same rows as the local /languages.
MCP — Traxlate inside your AI agent
traxlate-mcp is a stdio MCP server exposing the on-device pipeline to any agent. Everything runs locally; the structured result always includes provenance.
claude mcp add traxlate -- traxlate-mcptranslate—{text, target, source?, tier?}→{translation, source, target, provenance: "on-device", seconds, warnings}detect_language—{text}→{flores, bcp47, name}(flores: nullwhen uncertain)list_languages— →[{flores, bcp47, name, rtl}]engine_status— native engine install state: platform support, binary/model paths, daemon livenessglossary_add/glossary_list— manage the user glossary (terms kept verbatim, optionally scoped to a language pair); it applies automatically to every translate calltranslate_batch— many strings in one call, one pack load instead of Ntranslate_file— a document by path, format preservedocr_translate— text out of an image, then translated
Language codes
Every surface accepts BCP-47 (fa, de, zh) or FLORES-200 (fas_Arab, deu_Latn, zho_Hans) and answers in canonical FLORES. Unknown codes are a typed 400 error, never a silent fallback — call /languages (or the list_languages MCP tool) for the live table.
