create_glossary | Create a glossary of preferred translations, usable afterwards via translate_text’s glossary_id. Arguments: name (string, required — the glossary name), dictionaries (array of objects, required — one object per language pair, each with source_lang and target_lang as lowercase two-letter codes, entries as a string holding the term pairs, and entries_format “tsv” (tab-separated, default) or “csv”). Example entries value in tsv: “Hallo\tHello” with one pair per line. |
translate_text | Translate one or more plain-text strings into a target language. Billed per character. Arguments: text (array of strings, required — each string is translated independently, translations come back in the same order; UTF-8 plain text only, 128 KiB per request), target_lang (string, required — target language code, e.g. “FR”, “DE”, “EN-GB”; call list_languages to discover valid codes), source_lang (string, optional — source language code; omit it and DeepL detects the language), context (string, optional — extra context that influences the translation but is not translated and is not billed), formality (“default” | “more” | “less” | “prefer_more” | “prefer_less”, optional — only some target languages support it; the “prefer_” forms never fail on unsupported languages), glossary_id (string, optional — glossary to apply; requires source_lang, and the glossary must contain a dictionary for that language pair), preserve_formatting (boolean, optional — default false; keep the original formatting instead of correcting it), tag_handling (“xml” | “html”, optional — treat the text as markup and translate only its text nodes). |