Skip to main content
In this tutorial, you’ll improve text with DeepL API for Write: rephrase a text for clarity, run a corrections-only pass that keeps the author’s voice intact, and change the writing style. By the end, you’ll have used both Write endpoints and know when to pick which. Unlike translation, Write improves text within a language: the source text and target_lang must be the same language (improving and translating in one request is not yet supported).

Prerequisites

Building with an AI coding agent?

Wire it up to the DeepL Docs MCP Server so it can search and read this documentation while it writes code. In Claude Code:
Then describe what you want to build. To get the same result as this tutorial, paste:
Setup instructions for Claude Desktop, Cursor, VS Code, and other MCP clients are on the Docs MCP Server page.

Step 1: Rephrase a text

The /v2/write/rephrase endpoint is Write’s broad improvement mode: it fixes spelling and grammar, and may also rewrite sentences for clarity, style, or tone.
Sample request
Sample response
The text parameter is an array, so you can improve multiple texts in one request; improvements come back in the same order. The total request body is limited to 10 KiB, so split larger workloads across multiple calls. target_lang currently supports de, en-GB, en-US, es, fr, it, ja, ko, pt-BR, pt-PT, and zh/zh-Hans. To check programmatically, call GET /v3/languages?resource=write.
You can convert between variants of the same language: sending American English text with target_lang set to en-GB improves the text and converts it to British English.

Step 2: Fix errors only, keeping the author’s voice

When you want corrections without rewrites, use the /v2/write/correct endpoint instead. It fixes spelling and grammar with minimal changes to wording, matching the “Corrections Only” mode in the DeepL Translator UI.
Sample request
Sample response
Compare the two results: /write/correct fixed the errors but kept the original phrasing (“edits on this text”), while /write/rephrase also reworded the sentence.

Step 3: Change the writing style

On /write/rephrase, the writing_style parameter steers how the text is rewritten:
Sample request
Sample response
Alternatively, the tone parameter adjusts how the text sounds (friendly, confident, diplomatic, and more). A request can include writing_style or tone, but not both. For all available values, per-language support, and the prefer_ fallback behavior, see Controlling Writing Style and Tone.

Next steps

You’ve now used both Write endpoints and steered the output style. To keep going: