Skip to main content
The hosted platform at app.amika.dev exposes a REST API. The CLI, the web UI, and the TypeScript SDK all use it. This page covers what applies to every endpoint. For each endpoint’s parameters and schemas, see the API reference.

Base URL

v0beta1 is a beta version. Endpoints and fields can still change.

Authentication

Send an Amika API key as a bearer token on every request:
Every path under /api/v0beta1 requires authentication except the spec and docs pages (/openapi.json, /docs, /llms.txt). A request without a valid token gets a 401, even when the path doesn’t exist.

Create an API key

  • Web UI: Settings → API Keys at app.amika.dev/settings/api-keys. The key is shown once, so copy it then.
  • CLI: amika auth api-key create --name <name> --out <file> writes the new key to a file without printing it.
  • HTTP API: POST /api-keys with {"name": "..."}.
amika auth api-key create ships in the amika CLI release after v0.23.0. With an older CLI, use the web UI.

Key scopes

Rigs that an organization key starts count as service-account rigs on pricing.

Rigs and sandboxes in paths

rig is the product term. The API serves every rig route under both names, so these pairs are the same endpoints: Request and response fields still use the older name, such as sandbox_id and sandbox_name. A rig path’s {id} accepts the rig’s ID or its name.

Resources

Errors

A failed request returns a JSON error body:
error_code is stable, so branch on it rather than on message. details appears on some errors, such as validation failures. Every response carries an x-trace-id header. Include it when you report a problem. Errors you’re likely to handle:

Pagination

Most list endpoints return everything in one response. The ones that paginate don’t all use the same parameters:

Streaming

Two endpoints answer with Server-Sent Events (text/event-stream):
  • POST /agent-sessions/stream sends a prompt like POST /agent-sessions and streams the turn. Frames are named by their event: field: status, delta (reply text), done (the completed turn), or error. See Send a message to an agent.
  • GET /agent-sessions/{id}/events replays a session’s event log and then follows it. Each frame’s id is the event’s sequence number. Resume a dropped connection with ?after_seq= or the Last-Event-ID header.
Pass -N to curl so it prints frames as they arrive.

Spec and tools

Interactive docs

Browse endpoints and try requests.

OpenAPI spec

Generate clients and load the API into tools.

llms.txt

A plain-text reference for AI assistants.
The TypeScript SDK wraps the most common endpoints.