Skip to content

C#

The C# SDK is the generated client at sdks/csharp/api (reserved as OuraToolkit.Api on NuGet) plus the OuraToolkit.Auth companion. The client multi-targets modern .NET and netstandard2.0.

The client is auth-agnostic — configure the base URL and your Bearer token, then call the generated operation for daily sleep:

using OuraToolkit.Api;
using OuraToolkit.Client;
var config = new Configuration
{
BasePath = "https://api.ouraring.com",
AccessToken = Environment.GetEnvironmentVariable("OURA_ACCESS_TOKEN"),
};
var api = new DefaultApi(config);
var sleep = api.DailySleep("2026-06-01", "2026-06-07");
foreach (var day in sleep.Data) Console.WriteLine($"{day.Day} {day.Score}");

The exact class and method names come from the generated client — see the API reference. Generated code is marked generated; regenerate from the spec rather than editing it.