# Protected Translation

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

Add any of the fields below to `/v1/translate` or `/v1/translate/batch` to translate with [protected values](https://hc.itsbaba.com/docs#protection). Every sentence is checked before it is returned; one that cannot be verified comes back in the source language with `status: "fallback"`, so an unverified translation never reaches your users. Available between Hebrew (`he`), English (`en`) and Russian (`ru`).

| Parameter | Type | Description |
| --- | --- | --- |
| `protect` | boolean | Turn protection on. Implied by any field below, and by [account terms](https://hc.itsbaba.com/docs#terms) for Hebrew, English and Russian pairs. |
| `domain` | enum | `general` (default) for product, commerce, support and interface text · `finance` · `legal` · `clinical`. Each adds its own protected values, register and checks; see [Domains](https://hc.itsbaba.com/docs#domains). Any value except `general` implies `protect`. |
| `listener_gender` | enum | `male` · `female`. Who "you" is: `תרצי` / `תרצה`. Hebrew and Russian mark it; English does not. |
| `speaker_gender` | enum | `male` · `female`. Who "I" is, for an assistant or brand voice: `מצאתי`, `я нашла` / `я нашёл`. |
| `patient_gender` | enum | Clinical domain: a patient referred to in the third person. |
| `protected_terms` | string[] | Terms kept exactly as written: product names, brand names, SKUs. Up to 500. Added to the account terms for this request. |
| `redact_terms` | string[] | Kept exactly and never shown to the model: customer names and other personal data. Up to 200. |
| `glossary` | object | Source term → required rendering in the target language. Up to 500. |
| `date_order` | enum | How to read ambiguous numeric dates: `MDY` (US style) or `DMY` (Israel, Europe). Default: MDY for English sources, DMY for Hebrew and Russian. |
| `date_style` | enum | `hebrew` (default) spells the month out in the target language ("4 במרץ 2026", "4 марта 2026 г."); `iso`; `keep` (unambiguous dates only). |
| `audience` | enum | Clinical register: `clinician` (default) or `patient`. |
| `bidi` | enum | `isolate` wraps protected values in Unicode isolates in Hebrew output. Default `none`; see [/v1/wrap](https://hc.itsbaba.com/docs#wrap). |

## Quality with Protection

| Quality | What runs |
| --- | --- |
| `fast` | The deterministic checks on every sentence (protected values, numbers, signs, negation, left/right, gender), with a retry by a stronger model and fallback. Lowest latency: suited to live chat and voice. |
| `balanced` | The same, plus an independent model review of every sentence for meaning changes (negation, certainty, timing, quantities in words, who is being described). |
| `smartest` | As balanced, with the strongest model translating. |

## Example: A Shopping Assistant Replying in Hebrew

```bash
curl https://hc.itsbaba.com/v1/translate \
  -H "Authorization: Bearer hc_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "I found your order #A-10234: 2 × Wireless Earbuds Pro for $129.99. Would you like me to schedule delivery for 04/03/2026?",
    "source_lang": "en",
    "target_lang": "he",
    "protect": true,
    "protected_terms": ["Wireless Earbuds Pro", "A-10234"],
    "listener_gender": "female",
    "speaker_gender": "female",
    "quality": "fast"
  }'
```

```json
{
  "translation": {
    "text": "מצאתי את ההזמנה שלך מס׳ A-10234: 2 יחידות של Wireless Earbuds Pro במחיר $129.99. האם תרצי שאקבע את המשלוח ל־3 באפריל 2026?",
    "dir": "rtl",
    "protection": {
      "status": "ok",
      "source_lang": "en",
      "spans": [
        { "type": "term", "value": "A-10234" },
        { "type": "number", "value": "2" },
        { "type": "term", "value": "Wireless Earbuds Pro" },
        { "type": "number", "value": "$129.99" },
        { "type": "date", "value": "04/03/2026", "render": "3 באפריל 2026", "ambiguous_date": true }
      ],
      "issues": [],
      "segments": [
        { "source": "I found your order #A-10234: 2 × Wireless Earbuds Pro for $129.99.", "text": "מצאתי את ההזמנה שלך מס׳ A-10234: 2 יחידות של Wireless Earbuds Pro במחיר $129.99.", "status": "ok" },
        { "source": "Would you like me to schedule delivery for 04/03/2026?", "text": "האם תרצי שאקבע את המשלוח ל־3 באפריל 2026?", "status": "ok" }
      ]
    },
    …
  }
}
```

## Example: A Support Reply in Russian

```http
POST /v1/translate
{ "text": "Your refund of €45.00 was issued on 12/05/2026. I could not find any other open requests.",
  "target_lang": "ru", "protect": true, "speaker_gender": "female", "date_order": "DMY", "quality": "fast" }

→ "Возврат средств в размере €45.00 был оформлен 12 мая 2026 г. Я не нашла других открытых запросов."
```
