# The TypeScript SDK.

Discover, inspect and run tools from your own code, with adapters for OpenAI, Anthropic and the AI SDK.

Updated: 2026-11-04.
## Install

The SDK has no dependency and runs in Node 20 or later, browsers, Workers and Deno.

```sh
npm install @get-agentik/sdk
```

## Discover, inspect, run

```ts
import { Agentik } from "@get-agentik/sdk";

const agentik = new Agentik({ apiKey: process.env.AGENTIK_API_KEY });
const hits = await agentik.discover("backlinks of a domain");
const spec = await agentik.inspect(hits[0]!.tool_id);
const run = await agentik.run(spec.id, { target: "example.com" }, { idempotencyKey: crypto.randomUUID() });
console.log(run.status, run.price_billed_usd, run.output);
```

`discover` and `inspect` need no key. `run`, `getRun`, `waitForSettlement` and `wallet` need a workspace key, which you create in your [workspace](/dashboard/keys).

## Use it with a model

`toOpenAiTools`, `toAnthropicTools` and `toAiSdkTools` turn tool specs into each format's tool definitions. `executeToolCall` runs a call the model returned.

## Errors and retries

A 429 is retried with the server's `retry_after_ms`. Out of credit throws an `InsufficientCreditsError`, whose top-up link only a person can complete. See [errors and recovery](/docs/errors) and [idempotency](/docs/idempotency).

The source is open (MIT): [github.com/agent-tool-router/agentik](https://github.com/agent-tool-router/agentik).

---

[HTML page](/docs/sdk) · [Agent index](/llms.txt)
