Docs

SDK

The TypeScript SDK for AxAgent.

The SDK gives you typed access to every AxAgent API: agents, runs, sessions, memory, vectors, files, transcription, and computers.

Coming Q4 2026

The SDK ships with AxAgent. The API below may change before launch.

Install

pnpm add @axerity/sdk

Create a client

The client reads AXERITY_API_KEY from the environment. Every option is optional.

client.ts
import Axerity from '@axerity/sdk'

const axerity = new Axerity({
  maxRetries: 3,
  timeout: 60_000,
})

Conventions

Every resource follows the same pattern, so once you know one you know them all.

PatternExample
axerity.<resource>.create()axerity.agents.create({ model })
axerity.<resource>.retrieve(id)axerity.agents.retrieve('agt_123')
axerity.<resource>.update(id)axerity.agents.update('agt_123', {})
axerity.<resource>.list()axerity.agents.list({ limit: 50 })
axerity.<resource>.delete(id)axerity.agents.delete('agt_123')

IDs have a prefix that tells you what they are: agt_ for agents, run_ for runs, ses_ for sessions, file_ for files.

Runs

A run is one task for an agent. Use create to wait for the result, or stream to get events as they happen.

const stream = axerity.runs.stream({
  agent: agent.id,
  input: 'Fix the failing tests in acme/web',
})

for await (const event of stream) {
  if (event.type === 'text.delta') process.stdout.write(event.delta)
}

const run = await stream.finalRun()

Tools and structured output

Tools and structured output take a Standard Schema, such as Zod. Inputs and outputs are fully typed.

import { tool } from '@axerity/sdk'
import { z } from 'zod'

const getOrder = tool({
  name: 'get_order',
  description: 'Look up an order by its ID',
  input: z.object({ orderId: z.string() }),
  execute: ({ orderId }) => db.orders.find(orderId),
})

Set needsApproval: true on a tool to pause the run until you call axerity.runs.approve(). See Tools and Structured output.

Pagination

List methods return an async iterator that fetches pages for you.

for await (const agent of axerity.agents.list()) {
  console.log(agent.id)
}

Errors and retries

Failed requests are retried with exponential backoff on connection errors, 408, 409, 429, and 5xx responses. Errors are typed.

ErrorWhen
Axerity.AuthenticationErrorThe API key is missing or invalid
Axerity.RateLimitErrorToo many requests
Axerity.NotFoundErrorThe resource does not exist
Axerity.APIErrorAny other error from the API

Every error has status, code, and requestId. See Errors and requests.

Request options

Every method accepts request options as its last argument.

await axerity.runs.create(
  { agent: agent.id, input: 'Draft the weekly report' },
  { idempotencyKey: 'weekly-report-2026-10-10', signal, timeout: 120_000 },
)

Webhooks

Use axerity.webhooks.unwrap() to verify a webhook and get a typed event.

const event = await axerity.webhooks.unwrap(body, request.headers)

Guides

On this page