This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dws-processor/tools-and-api/pdf-translation-api.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. PDF translation API

PDF translation is experimental. Its request options, its output, and its price can change.

The PDF translation API translates the text of a PDF into another language and returns a PDF with the same number of pages. Pages with a text layer keep their layout. The API first recognizes scanned pages and then translates them. For every option, response, and error, see the API reference.

Translate a PDF

Send the PDF in the file part and the options as JSON in the data part. The response is the translated PDF.

The example below translates document.pdf into German and saves the result as translated.pdf:

Terminal window
curl -X POST https://api.nutrient.io/processor/translate \
-H "Authorization: Bearer your_api_key_here" \
-F file=@document.pdf \
-F data='{"targetLanguage": "de"}' \
-o translated.pdf

A translation can take several minutes. Set your HTTP client’s timeout above 10 minutes, or use asynchronous translation.

With a test API key, the API checks the request and returns a placeholder PDF without translating it.

Options

OptionDefaultDescription
targetLanguageRequiredThe language to translate into, as an ISO 639-1 code.
mirrorLayouttrueApplies only when targetLanguage is ar (Arabic): Mirror the layout of pages with a text layer so they read right to left. Ignored for every other language.
translateTextInImagestrueOn pages with a text layer, also translate the text inside pictures.

targetLanguage accepts ar (Arabic), de (German), el (Greek), en (English), es (Spanish), fr (French), it (Italian), ja (Japanese), nl (Dutch), pl (Polish), pt (Portuguese), ru (Russian), and zh (Chinese). The API rejects an unknown option with status 400.

Partial translations

If the translation of a text block fails validation, the block keeps its original text. The request still returns status 200 and is charged. The X-Nutrient-Untranslated-Blocks response header gives the number of blocks left in the source language. The header is absent when every block was translated.

Limits and pricing

  • A document can have at most 50 pages. A request with a longer document returns status 400.
  • A translation that doesn’t finish within 10 minutes fails with status 504.
  • A translation costs $0.10 per page of the translated PDF. Accounts still on a credits plan pay 1.5 credits per page. Translations that fail or time out aren’t charged. Refer to pricing per tool.

Asynchronous translation

A synchronous request keeps the connection open until the translated PDF is ready, which can take up to 10 minutes. An asynchronous request returns at once with a translation run. You then check the run’s status and download the PDF once the run is done. A run is charged only if it finishes successfully.

Start a run

Send the same request as a synchronous translation, with the Prefer: respond-async header. The API returns status 202 with a JSON description of the run. The Location header gives the path of the status:

Terminal window
curl -X POST https://api.nutrient.io/processor/translate \
-H "Authorization: Bearer your_api_key_here" \
-H "Prefer: respond-async" \
-H "Idempotency-Key: translate-document-42" \
-F file=@document.pdf \
-F data='{"targetLanguage": "de"}'
{
"id": "7KQ1798ESSE966BQNKQJXMQZHF",
"status": "queued",
"createdAt": "2026-11-16T10:00:00Z",
"expiresAt": "2026-11-17T10:00:00Z",
"statusUrl": "/processor/translate/runs/7KQ1798ESSE966BQNKQJXMQZHF"
}

The Idempotency-Key header is optional. Sending the same request again with the same key — for example, after a network error — returns the original run instead of starting a second translation. A request that reuses the key with a different PDF or different options returns status 409.

Check the run’s status

Call GET /processor/translate/runs/{runId} until status is done or error:

Terminal window
curl https://api.nutrient.io/processor/translate/runs/7KQ1798ESSE966BQNKQJXMQZHF \
-H "Authorization: Bearer your_api_key_here"
StatusMeaning
queuedThe run is waiting to start.
runningThe document is being translated.
doneThe translated PDF is ready. The response adds resultUrl and untranslatedBlocks.
errorThe translation failed. The response adds an error object. A failed run isn’t charged.

Download the translated PDF

When the run is done, download the PDF from resultUrl:

Terminal window
curl https://api.nutrient.io/processor/translate/runs/7KQ1798ESSE966BQNKQJXMQZHF/result \
-H "Authorization: Bearer your_api_key_here" \
-o translated.pdf

Downloading the result of a run that isn’t done returns status 409.

How long runs are kept

You can read a run’s status and download its PDF for 24 hours after the run finishes. After that, both requests return status 410. Once the run is deleted, they return status 404. Only your organization can read its runs.

Test API keys can’t start asynchronous runs. Their request returns status 403.

Errors

StatusMeaning
400The file isn’t a PDF, an option is missing or invalid, or the document has more than 50 pages.
402The organization’s balance is too low, or a payment restriction applies.
403A test API key asked for an asynchronous translation.
502The translation failed. It isn’t charged.
504The translation didn’t finish within 10 minutes. It isn’t charged.