Skip to main content
We provide official SDKs for seamless integration with your preferred language.
v1.0 is out. Both SDKs are on v1.0 — response types (Run, Usage, ReasoningTask) are flat and match the canonical API wire format, and both support multimodal input via Image / content[] and lifecycle-managed services via resources[]. Upgrading from 0.x in Node? See the Node SDK migration guide.

Install an official SDK

Install the official TypeScript/JavaScript SDK from npm.
npm install subconscious
A simple API request would look like this:
import { Subconscious } from "subconscious";

const client = new Subconscious({
  apiKey: process.env.SUBCONSCIOUS_API_KEY!,
});

const run = await client.run({
  engine: "tim",
  input: {
    instructions: "Your task here",
    tools: [],
  },
  options: { awaitCompletion: true },
});

console.log(run.result?.answer);

SDK Methods

Both SDKs provide the same core methods:
MethodDescription
client.run()Create and optionally wait for a run
client.stream()Create a run and stream events
client.get(runId)Get the status of a run
client.wait(runId)Poll until a run completes
client.cancel(runId)Cancel a running or queued run

Skills

Both SDKs support Skills. Pass an array of skill names in input.skills to give your agent specialized knowledge:
const run = await client.run({
  engine: "tim-claude",
  input: {
    instructions: "Review this code",
    skills: ["security-review", "coding-standards"],
  },
  options: { awaitCompletion: true },
});

Webhooks

Both SDKs support per-run webhook callbacks with output.callbackUrl. For org-wide subscriptions, use the webhooks API or the dashboard.
const run = await client.run({
  engine: "tim-claude",
  input: { instructions: "Generate a report" },
  output: { callbackUrl: "https://your-server.com/webhook" },
});

Next Steps

Quickstart

See the SDKs in action with a complete example

Core Concepts

Learn about Runs, Tools, and Streaming