TypesafeSdk 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package TypesafeSdk --version 1.0.2
                    
NuGet\Install-Package TypesafeSdk -Version 1.0.2
                    
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.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TypesafeSdk" Version="1.0.2" />
                    
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.2
                    
#r "nuget: TypesafeSdk, 1.0.2"
                    
#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.2
                    
#: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.2
                    
Install as a Cake Addin
#tool nuget:?package=TypesafeSdk&version=1.0.2
                    
Install as a Cake Tool

Dotnet Typesafe SDK

.NET client for the TypeSafe API.

CI NuGet Downloads License

Please report all issues and feature requests on the GitHub issue tracker.

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