Skip to main content
AmikaClient is the entry point for the TypeScript SDK. Construct one with a base URL and a token, then call methods on it.

Constructor

  • baseUrl — the API origin. The client appends /api/v0beta1.
  • accessToken — a static bearer token.
  • tokenSource — a provider for dynamic/refreshing tokens. See Token sources.
  • fetch — supply a custom fetch for tests or non-standard runtimes.
The SDK does not read AMIKA_API_KEY from the environment or disk — you source the token yourself.

Methods

All methods are async. Paths shown are relative to the /api/v0beta1 prefix.

Sandboxes

createSandbox returns immediately with state initializing. Use waitForSandbox to block until it’s ready. The wait helpers poll every 3 seconds with no client-side timeout. They throw an AmikaError if the sandbox enters the failed state.

SSH

getSSH returns a destination, a token, an expiry, and the repo subdir — hand these to your own SSH client. See SSH and connect.

Agent

agentSend blocks until the agent finishes and uses a 10-minute HTTP timeout (every other call defaults to 30 seconds). It detects agent-side auth failures and rewrites them to a friendlier error — see Errors.

Sessions

getLatestSession returns null on a 404 (meaning “no session yet”) rather than throwing.

Secrets

There is no deleteSecret for generic secrets — the server doesn’t expose one. Provider secrets can be deleted (below).

Provider secrets

provider is "claude" or "codex".

See also

Types

Request and response interfaces.

Errors

Error classes and helpers.