Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.amika.dev/llms.txt

Use this file to discover all available pages before exploring further.

The TypeScript SDK wraps the hosted Amika API. This page gets you from install to a running agent in a few lines. The source lives in the amika repo under sdk/typescript.

Install

npm install @amika/sdk

Get an API token

Generate an Amika API key in the web UI at app.amika.dev/settings. The SDK does not read it from your environment automatically — you pass it to the client.

Create a client

import { AmikaClient } from "@amika/sdk";

const amika = new AmikaClient({
  baseUrl: process.env.AMIKA_API_URL ?? "https://app.amika.dev",
  accessToken: process.env.AMIKA_API_KEY!,
});
The client appends the API path prefix (/api/v0beta1) to baseUrl for you, so pass just the origin.
accessToken and tokenSource are mutually exclusive. For tokens that need to be fetched or refreshed, use a tokenSource instead — see Token sources.

Create a sandbox and run an agent

// 1. Create a sandbox and wait for it to be ready
const sb = await amika.createSandbox({
  name: "dev-box",
  preset: "coder",
});
await amika.waitForSandbox(sb.name);

// 2. Send a prompt to the agent (blocks until it finishes)
const res = await amika.agentSend(sb.name, {
  message: "Add unit tests for the auth module",
});
console.log(res.result);

// 3. Tear down
await amika.deleteSandbox(sb.name);

Timeouts and polling

  • Default HTTP timeout: 30 seconds.
  • agentSend HTTP timeout: 10 minutes — it blocks until the agent finishes.
  • waitForSandbox / waitForSandboxStart / waitForSandboxStop poll every 3 seconds with no client-side timeout. They throw if the sandbox enters the failed state.

Next steps

Client reference

Every method on AmikaClient.

Types

Request and response interfaces.

Errors

AmikaError, AmikaHTTPError, and agent-auth detection.

Token sources

Static tokens and custom token providers.