Skip to main content

Machine Translation Services

neokapi integrates with external machine translation (MT) services as an alternative to LLM-based translation.

Supported Services

ServiceDescription
DeepLHigh-quality neural machine translation
Google TranslateGoogle Cloud Translation API
Microsoft TranslatorAzure Cognitive Services
MyMemoryFree translation memory API
ModernMTAdaptive machine translation

Configuration

Each MT service is exposed as its own <provider>-translate tool, so the provider is fixed by the tool you run — deepl-translate uses DeepL, google-translate uses Google, and so on. Non-secret options (region, project, formality) are set as step config in a flow definition, which is safe to commit:

steps:
- tool: microsoft-translate
config:
region: westus2

The API key is never read from the .kapi/kapi.yaml recipe. Supply it the same way as for AI translation (if more than one is present, an inline --api-key wins, then a saved --credential, then the environment variable):

  1. Saved credential — store the key once and reference it by name:

    kapi credentials add my-deepl --provider deepl --api-key …
    kapi deepl-translate -i input.html --target-lang fr --credential my-deepl
  2. Inline flag--api-key … for a one-off run.

  3. Per-provider environment variable — used when neither --credential nor --api-key is given (see Environment variables).

Environment variables

When no --credential and no --api-key are supplied, the key falls back to the standard environment variable for the tool's provider. Where two are listed, the first non-empty one wins:

VariableProvider
DEEPL_API_KEYDeepL
GOOGLE_TRANSLATE_API_KEY (then GOOGLE_API_KEY)Google Translate
MICROSOFT_TRANSLATOR_KEY (then AZURE_TRANSLATOR_KEY)Microsoft Translator
MODERNMT_API_KEYModernMT
MYMEMORY_API_KEYMyMemory (optional)

MyMemory works without a key. For the full set of per-provider parameters, see the generated Tool Reference.

Usage

Each MT service is exposed as its own tool, named <provider>-translatedeepl-translate, google-translate, microsoft-translate, modernmt-translate, mymemory-translate. They compose into flows like any other stage. A typical production flow chains TM leverage, an MT pass, and AI refinement:

steps:
- tool: tm-leverage
- tool: deepl-translate
- tool: ai-review
- tool: qa-check

Switching providers is a configuration change — replace deepl-translate with google-translate (or ai-translate) and the rest of the flow is unchanged.

Comparison with AI Translation

FeatureMT ServicesAI Translation
SpeedFaster for bulkSlower per segment
CostPer-character pricingPer-token pricing
QualityConsistentContext-aware
CustomizationLimitedFull prompt control
OfflineNoYes (with Ollama)

Both approaches can be combined in a flow: use MT services for bulk translation and AI for quality review.