← Back
typesafe-ai

typesafe-ai/typesafe-sdk-python

The official Python library for the TypeSafe API

View on GitHub ↗https://docs.typesafe.ai/sdk/python ↗
Stars
261
Forks
40
Watchers
261
Open issues
8
Contributors
2
Language
Python
License
MIT License
Default branch
main
Created Sep 4, 2026Updated Sep 26, 2026

Star growth

Today—
This week—
This month—

Star history will appear here once this repo has been tracked for a couple of days.

README

TypeSafe AI Python SDK

Python SDK for TypeSafe AI.

Quickstart

Install the SDK:

uv add typesafe-sdk

Add the http2 extra (typesafe-sdk[http2]) to enable HTTP/2 support.

Set TYPESAFE_API_KEY in your environment, then instantiate and use the client:

from typesafe_sdk import Choice, TypeSafeClient

with TypeSafeClient() as client:
    response = client.system_one(
        state={"document": "I was charged twice. Please fix this ASAP."},
        questions={
            "category": Choice(
                instructions="What is this ticket about?",
                criteria={"billing": None, "technical": None, "other": None},
            ),
        },
    )

print(response.choices["category"].choice)

learn what TypeSafe is, what it can do, and how to use it in TypeSafe docs.

Documentation

Learn more in SDK docs.