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.

Once you have a running sandbox, you can drive its coding agent (Claude Code, Codex, OpenCode, etc.) by sending a single prompt synchronously. The call blocks until the agent finishes and returns the result.

Prerequisites

Step 1 — Send a prompt

By default the call uses Claude. Pass --agent / agent to switch agents.
amika sandbox agent-send dev-box "Add unit tests for the auth module"

Step 2 — Continue or start a fresh session

By default, both the CLI and SDK resume the most recent session for the sandbox. Force a new session with --new-session / newSession, or pick a specific one with --session-id / sessionId.
# Start fresh
amika sandbox agent-send dev-box "Refactor the API layer" --new-session

# Resume a specific session
amika sandbox agent-send dev-box "Now write the tests" \
  --session-id 3f2a...

Response shape

agentSend returns the agent’s text output, the session id it ran in, and a flag indicating whether the agent itself reported an error.
interface AgentSendResponse {
  result: string;     // the agent's textual response
  sessionId: string;
  isError: boolean;
}
On the wire the field is named response; the SDK maps it to result for consistency with the rest of the surface.

Things to know

  • agent-send blocks. The endpoint waits for the agent to finish before returning. The SDK uses a 10-minute HTTP timeout for this call (the default elsewhere is 30 seconds). Anything that wraps the SDK (Lambda, Cloudflare Worker, etc.) needs at least that much runtime budget.
  • Agent-side auth errors get rewritten. If the upstream provider returns a 401 (e.g. an Anthropic auth failure), the SDK surfaces a friendlier message. You can also call extractAgentAuthError to detect this case.
  • CLI default is resume. Without --new-session or --session-id, the CLI resumes the stored session for the sandbox. The same is true for the SDK.

Next steps

Manage sessions

SSH into the sandbox

Programmatic walkthrough