The official TypeScript/JavaScript library for the TypeSafe API
TypeScript
269
5 commits
updated Sep 15, 2026
JavaScript and TypeScript SDK for TypeSafe AI.
Install the SDK (Node.js 20 or newer):
npm install @typesafe-ai/sdk
Set TYPESAFE_API_KEY in your environment, then create and use the client:
import { choice, TypeSafeClient } from "@typesafe-ai/sdk";
const client = new TypeSafeClient();
const response = await client.systemOne({
state: { document: "I was charged twice. Please fix this ASAP." },
questions: {
category: choice("What is this ticket about?", {
billing: null,
technical: null,
other: null,
}),
},
});
console.log(response.answers.category.choice);
Answer types are inferred from your questions. The package includes ESM, CommonJS, and TypeScript declarations.
Learn what TypeSafe can do in the TypeSafe docs. See the SDK's client and types for API options and defaults.
4,568 followers · starred Sep 2026
84 followers · starred Sep 2026
1,023 followers · starred Sep 2026
2,631 followers · starred Sep 2026
The official TypeScript/JavaScript library for the TypeSafe API
TypeScript
269
5 commits
updated Sep 15, 2026
JavaScript and TypeScript SDK for TypeSafe AI.
Install the SDK (Node.js 20 or newer):
npm install @typesafe-ai/sdk
Set TYPESAFE_API_KEY in your environment, then create and use the client:
import { choice, TypeSafeClient } from "@typesafe-ai/sdk";
const client = new TypeSafeClient();
const response = await client.systemOne({
state: { document: "I was charged twice. Please fix this ASAP." },
questions: {
category: choice("What is this ticket about?", {
billing: null,
technical: null,
other: null,
}),
},
});
console.log(response.answers.category.choice);
Answer types are inferred from your questions. The package includes ESM, CommonJS, and TypeScript declarations.
Learn what TypeSafe can do in the TypeSafe docs. See the SDK's client and types for API options and defaults.
4,568 followers · starred Sep 2026
84 followers · starred Sep 2026
1,023 followers · starred Sep 2026
2,631 followers · starred Sep 2026