Set environment variables
Each coding agent requires API keys to connect to their respective LLM providers.
- Local shell
- E2B
- Daytona
- Docker
Extracting API keys from current machine
Extracting API keys from current machine
Use
sandbox-agent credentials extract-env --export to extract your existing API keys (Anthropic, OpenAI, etc.) from local Claude Code or Codex config files.Testing without API keys
Testing without API keys
Use the
mock agent for SDK and integration testing without provider credentials.Multi-tenant and per-user billing
Multi-tenant and per-user billing
For per-tenant token tracking, budget enforcement, or usage-based billing, see LLM Credentials for gateway options like OpenRouter, LiteLLM, and Portkey.
Run the server
- curl
- npx
- bunx
- npm i -g
- bun add -g
- Node.js (local)
- Bun (local)
- Build from source
Install and run the binary directly.
0.0.0.0 allows the server to accept connections from any network interface, which is required when running inside a sandbox where clients connect remotely.Configuring token
Configuring token
Tokens are usually not required. Most sandbox providers (E2B, Daytona, etc.) already secure networking at the infrastructure layer.If you expose the server publicly, use Then pass the token when connecting:
--token "$SANDBOX_TOKEN" to require authentication:- TypeScript
- curl
- CLI
CORS
CORS
If you’re calling the server from a browser, see the CORS configuration guide.
Install agents (optional)
To preinstall agents:If agents are not installed up front, they are lazily installed when creating a session.
Install desktop dependencies (optional, Linux only)
If you want to use Then use
/v1/desktop/*, install the desktop runtime packages first:GET /v1/desktop/status or sdk.getDesktopStatus() to verify the runtime is ready before calling desktop screenshot or input APIs.Next steps
Session Persistence
Configure in-memory, Rivet Actor state, IndexedDB, SQLite, and Postgres persistence.
Deploy to a Sandbox
Deploy your agent to E2B, Daytona, Docker, Vercel, or Cloudflare.
SDK Overview
Use the latest TypeScript SDK API.
