// 1. Tenant + environment + auth (most common)new CortiClient(string tenantName, CortiEnvironmentInput environment, CortiClientAuth auth, CortiRequestOptions? requestOptions = null)// 2. Bearer only — tenant and environment decoded from the JWTnew CortiClient(CortiClientBearerAuth auth, CortiRequestOptions? requestOptions = null)// 3. Environment only — proxy / passthrough, no SDK-managed authnew CortiClient(CortiEnvironmentInput environment, CortiRequestOptions? requestOptions = null)
CortiEnvironmentInput accepts a region string, a CortiClientEnvironment, or CortiEnvironments.FromBaseUrl(...) via implicit conversion.Overload 2 decodes tenant and environment from the access token JWT. If the token cannot be decoded, use overload 1 instead.Overload 3 sends no Authorization header. CreateStreamApiAsync / CreateTranscribeApiAsync require a tenant and will throw. See Proxy / passthrough.
Manage interaction sessions that group recordings, transcripts, documents, and facts together.
C# .NET
using Corti;// List interactions (pager — see Pagination)var pager = await client.Interactions.ListAsync(new InteractionsListRequest());// Create a new interactionvar response = await client.Interactions.CreateAsync( new InteractionsCreateRequest { Encounter = new InteractionsEncounterCreateRequest { Identifier = "my-encounter-id", Status = InteractionsEncounterStatusEnum.Planned, Type = InteractionsEncounterTypeEnum.FirstConsultation, }, });var interactionId = response.InteractionId;// Get a specific interactionvar interaction = await client.Interactions.GetAsync(interactionId);// Update an interactionawait client.Interactions.UpdateAsync( interactionId, new InteractionsUpdateRequest { Encounter = new InteractionsEncounterUpdateRequest { Status = InteractionsEncounterStatusEnum.InProgress, }, });// Delete an interactionawait client.Interactions.DeleteAsync(interactionId);
Create transcriptions from uploaded recordings and retrieve results.
C# .NET
using Corti;// Create a transcript from a recordingvar transcript = await client.Transcripts.CreateAsync( interactionId, new TranscriptsCreateRequest { RecordingId = recordingId, PrimaryLanguage = "en", });var transcriptId = transcript.Id;// Check transcription statusvar status = await client.Transcripts.GetStatusAsync(interactionId, transcriptId);// List transcripts for an interactionvar transcripts = await client.Transcripts.ListAsync(interactionId);// Get a specific transcriptvar result = await client.Transcripts.GetAsync(interactionId, transcriptId);// Delete a transcriptawait client.Transcripts.DeleteAsync(interactionId, transcriptId);
Generate AI-produced clinical documents (e.g. SOAP notes) from interaction data.
C# .NET
using Corti;// Generate a documentvar document = await client.Documents.CreateAsync( interactionId, new DocumentsCreateRequestWithTemplateKey { TemplateKey = "corti-soap", OutputLanguage = "en", Context = new[] { new DocumentsContextWithFacts { Type = DocumentsContextWithFactsType.Facts, Data = new[] { new FactsContext { Text = "Patient reports persistent headache for 3 days", Source = CommonSourceEnum.Core }, new FactsContext { Text = "No history of migraines", Source = CommonSourceEnum.User }, }, }, }, });var documentId = document.Id;// List documentsvar documents = await client.Documents.ListAsync(interactionId);// Get a specific documentvar doc = await client.Documents.GetAsync(interactionId, documentId);// Update a documentawait client.Documents.UpdateAsync( interactionId, documentId, new DocumentsUpdateRequest { Name = "Updated note" });// Delete a documentawait client.Documents.DeleteAsync(interactionId, documentId);
Extract structured clinical facts from text or manage facts on an interaction.
C# .NET
using Corti;// Extract facts from text (standalone)var extracted = await client.Facts.ExtractAsync( new FactsExtractRequest { Context = new[] { new CommonTextContext { Type = CommonTextContextType.Text, Text = "Patient has a temperature of 38.5°C and reports headache.", }, }, OutputLanguage = "en", });// List facts for an interactionvar facts = await client.Facts.ListAsync(interactionId);// Create facts on an interactionvar created = await client.Facts.CreateAsync( interactionId, new FactsCreateRequest { Facts = new[] { new FactsCreateInput { Text = "Temperature 38.5°C", Group = "vitals" }, }, });// Update a single factawait client.Facts.UpdateAsync( interactionId, factId, new FactsUpdateRequest { Text = "Temperature 39.0°C" });// List available fact groupsvar groups = await client.Facts.FactGroupsListAsync();
List and inspect document generation templates available to your tenant.
C# .NET
using Corti;// List all templatesvar templates = await client.Templates.ListAsync(new TemplatesListRequest());// Get a specific template by keyvar template = await client.Templates.GetAsync("corti-soap");// List template sectionsvar sections = await client.Templates.SectionListAsync(new TemplatesSectionListRequest());
var response = await client.Codes.PredictAsync(new CodesGeneralPredictRequest{ System = [CommonCodingSystemEnum.Icd10CmInpatient], Context = [ new CommonTextContext { Type = CommonTextContextType.Text, Text = "Progress Note — Day 3: Patient continues on IV vancomycin for MRSA bacteremia. Blood cultures from yesterday still pending. Acute kidney injury improving — creatinine down to 1.8 from 2.4. Patient also has history of CHF, currently euvolemic on home dose of furosemide. Diabetes managed with insulin sliding scale, glucose well controlled.", }, ],});
Create and interact with AI agents (Agentic Framework).
C# .NET
using Corti;// List agentsvar agents = await client.Agents.ListAsync(new AgentsListRequest());// Create an agentvar agent = await client.Agents.CreateAsync( new AgentsCreateAgent { Name = "My Agent", Description = "A helpful assistant", });// Get agent detailsvar details = await client.Agents.GetAsync(agent.Id);// Send a message to an agentvar response = await client.Agents.MessageSendAsync( agent.Id, new AgentsMessageSendParams { Message = new AgentsMessage { Role = AgentsMessageRole.User, Kind = AgentsMessageKind.Message, MessageId = $"msg-{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}", Parts = new[] { AgentsPart.FromAgentsTextPart( new AgentsTextPart { Kind = AgentsTextPartKind.Text, Text = "Hello" }), }, }, });// Update an agentawait client.Agents.UpdateAsync(agent.Id, new AgentsUpdateAgent { Description = "Updated" });// Delete an agentawait client.Agents.DeleteAsync(agent.Id);
Stream configuration (language, participants, mode). When provided, the SDK automatically sends the config message once the socket opens and waits for CONFIG_ACCEPTED. If omitted, you must send a config message yourself
Transcribe configuration (language, punctuation, commands). When provided, the SDK automatically sends the config message once the socket opens and waits for CONFIG_ACCEPTED. If omitted, you must send a config message yourself
OAuth token management via client.Auth. In most cases you won’t call these directly — the SDK handles tokens automatically based on the auth option you pass to the constructor. These methods are useful for advanced scenarios like generating authorization URLs for browser-based flows.
Method
Description
GetTokenAsync(OAuthTokenRequest)
Get a token via client credentials
GetTokenAsync(OAuthRopcTokenRequest)
Get a token via ROPC flow
GetTokenAsync(OAuthAuthCodeTokenRequest)
Exchange an authorization code for a token
GetTokenAsync(OAuthPkceTokenRequest)
Exchange a PKCE code for a token
GetTokenAsync(OAuthRefreshTokenRequest)
Refresh an expired token
AuthorizeUrlAsync(clientId, redirectUri, ...)
Generate an authorization URL
All GetTokenAsync overloads also accept *WithScopes request variants (e.g. OAuthTokenRequestWithScopes) to request scoped tokens.
A standalone authentication client for when you need OAuth token management without the full CortiClient. Useful for proxy servers, custom backends, or applications that handle tokens separately from API calls.
C# .NET
using Corti;// Replace these with your valuesconst string CLIENT_ID = "<your-client-id>";const string CLIENT_SECRET = "<your-client-secret>";const string ENVIRONMENT = "<eu-or-us>";const string TENANT = "<your-tenant-name>";var auth = CustomAuthClient.Create( new CortiAuthClientOptions { TenantName = TENANT, Environment = ENVIRONMENT, });var tokenResponse = await auth.GetTokenAsync( new OAuthTokenRequest { ClientId = CLIENT_ID, ClientSecret = CLIENT_SECRET, });Console.WriteLine(tokenResponse.AccessToken);
Use CortiEnvironments to create custom environments:
C# .NET
using Corti;// Built-in region// var env = CortiEnvironments.FromRegion("eu");// Custom proxy base URLvar env = CortiEnvironments.FromBaseUrl("https://your-proxy.com/api");var client = new CortiClient(environment: env);
Method
Description
FromRegion(region)
Create an environment from a region string
FromBaseUrl(baseUrl)
Create an environment pointing at a custom proxy URL