This is the new EkaScribe Python SDK (
scribe-python-sdk), built on the
MedScribeAlliance Protocol.
It replaces the legacy ekacare Python SDK,
which is now deprecated.Integrate in 60 seconds
Install
Install directly from the Git repository (not yet on PyPI):The
[audio] extra adds local file decoding + mic capture. Omit it (drop [audio])
if you only send raw PCM you already have.Set credentials
Create a
.env file next to your script (it’s auto-loaded):.env
Get your
client_id / client_secret from Eka Care. They live only in the
environment — the SDK refuses to read them from a config file, so they never leak
into source control.The three ways to send audio
Pick whichever fits your input. They all finish the same way:wait_for_results(session_id).
- A file (simplest)
- Raw PCM
- Live streaming (WebSocket)
.wav / .mp3 / .m4a / .webm / .ogg — a path or raw bytes.create_session → send audio → wait_for_results.
Reading the result
wait_for_results() returns a SessionStatusResponse:
templates is a list of single-key dicts (one template can yield several documents),
so iterate it like this:
Full working example: FastAPI relay
A browser can’t hold yourclient_id / secret, so the common pattern is a thin server
that uses the SDK. Copy this into server.py and run uvicorn server:app — it exposes
start / upload / poll endpoints your frontend can call.
server.py
examples/.
How it works
The SDK speaks the MedScribeAlliance Protocol and always runs voice-activity detection (VAD) on your machine — only speech-bounded audio is sent, never an un-VADded whole file. Both upload modes follow the same lifecycle:Create session
create_session() → POST /voice/v1/sessions. Returns a session_id used by every
later call. For streaming it also returns a wss:// URL.Send audio
Chunked upload POSTs speech chunks; streaming sends PCM frames over the WebSocket.
Audio lands in storage but isn’t processed yet.
End session
end_session() (or streaming’s stop()) → POST /voice/v1/sessions/{id}/end. This
is the single trigger that commits the session and starts transcription. For
streaming, closing the socket alone does not finalize — stop() always calls
end for you.b_id) is derived from your token automatically — you never configure it.
Configuration
Everything has a sensible default; only credentials are required. Resolution order (highest wins): explicit kwargs › environment /.env › config file › defaults.
Environment variables
| Variable | Purpose |
|---|---|
SCRIBE_CLIENT_ID / SCRIBE_CLIENT_SECRET | Credentials (env-only). |
SCRIBE_ENV | prod (default → api.eka.care) or dev (→ api.dev.eka.care). |
SCRIBE_DEFAULT_TEMPLATES | Comma-separated templates used when you don’t pass templates=. |
SCRIBE_DEFAULT_MODEL | lite (default) or pro. |
SCRIBE_BASE_URL / SCRIBE_AUTH_BASE_URL | Override hosts directly (wins over SCRIBE_ENV). |
Pass config inline (instead of env)
Per-call overrides
create_session() accepts the same options when you want to override config for one session:
Reference
Templates
| Template ID | Description |
|---|---|
clinical_notes_template | Comprehensive structured clinical notes. |
eka_emr_template | EMR-compatible format for electronic medical records. |
transcript_template | Basic transcription with minimal structuring. |
Models
| Model | Description |
|---|---|
pro | Most accurate. |
lite | Lower latency (default). |
Languages (language_hint)
en, hi, gu, kn, ml, ta, te, bn, mr, pa (ISO 639-1 codes).
Troubleshooting
login failed: 404 PROFILE_NOT_FOUND / 400 pwd mismatch
login failed: 404 PROFILE_NOT_FOUND / 400 pwd mismatch
Your
client_id / client_secret are wrong for the selected environment. Check
SCRIBE_ENV matches where the credentials were issued (dev vs prod).No templates specified and no default_templates configured
No templates specified and no default_templates configured
Set
SCRIBE_DEFAULT_TEMPLATES (or pass templates=[...] to create_session).ModuleNotFoundError on file upload / mic capture
ModuleNotFoundError on file upload / mic capture
Install with the audio extra:
pip install "scribe-python-sdk[audio] @ git+https://github.com/eka-care/scribe-python-sdk.git".
It’s only needed for local decoding/VAD — raw-PCM and streaming work without it.
