Skip to main content

i18n

Sellable product

This capability is granted by an API key scoped to the `` product (product face). See the product reference below.

Multi-provider translation + UI-string i18n capability. Machine translation over a provider fallback chain (LibreTranslate | LLM | Bhashini | Stub) with H2 breaker/retry/timeout; language detection (langdetect + Unicode heuristic); a UI-string dictionary registry with a 3-level fallback chain (locale -> 'en' -> raw key); RTL/locale metadata; and entity-content translation (generalizes translate-article). Every endpoint carries organization_id (I6 product-tier tenant); MT output is org-namespaced so tenants never share a cached translation.

  • Group: Governance & platform
  • Contract: contracts/i18n/v1/openapi.yaml
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/i18n/translate

Endpoints

MethodPathSummary
GET/healthliveness + provider readiness (open, tailnet-scoped)
GET/metricsPrometheus text exposition (open, tailnet-scoped)
POST/v1/i18n/translatemachine-translate text over the provider fallback chain (cached, org-namespaced)
POST/v1/i18n/translate/batchmachine-translate a batch of texts (cap 100), same source/target
GET/v1/i18n/languageslanguages supported for machine translation (live from provider, else static union)
POST/v1/i18n/detectdetect the language of a text (langdetect + Unicode heuristic fallback)
GET/v1/i18n/localesavailable UI-string locales + supported-language display metadata (RTL/flag/name)
GET/v1/i18n/locales/&#123;locale&#125;the merged UI-string bundle for a locale (locale dict over the 'en' fallback dict)
POST/v1/i18n/translate-entitytranslate a product ENTITY's named text fields, cached by (org, entity_type, entity_ref, target). Generalizes platform's translate-article. The product SUPPLIES the fields (I1/I4 — core never fetches from a product DB); on a cache HIT the fields may be omitted.

Schemas

Error

FieldTypeDescription
errorstringstable machine code (slug), e.g. validation_error, unauthorized, payload_too_large
reasonstringhuman-readable one-line explanation (no secrets/PII)
detailobject
request_idstring

Generated by scripts/gen-capability-docs.py from contracts/i18n/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.