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
1
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.2
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.3
Run
Run the snippet at the top of this page. Done — no other setup. The SDK auto-loads
.env, logs in, picks the right host from SCRIBE_ENV, and applies
SCRIBE_DEFAULT_TEMPLATES so you don’t repeat them on every call.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:1
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.2
Send audio
Chunked upload POSTs speech chunks; streaming sends PCM frames over the WebSocket.
Audio lands in storage but isn’t processed yet.
3
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.4
Poll results
wait_for_results(session_id) → GET /voice/v1/sessions/{id} until a terminal status,
then returns the templates.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
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
Models
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.
