Skip to content

Commit acedc01

Browse files
Add custom_instructions parameter to text translation (#188)
1 parent 5efa03c commit acedc01

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

api-reference/openapi.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,17 @@ paths:
406406
**Note:** Any request with the `style_id` parameter enabled will use `quality_optimized` models. Requests combining `style_id` and `model_type: latency_optimized` will be rejected.
407407
type: string
408408
example: 7ff9bfd6-cd85-4190-8503-d6215a321519
409+
custom_instructions:
410+
description: |-
411+
Specify a list of instructions to customize the translation behavior. Up to 10 custom instructions can be specified, each with a maximum of 300 characters.
412+
413+
**Important:** The target language must be `de`, `en`, `es`, `fr`, `it`, `ja`, `ko`, `zh` or any variants of these languages.
414+
415+
**Note:** Any request with the `custom_instructions` parameter enabled will default to use the `quality_optimized` model type. Requests combining `custom_instructions` and `model_type: latency_optimized` will be rejected.
416+
type: array
417+
items:
418+
type: string
419+
example: "Use a friendly, diplomatic tone"
409420
tag_handling:
410421
$ref: '#/components/schemas/TagHandlingOption'
411422
tag_handling_version:

api-reference/translate.mdx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,20 @@ Note that we do not include examples for our client libraries in every single se
282282
</ParamField>
283283
<ParamField body="style_id" type="string">
284284
Specify the style rule list to use for the translation which can be used to customize translations according to the selected formatting and style conventions.
285-
<Note>
285+
<Info>
286286
The target language has to match the language of the style rule list.
287287

288-
Additionally, any request with the `style_id` parameter enabled will use `quality_optimized` models. Requests combining `style_id` and `model_type: latency_optimized` will be rejected.
289-
</Note>
288+
Additionally, any request with the `style_id` parameter enabled will default to use the `quality_optimized` model type. Requests combining `style_id` and `model_type: latency_optimized` will be rejected.
289+
</Info>
290+
</ParamField>
291+
<ParamField body="custom_instructions" type="array[string]">
292+
Specify a list of instructions to customize the translation behavior. Up to 10 custom instructions can be specified, each with a maximum of 300 characters.
293+
294+
<Info>
295+
The target language must be `de`, `en`, `es`, `fr`, `it`, `ja`, `ko`, `zh` or any variants of these languages.
296+
297+
Any request with the `custom_instructions` parameter enabled will default to use the `quality_optimized` model type. Requests combining `custom_instructions` and `model_type: latency_optimized` will be rejected.
298+
</Info>
290299
</ParamField>
291300
<ParamField body="show_billed_characters" type="boolean">
292301
When <code>true</code>, the response will include an additional key-value pair with the key <code>billed_characters</code> and a value that is an integer showing the number of characters from the request that will be counted by DeepL for billing purposes.

docs/resources/roadmap-and-release-notes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ rss: true
66

77
<Update label="In active development">
88
- Add more events to audit logs for Pro API customers (API key management, cost control and usage limit changes)
9-
- Add a new parameter to the text translation API to allow custom instructions, making it possible to customize the translation behavior (e.g. ["Use a friendly, diplomatic tone"])
109
</Update>
1110

1211
<Update label="Q4 2025">
@@ -19,6 +18,7 @@ rss: true
1918
- Added support for 75 new languages, initially through the `enable_beta_languages` parameter, for text and document translation. Beta languages are not billed during the beta phase and do not yet support glossaries or formality. See [here](../getting-started/supported-languages#beta-languages) for more information
2019
- Added HE, TH and VI to the languages endpoint, since they are now also available in document translation
2120
- Added 6 additional beta languages, for text and document translation. See the previous note about 75 new languages.
21+
- Added a new parameter to the text translation API to allow custom instructions, making it possible to customize the translation behavior (e.g. ["Use a friendly, diplomatic tone"])
2222
</Update>
2323

2424
<Update label="Q3 2025">

0 commit comments

Comments
 (0)