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.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.
Prerequisites
- A sandbox in the
active/running/startedstate. See Create a sandbox. - Agent credentials injected at sandbox-create time. See Inject credentials.
Step 1 — Send a prompt
By default the call uses Claude. Pass--agent / agent to switch agents.
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.
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.
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-sendblocks. 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
extractAgentAuthErrorto detect this case. - CLI default is resume. Without
--new-sessionor--session-id, the CLI resumes the stored session for the sandbox. The same is true for the SDK.