SDK
ConceptualOfficial client libraries and typed helpers.
The SDK wraps the HTTP API with typed resources, streaming helpers, automatic retries and idempotency handling.
pnpm add @pimsy/sdkClient setup#
import { Pimsy } from class="tok-str">"@pimsy/sdk";
const pimsy = new Pimsy({
apiKey: process.env.PIMSY_API_KEY!,
workspace: class="tok-str">"ws_engineering",
maxRetries: class="tok-num">3,
timeout: 120_000
});Streaming a run#
const task = await pimsy.tasks.create({ objective: class="tok-str">"Audit the changelog for undocumented breaking changes." });
for await (const event of pimsy.runs.stream(task.runId)) {
switch (event.type) {
case class="tok-str">"plan.created": console.log(class="tok-str">"plan:", event.steps.length, class="tok-str">"steps"); break;
case class="tok-str">"step.started": console.log(class="tok-str">"→", event.title); break;
case class="tok-str">"approval.requested": await handleApproval(event); break;
case class="tok-str">"run.completed": console.log(class="tok-str">"done:", event.summary); break;
}
}Last updated 2026-09-15

