Raw machine translation on every request is simple — and expensive, slow, and inconsistent.
One-shot MT
Typical loop:
request → translate whole payload → respondProblems:
- Latency and MT cost on every hit
- No memory — wording can drift run to run
- No shared key with your routes — agents invent resource ids
- Hard to skip SKUs, ids, and brand strings cleanly across calls
Modelocale
ensure(endpoint_url, lang, data) → remember localized JSON
get(endpoint_url, lang) → cache-fast read, no MTYou still use MT — but only on misses and source changes, not on every GET. The identity is your URL (endpoint_url), scoped to your project.
That matches how vibe coders and agents already think: “give me /v1/menus in fr.”
When one-shot still wins
Throwaway scripts, one-off docs, or content you will never re-fetch. For a live API that serves the same locales repeatedly, ensure/get is the better fit.
More detail: Concepts.