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:/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-keyswith{"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/streamsends a prompt likePOST /agent-sessionsand streams the turn. Frames are named by theirevent:field:status,delta(reply text),done(the completed turn), orerror. See Send a message to an agent.GET /agent-sessions/{id}/eventsreplays a session’s event log and then follows it. Each frame’sidis the event’s sequence number. Resume a dropped connection with?after_seq=or theLast-Event-IDheader.
-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.