Corti.Sdk NuGet package is the official C# .NET SDK for the Corti API. It provides full coverage of every REST endpoint and WebSocket connection, with built-in authentication, automatic token refresh, async/await support, and typed exceptions.
Package: Corti.Sdk on NuGet | Examples: corti-examples
Prerequisites
- .NET 8 or later (also supports .NET Framework 4.6.2+ and .NET Standard 2.0)
- A Corti API client from the Corti Console
Installation
Initialization
The simplest way to get started is with client credentials (server-side):C# .NET
Authentication
The SDK supports six authentication methods to cover different deployment scenarios:
Each method is covered in detail in the Authentication Guide.
Usage examples
Create an interaction
C# .NET
Real-time transcription (WebSocket)
C# .NET
Text generation
C# .NET
Error handling
The SDK throws typed exceptions you can catch and inspect:Advanced configuration
Retries
The SDK retries failed requests with exponential backoff when the response is retryable and the attempt count is below the limit (default: 2). A response is retryable when the status code is 408, 429, or any 5xx. Override per request:CortiRequestOptions on the client:
Timeouts
The default request timeout is 30 seconds. Override per request:CortiRequestOptions — see the example above.
Raw responses
Methods that returnWithRawResponseTask<T> let you await either the parsed model or parsed data plus HTTP metadata. Call .WithRawResponse() on the task to get status code, URL, and headers alongside Data:
Paginated
ListAsync helpers return a Pager and do not expose .WithRawResponse(). Use a non-paginated endpoint method that returns WithRawResponseTask<T> when you need raw HTTP metadata.Pagination
List endpoints are paginated. The SDK returns a pager you can iterate withawait foreach:
Additional headers
Additional query parameters
Wire enums
OpenAPI wire enums accept only documented values;FromCustom() is not available. WebSocket config-status type fields are strict enums — compare msg.Type to StreamConfigStatusMessageType or TranscribeConfigStatusMessageType members.
Custom HttpClient
Supply your ownHttpClient for advanced networking (defaults, handlers, proxies):
Proxy / passthrough mode
For scenarios where your server proxies requests to Corti and handles auth externally, you can create a client with only an environment (no credentials):Authorization header is sent by default. Add your own headers per request using RequestOptions.AdditionalHeaders.
See the Authentication Guide for details.
Resources
- NuGet package — latest version and install info
- Examples repository — working code for authentication, streaming, text generation, and more
- API Reference —
CortiClientresource groups, methods, and options - Authentication Guide — all auth methods with code examples
- API Endpoint Reference — full endpoint specifications
For support or questions, contact us