amika repo under
sdk/typescript.
Install
The SDK requires Node 18 or later.Get an API key
Create an Amika API key in the web UI at app.amika.dev/settings/api-keys. From the CLI,amika auth api-key create --name <name> --out <file> writes a
new key to a file without printing it.
The SDK does not read the key from your environment automatically. You pass
it to the client.
Create a client
baseUrl is optional and defaults to https://app.amika.dev. If you set it,
pass only the origin. The client appends the /api/v0beta1 prefix for you.
Provide exactly one of
apiKey, accessToken, or tokenSource. Use a
tokenSource for tokens that need to be fetched or refreshed. See
Token sources.Create a rig and run an agent
agentCredentials: [{ kind: "claude" }] asks the server to pick your stored
Claude credential. Omitting agentCredentials injects no agent credentials.
See Inject credentials.
An agent failure returns isError: true with details in response, even when
the HTTP request succeeds. Check it before using the reply.
Timeouts and polling
- Ordinary requests time out after 30 seconds.
- Agent sends (
sendandsendStream) time out after 10 minutes. rig.wait()polls every 3 seconds with a 15-minute total deadline. It throwsAmikaWaitErrorif provisioning or setup fails, or the deadline passes. Pass{ pollMs, maxWaitMs }to change either.
Next steps
Client reference
Every collection and method on
AmikaClient.Types
Request and response interfaces.
Errors
AmikaError, AmikaHTTPError, and AmikaWaitError.Token sources
Static keys and custom token providers.