Translate text
translateConverts text between 15 languages and detects source per segment, so mixed-language input works; accepts one string or up to 200 contextual segments and returns detected languages and review flags.
Instructions
Translate text into any of 15 languages, from any of them, with Paxa Translate: Thai (th), English (en), Chinese (zh), Japanese (ja), Korean (ko), Arabic (ar), French (fr), German (de), Hindi (hi), Indonesian (id), Malay (ms), Portuguese (pt), Russian (ru), Spanish (es), Vietnamese (vi). The source language is detected per segment, so mixed-language text works; a segment already in the target language comes back unchanged. Accepts one string or up to 200 segments that share context, and returns each translation (numbered for segments) with its detected source language, any review flag, and the credits used. For text in a PDF or image, run ocr_document first. Costs 25 credits per 1000 text characters per rendering (minimum 2 credits), so 1000 characters cost 25 credits, or 50 with alternatives 2; instructions, context, examples, do_not_translate strings, and glossary terms bill at 8 per 1000.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to translate: one string, or an array of segments translated together | |
| format | No | Treat input as plain text, Markdown, or HTML; only the prose of Markdown and HTML is translated, links, code, and tags come back untouched | |
| source | No | Pin the source language only when detection gets it wrong (default "auto", detected per segment). Must differ from target. | |
| target | Yes | The language to write, as its code (see the description). Chinese ("zh") is written in Simplified characters. | |
| context | No | Background that conditions the translation without being translated: the surrounding document, the domain, the audience | |
| examples | No | Style examples: source sentences with their preferred translations, whose tone and phrasing the translation follows. Up to 100 pairs. | |
| glossary | No | Term pairs the translation must use, applied in context (inflected and placed grammatically). Send the whole glossary: terms whose source does not appear in the text are dropped before the request runs and never billed. | |
| formality | No | "auto" (default) matches the tone of the source; "formal" writes the target language's polite written register (polite particles in Thai, the polite form of address where a language has one); "casual" writes conversational language between peers. | |
| alternatives | No | Renderings per segment, best first (default 1). Each one bills the text again and counts against the 20,000-character text limit. | |
| instructions | No | Free-form direction for the translator: tone, audience, house rules, terminology. Style only. | |
| borrowed_words | No | How to render borrowed words: "auto" (default) uses the established form in the target language, "transliterate" writes them in the target script, "preserve" keeps technical terms and proper nouns in their original script | |
| do_not_translate | No | Strings that must appear in the translation exactly as written |