> ## Documentation Index
> Fetch the complete documentation index at: https://docs.medera.info/llms.txt
> Use this file to discover all available pages before exploring further.

# /transcribe endpoint

> WSS · real-time stateless dictation built for the between-visit window.

`wss://api.medera.info/transcribe` is the **stateless dictation WebSocket** for clinical editors. No session, no patient context, no persistence server-side — just real-time BH-tuned recognition with command-and-control.

Built for the 5-minute window between encounters when the clinician is finishing a previous chart, signing refills, or paging a colleague.

## Connection

```text theme={"system"}
wss://api.medera.info/transcribe?token=<jwt>
```

## Configuration

```json theme={"system"}
{
  "type": "configure",
  "language": "en-US",
  "punctuation": "smart",
  "commands": ["new_paragraph", "next_section", "period", "comma", "delete_last"],
  "interim_results": true,
  "vocabulary": {
    "formulary": ["sertraline", "escitalopram", "lamotrigine"],
    "clinicians": ["Dr. Khalil"]
  }
}
```

## Events

| Event         | Schema              |
| :------------ | :------------------ |
| `interim`     | `{ text }`          |
| `final`       | `{ text }`          |
| `command`     | `{ command, args }` |
| `audio.event` | `{ kind }`          |
| `error`       | `{ code, message }` |

## Why "stateless"

No session is required. No transcript is persisted server-side. The endpoint is designed for clinical editor dictation where the editor owns the text. PHI never lands at rest from this endpoint.

## Sample (JavaScript)

```javascript theme={"system"}
import { MederaClient } from '@medera/sdk';
const client = new MederaClient({ apiKey: process.env.MEDERA_API_KEY! });

const ws = await client.transcribe.connect({
  language: 'en-US',
  punctuation: 'smart',
  commands: ['new_paragraph', 'next_section', 'period'],
});

ws.on('interim', (e) => editor.previewText(e.text));
ws.on('final',   (e) => editor.commitText(e.text));
ws.on('command', (e) => editor.runCommand(e.command, e.args));

const mic = await navigator.mediaDevices.getUserMedia({ audio: true });
ws.streamAudio(mic);
```

***

## What's next

<CardGroup cols={2}>
  <Card title="Commands" icon="https://mintcdn.com/medera-357fd587/n1mgcc3nR2sq_PoL/icons/ui/terminal.svg?fit=max&auto=format&n=n1mgcc3nR2sq_PoL&q=85&s=a54c23f663622840fa7b900ec04462a5" href="/multimodal/stt/commands" width="40" height="40" data-path="icons/ui/terminal.svg">Build voice commands.</Card>
  <Card title="Smart punctuation" icon="https://mintcdn.com/medera-357fd587/iC-6rAuwl-0aQSw_/icons/ui/quote.svg?fit=max&auto=format&n=iC-6rAuwl-0aQSw_&q=85&s=f76ed9901c66587f77c5959d2dd5b806" href="/multimodal/stt/punctuation" width="40" height="40" data-path="icons/ui/quote.svg">Punctuation modes.</Card>
  <Card title="/sessions — live capture" icon="https://mintcdn.com/medera-357fd587/iC-6rAuwl-0aQSw_/icons/ui/audio-lines.svg?fit=max&auto=format&n=iC-6rAuwl-0aQSw_&q=85&s=a4f3136aa8df6fe2d044778c71ba2bbc" href="/multimodal/stt/streams" width="40" height="40" data-path="icons/ui/audio-lines.svg">Stateful diarized session.</Card>
  <Card title="Microphones" icon="https://mintcdn.com/medera-357fd587/iC-6rAuwl-0aQSw_/icons/ui/microphone-2.svg?fit=max&auto=format&n=iC-6rAuwl-0aQSw_&q=85&s=5c3a8eee2d34384a36fdd6dde5a31988" href="/multimodal/stt/microphones" width="40" height="40" data-path="icons/ui/microphone-2.svg">Recommended hardware.</Card>
</CardGroup>
