Plus plan

Translate

Translate a document into another language
POST
/v1/ai/documents/translate

About this tool

This tool translates the text of your document into the language you choose and keeps the meaning. You can add up to 5 documents or paste text, say which language the text is in, and add a glossary, which is a list of words that must always be translated your way. The result is text, not a copy of the page design. An AI translates, so check important texts.
For example, you have a contract in German and want to read it in English.

How to use it

  1. Choose this tool.
  2. Add up to 5 documents with Upload or drag and drop, or paste your text.
  3. Choose the language to translate into, and the original language if you know it.
  4. Optionally add a glossary of words with the translation you want.
  5. Press Generate, then copy or download the translation.

What you get back

You get the translated text on screen. You can copy it or download it.
TEST IT LIVE

Try Translate in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
AI
Plan
Plus
Method
POST
Endpoint
/v1/ai/documents/translate
Tool ID
ai.documents.translate
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Ai
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/ai/documents/translate" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'on_unsupported=error' \
  -F 'quality=standard' \
  -F 'target_language=xx'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.ai.documents.translate({
    "on_unsupported": "error",
    "quality": "standard",
    "target_language": "xx"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->ai()->documents()->translate([
    'on_unsupported' => 'error',
    'quality' => 'standard',
    'target_language' => 'xx',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Translate document text to a target language. Readiness: unbenchmarked (see GET /v1/ai/capabilities/documents.translate).

Classification: hybrid. Deterministic stages: file type detection from content, native PDF text extraction (Poppler), Tesseract OCR for pages without text, page rendering for vision fallback, token budgeting and chunking.

Translate works from text and settings, so no file is needed. The required inputs are target_language.

Not on the Free plan: Translate is available on the Plus plan and above. Free accounts can upgrade any time to use it. Each run uses credits from your monthly allowance.

Send a POST request to /v1/ai/documents/translate with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.