Translate text
translateTranslate text to a target language with automatic source detection, HTML input support, and optional alternative translations.
Instructions
Translate text using a self-hosted LibreTranslate instance (POST /translate). Set source to "auto" to let LibreTranslate detect the input language; the detected language and its confidence are then reported in the result. format "html" treats the input as HTML; LibreTranslate does not support alternatives for HTML input, so format "html" with alternatives > 0 is rejected before the request is sent. With format "text" and alternatives > 0, the other candidate translations returned by LibreTranslate are included when the response carries them, and an explicit note is returned when it does not.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Text to translate. | |
| format | No | Input format: "text" (default) or "html". | text |
| source | No | Source language code, or "auto" to let LibreTranslate detect it. | auto |
| target | Yes | Target language code. Use the languages tool to list the codes this instance supports. | |
| alternatives | No | Number of alternative translations to request (0-10). Only supported with format "text". |