---
title: "Clinical translation over a WebSocket, for English that is still being generated"
method: GET
path: "/v1/medical/stream"
tags: ["Medical"]
---

# Clinical translation over a WebSocket, for English that is still being generated

`GET /v1/medical/stream`

## Request

- Base URL: `https://hc.itsbaba.com`
- URL: `https://hc.itsbaba.com/v1/medical/stream`
- Auth: HTTP bearer

Open a WebSocket (`wss://hc.itsbaba.com/v1/medical/stream`) with the usual `Authorization: Bearer` key, from your server. Use it when the English text is itself streaming from a language model: send it as it arrives and receive verified Hebrew one sentence at a time, in order.

**You send** JSON text frames (each under 64 KB):
- `{"type":"start", ...options}` once, with the same options as /v1/medical/translate (audience, reader_gender, patient_gender, protected_terms, redact_terms, glossary, date_order, date_style, bidi).
- `{"type":"delta","text":"..."}` for each piece of English, as it arrives.
- `{"type":"end"}` when the English is complete.

**You receive** `{"type":"ready"}`, then `{"type":"segment", ...}` for each verified sentence (same shape as a /v1/medical/translate segment), then `{"type":"done","stats":{...},"usage":{"characters","billed_characters"}}`. Errors arrive as `{"type":"error","error":{"type","message"}}` and close the socket.

**Limits.** 100,000 characters, 5,000 messages, 1,000 sentences and 30 minutes per session; the socket closes after 60 seconds without a message; at most 10 open sessions per account. Each sentence is charged as it starts (3× characters), so a quota stop is exact.

## Other responses

- `101`: Switching Protocols: the WebSocket is open.
- `400`: Not a WebSocket upgrade request (`upgrade_required`).
- `401`: Missing, invalid or revoked API key.
- `403`: The request came from a browser, or TLS is older than 1.2.
- `429`: Rate limit, or too many open sessions (`too_many_sessions`).

---

[API](https://skmtc.dev/itsbaba/apis/hebrewcore-api.md) · [All operations](https://skmtc.dev/itsbaba/apis/hebrewcore-api/llms.txt) · [OpenAPI document](https://skmtc.dev/itsbaba/apis/hebrewcore-api/revisions/f54229695236?raw)
