SDK

SDK Overview

Introduction to the official TypeScript and Python SDKs.

SDK Overview

The official SDKs make it easy to create agents, call tools, and handle streaming responses in your application code.


Available SDKs

We ship and officially support TypeScript/Node.js and Python. Community SDKs for Go and Ruby are also available on GitHub.

Installation

Install the TypeScript SDK with npm install @ai-agent/sdk or the Python SDK with pip install ai-agent-sdk.

Why use the SDK?

The CLI is great for running agents from your terminal or CI. The SDK is for embedding Queue agents into your own application: a web app, an API server, an internal tool, or an automated pipeline.

Available SDKs

TypeScript / Node.js

The primary SDK. Fully typed, supports ESM and CJS, and works in Node.js 18+, Cloudflare Workers, and Vercel Edge Runtime. Install with npm install @queue/sdk.

Python

Supports both sync and async usage. Compatible with FastAPI, Django, Flask, and raw asyncio. Install with pip install queue-sdk.

Core concepts

QueueClient

The top-level client object. Initialize it once with your API key and reuse it across requests. It is thread-safe and handles connection pooling, retries, and rate limiting automatically.

agents.run()

Start a run and wait for it to complete. Returns a RunResult with the final output, step count, token usage, and a link to the full trace.

agents.stream()

Start a run and stream events as they happen. Use this when you want to display real-time progress to users — each event includes the type (token, tool_call, step, done) and relevant data.

Custom tools in the SDK

Define tools as typed functions and pass them to the run config. Queue serializes their schemas automatically and routes calls back to your function at runtime:

const result = await client.agents.run({ agent: ‘refactor-agent’, goal: ‘Simplify the auth module’, tools: [myCustomTool] });

On this page

Create a free website with Framer, the website builder loved by startups, designers and agencies.