Page cover image

DeepL API for Write Beta (Q4 2024)

Working with DeepL API for Write to improve text

About the DeepL API for Write beta

Thank you for participating in the DeepL API for Write beta program. Please note that at this time, DeepL API for Write has been released as a beta feature. In short, this means DeepL API for Write is currently:

  • Not allowed to be used in production

  • Could be deprecated by DeepL at any time and without advance notice

  • Could be changed in a way that breaks API clients relying on them at any time and without advance notice

The DeepL API for Write beta endpoint will be disabled when the beta program concludes (at the latest November 15, though possibly sooner).

You can learn more about alpha and beta features here. We ask that you read that page before getting started with the DeepL API for Write beta.

Accessing the DeepL API for Write during the beta

If you are an existing DeepL API customer, please do not use your existing API subscription to test DeepL API for Write.

Your DeepL point-of-contact will provide you with a dedicated demo account for testing DeepL API for Write.

DeepL API for Write overview

DeepL API for Write currently consists of a single endpoint for text improvement, /write/rephrase, which is described below. The text improvement feature is currently only available to Pro API customers and is not yet available in the Free API.

For more detail about request body parameters, see the Request body descriptions section further down the page.

And for an example cURL request and response, see here.

The total request body size for text improvement requests must not exceed 128 KiB (128 · 1024 bytes). Please split up your text into multiple calls if it exceeds this limit.

Example cURL request and response

These examples are for demonstration purposes only. In your code, the authentication key should not be hard-coded but instead fetched from a configuration file or environment variable.

Example cURL request
curl -X POST 'https://api-write-beta.deepl.com/v2/write/rephrase' \
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]' \
--header 'Content-Type: application/json' \
--data '{
  "text": [
    "I could relly use sum help with edits on thiss text !"
  ],
  "target_lang": "en-US"
}'
Example response
{
  "improvements": [
    {
      "text": "I could really use some help with editing this text!",
      "target_language": "en-US",
      "detected_source_language": "en"
    }
  ]
}

Request body descriptions

Body Parameter
Description

text (required)

Text to be improved. Only UTF-8-encoded plain text is supported. The parameter may be specified multiple times and improvements are returned in the same order as they are requested. Each of the parameter values may contain multiple sentences.

Type: array[string]

target_lang (optional)

The language of the improved text. A list of supported languages have not yet been added to the /languages endpoint. At the time of the beta, the following languages are supported:

  • de (German)

  • en-GB (British English)

  • en-US (American English)

  • es (Spanish)

  • fr (French)

  • it (Italian)

  • pt-BR (Brazilian Portuguese)

  • pt-PT (Portuguese)

The language sent in the text parameter should match the target language (translating and improving text simultaneously is not yet supported).

Note that it is possible to convert text from one variant to another within a language. For example, if American English is sent in an API request with target_lang set to EN-GB, the submitted text will be improved and also converted to British English.

Type: string

writing_style (optional)

Changes the writing style of your improvements.

Supported values:

  • simple

  • business

  • academic

  • casual

  • default

Currently supported for the following target languages:

  • de

  • en-GB

  • en-US

Type: enum

It’s not possible to include both writing_style and tone in a request; only one or the other can be included.

tone (optional)

Changes the tone of your improvements.

Supported values:

  • enthusiastic

  • friendly

  • confident

  • diplomatic

  • default

Currently supported for the following target languages:

  • de

  • en-GB

  • en-US

Type: enum

It’s not possible to include both writing_style and tone in a request; only one or the other can be included.

Response

The /write/rephrase endpoint returns a JSON representation of improvements in the order the text parameters have been specified. The detected language is also returned.

Last updated