curl --request POST \
--url https://api.deepl.com/v2/translate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"text": [
"Hello, World!"
],
"target_lang": "DE"
}
'{
"translations": [
{
"detected_source_language": "EN",
"text": "Hallo, Welt!",
"billed_characters": 42,
"model_type_used": "quality_optimized",
"tag_handling_version": "v2"
}
]
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}Translate text
Translate text between any supported language pair, with options for formality, glossaries, tag handling, and context.
curl --request POST \
--url https://api.deepl.com/v2/translate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"text": [
"Hello, World!"
],
"target_lang": "DE"
}
'{
"translations": [
{
"detected_source_language": "EN",
"text": "Hallo, Welt!",
"billed_characters": 42,
"model_type_used": "quality_optimized",
"tag_handling_version": "v2"
}
]
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}Authorizations
Headers
An optional custom reporting tag used to attribute this request's usage to a team, project, customer, or other category of your choosing. Values are limited to 100 characters. See How to use custom reporting tags for validation rules, naming guidance, and how to retrieve usage by tag.
100Body
Text to be translated. Only UTF-8-encoded plain text is supported. The parameter may be specified many times in a single request, within the request size limit (128KiB). Translations are returned in the same order as they are requested. Each text in the array is translated independently — texts do not share context with each other.
The language into which the text should be translated.
For the full list of supported target languages, see supported languages or query the GET /v3/languages endpoint.
"DE"
Language of the text to be translated. If this parameter is omitted, the API will attempt to detect the language of the text and translate it.
For the full list of supported source languages, see supported languages or query the GET /v3/languages endpoint.
"EN"
Sets whether the translation engine should first split the input into sentences.
Possible values are:
- 0 - no splitting at all, whole input is treated as one sentence
- 1 (default when tag_handling is not set to html) - splits on punctuation and on newlines
- nonewlines (default when tag_handling=html) - splits on punctuation only, ignoring newlines
0, 1, nonewlines "1"
Sets whether the translated text should lean towards formal or informal language.
This feature is only available for certain target languages. Setting this parameter
with a target language that does not support formality will fail, unless one of the
prefer_... options are used.
Possible options are:
default(default)more- for a more formal languageless- for a more informal languageprefer_more- for a more formal language if available, otherwise fallback to default formalityprefer_less- for a more informal language if available, otherwise fallback to default formality
default, more, less, prefer_more, prefer_less "prefer_more"
Specify the glossary to use for the translation. The glossary needs a dictionary for the language pair of the request.
If source_lang is omitted, DeepL detects the source language and uses the dictionary for
the detected language pair. The request returns a 400 if the glossary has no dictionary
for that pair.
Cannot be used together with glossary_ids.
"def3a26b-3e84-45b3-84ae-0c0aaf3525f7"
Specify up to 5 glossaries to use for the translation, as an array of glossary IDs. Each glossary's matching terms are applied to the translation.
Every listed glossary must contain a dictionary for the requested language pair.
If source_lang is omitted, DeepL detects the source language and every listed glossary must
contain a dictionary for the detected language pair. A single glossary without a matching
dictionary returns a 400 for the whole request.
Cannot be used together with glossary_id.
5Specify the style rule list to use for the translation.
Important: The target language has to match the language of the style rule list. A list
created for a root language (for example en) applies to that language and all of its variants
(EN-GB, EN-US). A list created for a variant (for example en-GB) applies only when
target_lang is that variant.
All model_type values are supported.
"7ff9bfd6-cd85-4190-8503-d6215a321519"
Translate with a style profile: its glossaries, style rule lists and translation memories through one ID. The profile is applied per text once the source language is known: the glossaries with a dictionary for the text's language pair, the style rule list for the target language, and the translation memories whose source language matches the text. A component that does not fit a text's language pair is left out for that text; this is not an error.
Cannot be combined with glossary_id, glossary_ids, style_id, translation_memory_id,
translation_memory_threshold or custom_instructions. A request that combines them is rejected
with 400 Bad Request. A style profile that does not exist or that your account cannot access is
rejected with 404 Not Found.
"3f1c9d0e-7a24-4b58-9c31-8f0e5d2a1b47"
Sets which version of the tag handling algorithm should be used. Options currently available:
v1: Traditional algorithm (will become deprecated in the future).v2: Improved algorithm released in October 2025. This is the default.
The tag_handling_version field in the response shows which version was applied.
v2, v1