---
title: "SDK Installation"
description: "Install the Aeontel SDK and construct an Aeontel client."
section: "Libraries"
group: "SDK"
---

# SDK Installation

## Install

```bash
pnpm add @aeontel/sdk
# or
npm install @aeontel/sdk
# or
yarn add @aeontel/sdk
```

The package is pure TypeScript, works in Node 22+, modern browsers, Bun, Deno, and Cloudflare Workers. It has zero runtime dependencies.

## Construct a client

```ts
import Aeontel from "@aeontel/sdk";

const client = new Aeontel("sec_...");
```

`apiKey` is positional, not nested in options. Pass `null` to use cookie auth (see [Authentication](/sdk/authentication)). If omitted, the SDK falls back to the `AEONTEL_API_KEY` environment variable.

## Options

```ts
const client = new Aeontel("sec_...", {
  baseURL: "https://api.aeontel.com", // default
  timeout: 30_000, // ms, default
  maxRetries: 2, // retries 429 / 5xx, default
  workspaceId: "wsp_...", // auto-filled on every call
  headers: { "x-caller": "my-app" }, // sent with every request
});
```

`workspaceId` is particularly useful — set it once and every request that takes a `workspaceId` body field or `workspace_id` query param is filled automatically. Explicit per-call values always win.

## From a Cloudflare Worker

If your Worker has the API bound via `services` in `wrangler.jsonc`, pass the binding directly and requests go through `binding.fetch()` without hitting the public internet.

```ts
import Aeontel from "@aeontel/sdk";

export default {
  async fetch(request: Request, env: Env) {
    const client = new Aeontel(null, { binding: env.AEONTEL_API });
    const agents = await client.agents.list({ workspace_id: "wsp_..." });
    return Response.json(agents.data);
  },
};
```
