# POST /v1/translate

Part of the HebrewCore documentation. Web: https://hc.itsbaba.com/docs#translate · Whole docs: https://hc.itsbaba.com/docs.md · Index: https://hc.itsbaba.com/llms.txt

`POST /v1/translate`

Translate text and attach directionality metadata to both the source and the result.

| Parameter | Type | Description |
| --- | --- | --- |
| `text` *required* | string | 1–20,000 characters. |
| `target_lang` *required* | string | BCP-47 code, e.g. `he` or `en`. |
| `source_lang` | string | BCP-47 code or `"auto"` (default). |
| `transliterate` | boolean | Include a Latin transliteration of a Hebrew result. Default `false`. |
| `quality` | enum | `fast` · `balanced` (default) · `smartest`. |
| `gender` | enum | `male` · `female` · `general`, where the language marks it. |
| `message_format` | enum | `icu`: the text is an ICU MessageFormat string, and plural branches are rewritten for the target language. See [ICU plurals](https://hc.itsbaba.com/docs#icu). |
| `store` | boolean | Accepted for compatibility and has no effect. HebrewCore never stores request or response text. |

## Response

```json
{
  "id": "txn_…",
  "source": {
    "text": "Welcome to your account",
    "lang": "en", "dir": "ltr", "mixed": false, "script": "Latn",
    "runs": [ { "text": "Welcome to your account", "dir": "ltr", "script": "Latn", "lang": "en", "start": 0, "end": 23 } ]
  },
  "translation": {
    "text": "ברוכים הבאים לחשבון שלך",
    "transliteration": "Bruchim haba'im lakheshbon shelkha",
    "lang": "he", "dir": "rtl", "mixed": false, "script": "Hebr",
    "runs": [ { "text": "ברוכים הבאים לחשבון שלך", "dir": "rtl", "script": "Hebr", "lang": "he", "start": 0, "end": 22 } ]
  },
  "quality": "balanced",
  "usage": { "characters": 23 }
}
```
