ScribeberryScribeberry Docs

Clinical Dictation (Live & Paste)

Add Canadian-resident Scribeberry Live medical dictation with Smart cleanup, voice macros, and custom medical dictionaries in Live or Paste delivery mode.

Scribeberry Dictation brings clinical speech-to-text, Smart clinical cleanup, custom medical dictionaries, and clinician voice macros directly into your EHR, pharmacy workflow, or web app.

All dictation runs on Scribeberry Live (Toronto) and Scribeberry Canadian AI engines (Montréal / Québec) with zero audio or text retention.

Live vs. Paste Delivery

Choose the experience that best fits your clinical input surface:

ModeEndpointBehaviorBest for
Paste (single clip)POST /api/v1/dictation/transcribeUpload a recorded clip (up to 30 min) and receive one clean, macro-expanded clinical paragraph.Hold-to-talk / drop-in paste into EHR boxes with zero cursor jitter.
Paste (streaming socket)WSS /ws/realtime with dictation.delivery: "paste"Streams audio live as the clinician speaks (zero end-of-clip upload wait), suppresses partial jitter, and emits one polished dictation:result on stop.Instant hold-to-talk paste for longer dictations.
Live (word-by-word)WSS /ws/realtime with dictation.delivery: "live"Streams transcript:partial and macro-expanded transcript:final word-by-word, then emits dictation:polished on stop.Live cursor dictation and real-time guided form filling.
Standalone polishPOST /api/v1/dictation/polishStateless clinical cleanup + medical dictionary + macro expansion on any text.Post-edit cleanup or bring-your-own speech recognition.

1. Paste Mode (Single Audio Clip)

Submit multipart audio, JSON audio_base64, or JSON audio_url (clips up to 30 minutes / 100 MB):

curl -X POST https://api.scribeberry.com/api/v1/dictation/transcribe \
  -H "Authorization: Bearer sk_live_..." \
  -F "audio=@recap.wav" \
  -F "language=en" \
  -F "cleanup_mode=smart" \
  -F "field_kind=clinical-note" \
  -F 'medical_dictionary=["Adalimumab","Upadacitinib","Nitrofurantoin"]'

Response

{
  "text": "32-year-old female with uncomplicated cystitis. Allergic to sulfa drugs.\n\nPlan: Nitrofurantoin 100 mg BID with food for 5 days.",
  "raw_text": "um 32 year old female with uncomplicated cystitis allergic to sulfa drugs new paragraph plan nitrofurantoin 100 mg BID with food for 5 days",
  "cleanup_mode": "smart",
  "cleaned": true,
  "language": "en",
  "audio_seconds": 14.2,
  "inference_ms": 620,
  "polish_ms": 0,
  "engine": "scribe-live",
  "region": "ca-toronto",
  "provider": "scribeberry"
}

When Scribeberry Live performs Smart cleanup inline and your medical dictionary fits in the session ticket (up to 50 terms), no secondary polish pass is needed (polish_ms: 0, engine: "scribe-live"). If more than 50 custom terms are supplied, Scribeberry automatically runs a Canadian post-polish pass (scribe-swift) to enforce the full dictionary.

2. Live & Paste Dictation over WebSocket (/ws/realtime)

Add the opt-in dictation object to your start.config frame. Dictation sessions automatically use Canadian-resident scribeberry-live speech (existing /ws/realtime callers that omit dictation are completely unaffected).

// Mint a short-lived sb_rt_ token on your backend via POST /api/v1/realtime/tokens
const ws = new WebSocket(`${wsUrl}?token=${encodeURIComponent(token)}`);
 
