@corti/sdk package exports four main APIs:
CortiClient
The main client for all Corti API operations.Constructor options
JavaScript
Request options
Every HTTP method accepts an optional request options object as the last argument:JavaScript
Client methods
Resource groups
The client exposes the following resource groups as properties:Interactions
Manage interaction sessions that group recordings, transcripts, documents, and facts together.Recordings
Upload and manage audio recordings within an interaction.JavaScript
Languages
List available languages and which endpoints support each language.Transcripts
Create transcriptions from uploaded recordings and retrieve results.JavaScript
Guided Document Generation
Generate structured clinical documents using guided synthesis. Accepts a template reference, an ad-hoc assembly of sections, or a fully inline dynamic template.Guided Templates
Create, version, and publish document templates that define section composition and generation instructions.Template Versions
Guided Sections
Create, version, and publish document sections that define individual clinical note components with structured output schemas.Section Versions
Documents (Classic)
Facts
Extract structured clinical facts from text or manage facts on an interaction.Templates
List and inspect document generation templates available to your tenant.JavaScript
Codes
Predict medical codes from clinical data.JavaScript
Agents
Create and interact with AI agents (Agentic Framework).JavaScript
Stream
Real-time WebSocket connection for combined transcription, fact extraction, and more — tied to an interaction.connect parameters
The SDK injects
tenantName and token automatically. If configuration is provided and awaitConfiguration is true, the promise rejects when the stream configuration is denied (CONFIG_DENIED, CONFIG_MISSING, CONFIG_NOT_PROVIDED).
Socket methods
Transcribe
Real-time WebSocket speech-to-text without an interaction context.JavaScript
connect parameters
The socket methods are the same as Stream (
sendAudio, sendFlush, sendEnd, close, etc.). The key differences are:
- No interaction ID — Transcribe operates standalone
- Different message types — Transcribe delivers
transcript,command,flushed,ended,usage,delta_usage, anderrormessages, while Stream deliverstranscript,facts,flushed,ended,usage,delta_usage, anderror
Auth
OAuth token management. In most cases you won’t call these directly — the SDK handles tokens automatically based on theauth option you pass to the constructor. These methods are useful for advanced scenarios like generating authorization URLs for browser-based flows.
CortiAuth
A standalone authentication client for when you need OAuth token management without the fullCortiClient. Useful for proxy servers, custom backends, or applications that handle tokens separately from API calls.
JavaScript
Constructor options
Methods
All token methods accept an optionalscopes array. openid and profile are added automatically — pass additional scopes like "streams" or "transcribe" to get a scoped token.
CortiWebSocketProxyClient
A lightweight client for WebSocket-only proxy scenarios. UnlikeCortiClient, it requires no environment, tenant, or authentication configuration — all routing is handled by the proxy option you pass at connect time.
JavaScript
Static properties
stream.connect
Returns
Promise<CustomStreamSocket> — same socket API as client.stream.connect.
transcribe.connect
Returns
Promise<CustomTranscribeSocket> — same socket API as client.transcribe.connect.
ProxyOptions
The ProxyOptions type is also exported from @corti/sdk for use when typing proxy arguments in your own code.
JavaScript
Utilities
The@corti/sdk/utils sub-package exports helper functions for token inspection, environment resolution, PKCE, and dictation transcript assembly. These are useful in proxy servers, middleware, custom authentication flows, and dictation UIs.
JavaScript