utopianlabs
v0.1.14
Published
Official TypeScript SDK for the Utopian Labs API
Downloads
1,525
Readme
Utopian Labs TypeScript SDK
The Utopian Labs TypeScript SDK provides convenient access to the Utopian Labs API from applications written in server-side TypeScript.
Documentation
See the utopianlabs API docs for Node.js.
Requirements
Node 20 or higher.
Installation
Install the package with:
npm install utopianlabs
# or
yarn add utopianlabsUsage
The package needs to be configured with your account's API key, which is available in the Utopian Labs API Keys page.
Create a new agent run
import { UtopianLabs } from "utopianlabs";
const utopianLabs = new UtopianLabs({ apiKey: "your-api-key" });
const run = await utopianLabs.agents.runs.create({
agent: "r1",
lead: {
company: {
website: "https://example.com",
},
},
});
console.log(run);Fetch an agent run
import { UtopianLabs } from "utopianlabs";
const utopianLabs = new UtopianLabs({ apiKey: "your-api-key" });
const runData = await utopianLabs.agents.runs.get({
id: "abc123",
});
console.log(runData);Cancel an agent run
import { UtopianLabs } from "utopianlabs";
const utopianLabs = new UtopianLabs({ apiKey: "your-api-key" });
const runData = await utopianLabs.agents.runs.cancel({
id: "abc123",
});
console.log(runData);