Skip to content
ChuskyChusky documentation

Build with the agent.
Keep the work durable.

Chusky gives developers a secure API and TypeScript SDK for building conversational products around a persistent, tool-using agent. Start in a server route, then add streaming, files, approvals, tasks, and webhooks as your product grows.

01 · Quickstart

A useful agent in minutes.

The SDK is designed for trusted server environments. Your application owns authentication; Chusky owns agent execution, tools, and durable state.

server.tsTypeScript SDK
import { Chusky } from "@chusky/sdk";

const chusky = new Chusky({
  apiKey: process.env.CHUSKY_API_KEY!,
  baseUrl: process.env.CHUSKY_BASE_URL,
  userId: session.user.id,
});

const thread = await chusky.threads.create();

for await (const event of chusky.threads
  .runs(thread.id).stream({
    input: "Prepare my renewal brief.",
  })) {
  if (event.type === "run.delta") {
    sendToClient(event.text);
  }
}

02 · The execution model

Conversation is the interface. Runs are the engine.

A run can stream text, call connected tools, request human approval, create a task, and be inspected after a network interruption. Background continuation depends on the required production services being configured.

Threads

Threads are owner-scoped. Cross-channel history is not automatic: linked private work and shared channel conversations follow different context rules.

Approvals

Approval policy can pause consequential actions. A decision is exact, owner-scoped, and time-limited.

Events

Typed run events expose progress, tool activity, failures, and completion to your interface.

03 · Files

Give the agent verified context.

Files are uploaded through short-lived, secure links. Chusky verifies ownership, size, and content type before a file reaches the model.

Create an upload intent
Upload to a secure link
Complete server-side verification
Attach the verified file ID to a run

04 · Keep building

Tasks, webhooks, models, and more.

Use the complete SDK documentation for model selection, file workflows, approvals, durable tasks, webhooks, security, errors, and production operations.

Open full SDK docs

The production checklist

Build for the moments after the happy path.

A production integration is not finished when the first stream renders. It is finished when a disconnected client can recover, an approval can be resumed, a provider failure is reported honestly, and a retried write cannot silently happen twice.

Identity

Derive user identity from your authenticated session and keep project keys on the server.

Durability

Persist thread and run IDs, then read current state before retrying after a lost connection.

Evidence

Use receipts and fresh provider readbacks to confirm external effects.

Boundaries

Keep credentials outside prompts and let approval policy protect consequential actions.