TypesafeSdk 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package TypesafeSdk --version 1.0.1
                    
NuGet\Install-Package TypesafeSdk -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TypesafeSdk" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TypesafeSdk" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="TypesafeSdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TypesafeSdk --version 1.0.1
                    
#r "nuget: TypesafeSdk, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TypesafeSdk@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TypesafeSdk&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=TypesafeSdk&version=1.0.1
                    
Install as a Cake Tool

<h1 align="center">Dotnet Typesafe SDK</h1>

<p align="center">.NET client for the <a href="https://typesafe.ai">TypeSafe</a> API.</p>

<p align="center"> <a href="https://github.com/oliver-gc/Dotnet-Typesafe-SDK/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/oliver-gc/Dotnet-Typesafe-SDK/ci.yml?branch=main&logo=github&label=CI"></a> <a href="https://www.nuget.org/packages/TypesafeSdk"><img alt="NuGet" src="https://img.shields.io/nuget/v/TypesafeSdk?label=nuget"></a> <a href="https://www.nuget.org/packages/TypesafeSdk"><img alt="Downloads" src="https://img.shields.io/nuget/dt/TypesafeSdk?label=downloads"></a> <a href="https://github.com/oliver-gc/Dotnet-Typesafe-SDK/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/oliver-gc/Dotnet-Typesafe-SDK?label=license"></a> </p>

<p align="center">Please report all issues and feature requests on the github issue tracker <a href="https://github.com/oliver-gc/Dotnet-Typesafe-SDK/issues">here</a>.</p>

Install

dotnet add package TypesafeSdk

Quickstart

Set TYPESAFE_API_KEY in your environment, then:

using TypesafeSdk;
using TypesafeSdk.Models;

using var client = new TypeSafeClient();

var response = await client.SystemOneAsync(
    state: "I was charged twice. Please help ASAP.",
    questions: new Dictionary<string, Question>
    {
        ["billing"] = new NoulQuestion { Instructions = "Is this about billing?" },
        ["tone"] = new ChoiceQuestion
        {
            Instructions = "What is the tone?",
            Criteria = new Dictionary<string, object?> { ["calm"] = null, ["angry"] = null },
        },
        ["urgency"] = new ScoreQuestion
        {
            Instructions = "How urgent is this?",
            Criteria = ["low", "medium", "high"],
        },
    });

Console.WriteLine(response.Nouls["billing"].Noul);
Console.WriteLine(response.Choices["tone"].Choice);
Console.WriteLine(response.Scores["urgency"].Score);

Listing models

ListModelsAsync calls GET /v1/models and returns the names your account can send in the model field, each with a description and release date. It currently lists aliases; versioned IDs such as jev-1.13.0 are accepted whether or not they appear in the list.

var models = await client.ListModelsAsync();

foreach (var model in models.Models)
{
    Console.WriteLine($"{model.Name} ({model.ReleaseDate}): {model.Description}");
}

Configuration

Pass TypeSafeClientOptions to override defaults: ApiKey, BaseUrl, Model, Retry, Timeout, HttpClient, LogLevel and Logger. Unset values fall back to TYPESAFE_API_KEY, TYPESAFE_BASE_URL, TYPESAFE_DEFAULT_MODEL and TYPESAFE_LOG_LEVEL.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 88 10/26/2026
1.0.2 89 10/6/2026
1.0.1 68 10/6/2026
0.1.0 86 10/5/2026