ws.onopen = () => {
  ws.send(JSON.stringify({
    type: 'start',
    config: {
      language: 'en',
      dictation: {
        delivery: 'paste',           // 'live' | 'paste'
        cleanup_mode: 'smart',       // 'smart' | 'verbatim' | 'raw'
        field_kind: 'clinical-note',
        external_user_id: 'dr-okafor', // optional: merges clinician's saved dictionary & macros
      },
    },
  }));
};
 
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data as string);
  if (msg.type === 'dictation:started') {
    // Ready to stream 16 kHz mono PCM16 binary audio frames
  } else if (msg.type === 'transcript:partial') {
    // Emitted in delivery: "live" only
    showLivePreview(msg.text);
  } else if (msg.type === 'transcript:final') {
    // Emitted in delivery: "live" only (with voice macros expanded)
    appendToCursor(msg.text);
  } else if (msg.type === 'dictation:polished') {
    // Emitted on stop in delivery: "live" with Smart-cleaned text
    replaceSessionText(msg.text);
  } else if (msg.type === 'dictation:result') {
    // Emitted on stop in delivery: "paste" with one clean final block
    pasteIntoField(msg.text);
  }
};

3. Cleanup Modes & Built-in Spoken Punctuation (English & French)

ModeBehavior
smart (default)Removes speech fillers ("um", "uh", "euh") and stutters, applies Medical Dictionary spellings, fixes punctuation/capitalization, and converts spoken punctuation & structure commands in English and French without altering clinical meaning or negations.
verbatimPreserves every spoken clinical word intact while fixing punctuation, capitalization, Medical Dictionary spellings, and explicit spoken punctuation commands.
rawReturns exact speech output (only expands explicit custom macros if provided).

Built-in spoken commands enabled by default in English (question mark → ?, exclamation mark → !, comma → ,, semicolon → ;, full stop → ., new paragraph, new line, bullet point) and French (point d'interrogation → ?, point d'exclamation → !, virgule → ,, deux points → :, point-virgule → ;, point final → ., nouveau paragraphe, nouvelle ligne, à la ligne, ouvrir la parenthèse / fermer la parenthèse, point puce). Both straight (') and typographic (’) apostrophes match automatically.

French Real-Time Dictation Example (Pathology / LIS)

ws.send(JSON.stringify({
  type: 'start',
  config: {
    language: 'fr-CA',
    dictation: {
      delivery: 'live',          // streams macro-expanded finals + emits dictation:polished on stop
      cleanup_mode: 'smart',     // AI French punctuation, cleanup & pathology dictionary
      medical_dictionary: ['adénocarcinome', 'immunohistochimie', 'marginale'],
    },
  },
}));
// Speaking: "Absence de malignité point d'interrogation nouveau paragraphe Biopsie normale point final"
// Outputs:  "Absence de malignité?\n\nBiopsie normale."

4. Standalone Polish (POST /api/v1/dictation/polish)

curl -X POST https://api.scribeberry.com/api/v1/dictation/polish \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "text": "um patient denies chest pain normal cardiac exam",
    "cleanup_mode": "smart",
    "medical_dictionary": ["Adalimumab"],
    "macros": [
      {
        "id": "normal-cardiac",
        "trigger": "normal cardiac exam",
        "replacement": "S1 S2 normal, no murmurs, rubs, or gallops.",
        "enabled": true
      }
    ]
  }'

5. Saved Project & Clinician Settings (Macros & Dictionary)

Store a project-wide default or per-clinician dictionary and voice macros once so you never have to resend them on every request. Omitting cleanup_mode or delivery on a request automatically inherits saved clinician overrides first, then project defaults. Clinician updates are sparse: saving only medical_dictionary for an external_user_id preserves the project's default cleanup_mode, delivery, and macros. Voice macro triggers must be at least 2 characters and expand in a single pass.

# Save clinician-specific settings
curl -X PUT https://api.scribeberry.com/api/v1/dictation/settings \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "external_user_id": "dr-okafor",
    "cleanup_mode": "smart",
    "delivery": "paste",
    "medical_dictionary": ["Adalimumab", "Secukinumab", "Upadacitinib"],
    "macros": [
      {
        "id": "normal-chest",
        "trigger": "normal chest",
        "replacement": "Lungs clear to auscultation bilaterally; no wheezes, crackles, or rhonchi.",
        "enabled": true
      }
    ]
  }'
 
# Read merged settings
curl "https://api.scribeberry.com/api/v1/dictation/settings?external_user_id=dr-okafor" \
  -H "Authorization: Bearer sk_live_..."