Manual
CLI
API
Log in Get started free

Suggest a translation

Asks a machine translation service, with the organisation's own key, for a machine translation of a key's source text. Nothing is saved.

Asks a machine translation service for a machine translation of the source text of a key. The suggestion is only returned: save it to keep it. Needs a key for at least one service, see Machine translation.

HTTP
POST /keys/{keyId}/translations/{language}/suggestion

Access: Session token, or an API key with the translations:write scope.

Role: Translator or higher in the project.

What is sent #

The source text of this one key, with placeholders and HTML tags swapped for markers and restored afterwards, and the two language codes. AI models also get a fixed instruction on how to translate. Nothing else: no key name, notes, other strings or user data. Messages with ICU plural or select blocks are refused instead of sent.

Path parameters #

ParameterDescription
keyIdThe id of the key.
languageThe target language code, such as de-de. It must be an active language of the project.

Request body #

FieldTypeRequiredDescription
providerstringnoThe service to ask, for example deepl. Left out, the organisation’s default service is used.

Response 200 #

JSON
{
  "text": "Hallo {name}, Sie haben 3 neue Nachrichten",
  "provider": "deepl",
  "characters": 54,
  "usage": { "period": "2026-10", "characters": 1334, "requests": 15, "limit": 500000 }
}

provider is the service that answered. characters is what this request added to that service’s count for the month. Request failures are not counted.

Errors #

Every failure leaves everything unchanged. The body never repeats what the service answered, and none of these is a 401 or 403, which would sign a person out.

StatuserrorWhen
401unauthenticatedThe token is missing or not valid.
403forbiddenYour role in the project is below translator.
404not_foundThe key or an active language does not exist, or you have no access to the project.
409mt_not_configuredThe organisation has no key for the service (or for any service when provider is left out).
409mt_key_rejectedThe service refused the key. An admin has to replace it. Other services are not affected.
409mt_limit_reachedThe monthly limit of that service would be passed. limit is in the response.
409mt_provider_quotaThe service’s own quota is used up.
409mt_suggestions_offThe project switched suggestions off.
409branch_frozen, project_frozenThe branch or project is frozen.
422mt_source_emptyThe key has no source text.
422mt_icu_unsupportedThe message has ICU plural or select blocks.
422invalid_requestfields.provider is invalid: not a service we know.
422mt_model_unknownThe service does not know the model that is set.
422mt_language_unsupportedThe service does not support the language pair.
422mt_placeholders_changedThe service changed or dropped a placeholder; the suggestion was discarded.
422mt_text_too_long, mt_request_refusedThe service refused the text.
429mt_provider_rate_limitedThe service is receiving too many requests.
502mt_provider_unavailable, mt_provider_invalid_answerThe service could not be reached or answered with something unusable.

See Errors for the error format.