Skip to main content
This quickstart walks you through one successful Ambient workflow on staging environment. You will authenticate, create a session, stream visit audio, end the session, and retrieve the clinical note. Rely on a webhook when processing finishes to handle notifications instead of polling. Your application owns session controls, audio streaming, status handling, note review, and EHR handoff. For product context and when to choose Ambient APIs versus Ambient SDKs, refer to Ambient clinical documentation. What you will do
  1. Authenticate to get an sdp_suki_token (and register the user if needed).
  2. 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.
  3. Stream audio over the WebSocket, send control events, and end the ambient session when that recording is finished.
  4. Retrieve the clinical note and transcript, or rely on a webhook when processing finishes.
Prefer one paste-ready file? Use the Complete staging script in the preferred language below, then follow the numbered steps for the same flow with full explanations.
Using an AI coding tool?Copy the prompt below to point your agent at the Ambient skill and Documentation MCP. For every task skill, refer to AI coding tools.

Fetch the Ambient skill and connect the documentation MCP.

Open in Cursor

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 uses https://sdp.suki-stage.com and wss://sdp.suki-stage.com for API and WebSocket examples (staging).
Important:
  • The production environment is https://sdp.suki.ai and wss://sdp.suki.ai.
  • The staging environment is https://sdp.suki-stage.com and wss://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) at audio.wav, then run. For detailed explanations of each step, refer to the numbered steps below.
  • Python: pip install requests websocket-client then python ambient_staging.py.
  • TypeScript (Node): npm install ws then npx tsx ambient_staging.ts (Node 18+).
Ambient sessions must be at least 1 minute of audio for note generation. Shorter sessions can return status skipped with no note. Use a WAV or raw LINEAR16 PCM file that is long enough when you test.

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:
  • 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 .
On success the API returns a (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.
Each sample below is self-contained (TypeScript, Python, and cURL). Expect HTTP 200.
Save the suki_token as it is valid for 1 hour. Request a new token before it expires.
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.
Expect HTTP 201 and a response with ambient_session_id and composition_id.
Save ambient_session_id and composition_id. Use the session ID for streaming and content calls; use composition_id as note_id for note-level APIs.
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.
Strip WAV headers (44 bytes) before chunking. Send 100ms PCM chunks Base64-encoded in 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.
Use the Complete staging script for a full streaming client. When capture finishes, close the WebSocket, then call end session.
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_token in follow-up requests.
  • Create an ambient session and store the returned ambient_session_id (and composition_id when you need note-level APIs).
  • Stream visit audio on /ws/stream with 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.
After this path works end to end on staging, add patient context, interoperability fields (emr_encounter_id and encounter_id), webhooks, transcripts, and production rollout.

Available cookbooks

AmbientAPI

End Ambient After Streaming

Send RU9G, then end session.

5 min
AmbientAPI

Authenticate Browser WebSocket Handshake

Auth browser WebSocket with protocols.

5 min
AmbientAPI

Poll Session Status Before Fetching Content

Poll until status is completed.

5 min

Available tutorials

Ambient

Build an Ambient Streaming Client

Authenticate, create a session, stream PCM audio over WebSocket, and retrieve clinical note results.

20 minIntermediate
Webhooks

Build a Webhook Notification Receiver

Verify HMAC signatures, parse partner notifications, and handle success and failure events.

10 minBeginner

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.
Last modified on August 26, 2026