- Authenticate to get an
sdp_suki_token(and register the user if needed). - Create an ambient session and optionally seed context for better notes. An ambient session is one recording for a patient visit (encounter). One encounter can include more than one session.
- Stream audio over the WebSocket, send control events, and end the ambient session when that recording is finished.
- Retrieve the clinical note and transcript, or rely on a webhook when processing finishes.
Access and credentials
You need partner credentials to use the Suki Ambient APIs. Contact our Partnership team to get your credentials. They will guide you through the Onboarding process and provide what you need to get started.Prerequisites
To use the Suki Ambient APIs, you must have the following:- An OAuth-compliant authentication system.
- JWT tokens with consistent user identifiers.
- A publicly accessible endpoint (or Okta authorization server) for token validation.
Environments to use for development and testing
This guide useshttps://sdp.suki-stage.com and wss://sdp.suki-stage.com for API and WebSocket examples (staging).
Important:
- The production environment is
https://sdp.suki.aiandwss://sdp.suki.ai. - The staging environment is
https://sdp.suki-stage.comandwss://sdp.suki-stage.com. - Your partnership team will confirm which environment, base URL, and credentials apply for your integration.
Complete staging script
Replace the credential placeholders, put a 16 kHz mono LINEAR16 WAV (or raw PCM) ataudio.wav, then run. For detailed explanations of each step, refer to the numbered steps below.
- Python:
pip install requests websocket-clientthenpython ambient_staging.py. - TypeScript (Node):
npm install wsthennpx tsx ambient_staging.ts(Node 18+).
Create your first Ambient session
1
Authenticate to get a Suki token
Send a POST request to the Login API endpoint with the following parameters in the request body:Each sample below is self-contained (TypeScript, Python, and cURL). Expect HTTP 200.
- partner_id: Your unique , which we provide to you securely offline.
- partner_token: The user’s OAuth 2.0 ID token () from your identity provider.
- provider_id (Optional for standard partners; required for some auth flows): Unique identifier for the .
suki_token). Include it as the sdp_suki_token header for subsequent API calls.If the user is not registered, call the Register API first, then retry
/login. You only need to register a user once.2
Create an Ambient Session
Send a POST request to Create Ambient Session API. The body can be empty for a first staging session.Optional body fields:
- emr_encounter_id (UUID): EMR or EHR visit ID for cross-modality Ambient interoperability.
- encounter_id: Required for re-ambient workflows. Alphanumeric string up to 255 characters to group sessions for the same note.
- ambient_session_id: Optional UUID v4 to identify the session; Suki generates one if omitted.
ambient_session_id and composition_id.3
Seed Context (Optional)
POST to Seed Context API after session creation to provide metadata that improves note quality. Skip this step for the minimum path and add it after your first end-to-end run works.Include fields such as
provider, patient, visit, sections, diagnoses, and emr.4
Stream Audio via WebSocket (WS)
Open a WebSocket to
wss://sdp.suki-stage.com/ws/stream after session creation and context. Authenticate using Sec-WebSocket-Protocol (SukiAmbientAuth,<sdp_suki_token>,<ambient_session_id>) for browsers or headers for non-browser clients.Audio requirements:- encoding: LINEAR16.
- sample_rate: 16KHz.
- channel: Mono.
AUDIO messages. Required send order: START_TIME, one or more AUDIO messages, then an AUDIO end marker with Base64 of ASCII EOF (RU9G).Supported EVENT values: PAUSE, RESUME, CANCEL, ABORT (deprecated), KEEP_ALIVE. Close the socket when finished, then call the end session endpoint and poll status/content.5
End session
POST to End Session API to end the session.
6
Retrieve Generated Content
For the minimum path, poll Get Status API until a terminal state such as
completed, then retrieve the note with Get Content API.After that works, you can also use a webhook (session_summary_generated) or Get Transcript API.Verify your integration
Before you design the full production workflow, confirm that your staging integration can complete this minimum path:- Authenticate successfully and use the returned
sdp_suki_tokenin follow-up requests. - Create an ambient session and store the returned
ambient_session_id(andcomposition_idwhen you need note-level APIs). - Stream visit audio on
/ws/streamwith the required PCM format and message order. - End the session and confirm that Suki starts processing.
- Poll session status until a terminal state, then retrieve note content.
emr_encounter_id and encounter_id), webhooks, transcripts, and production rollout.
Available cookbooks
Available tutorials
Ambient
Build an Ambient Streaming Client
Authenticate, create a session, stream PCM audio over WebSocket, and retrieve clinical note results.
Webhooks
Build a Webhook Notification Receiver
Verify HMAC signatures, parse partner notifications, and handle success and failure events.
Next steps
After you complete your first Ambient API session:Provide Visit Context
Seed patient and visit context when you need better notes or Web SDK review.
Get the Generated Clinical Note
Choose session content, note content, or transcript after status is completed.
Ambient Interoperability
Pass
emr_encounter_id and reuse encounter_id when notes span modalities.Configure Webhooks
Register your callback URL for async completion. Configured at the partner level.
API Error Messages
Map Ambient API error codes and messages for Login, session, and content calls.