Skip to main content
We provide official SDKs for seamless integration with your preferred language.

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-gpt",
  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

Next Steps