Via the console
- On the Secrets page, create a secret with the Anthropic provider and paste your API key — you only do this once, and the key never enters the sandbox.
- Go to console.superserve.ai and click Create sandbox.
-
Pick the
superserve/node-22template. -
Under Advanced Options → Secrets, bind that secret to
ANTHROPIC_API_KEY. -
Create the sandbox, open its Terminal, and run:
Via the SDK
ANTHROPIC_API_KEY as usual, but its value is a stand-in token — the real key is attached only on requests to Anthropic, never exposed to the agent.
Open the sandbox in the console, launch the terminal, and run opencode.
Persist sessions
Delete when finished
A paused sandbox is kept until you delete it. When you no longer need the sandbox, delete it. This also deletes its files and saved state.Sandbox.killById() (TypeScript) or Sandbox.kill_by_id() (Python). To delete paused sandboxes automatically, see Auto-delete.
Run workspaces in sandboxes
OpenCode workspaces run a session in another environment while you keep using OpenCode on your machine. Add a workspace plugin that gives each workspace its own Superserve sandbox. The agent’s shell commands, file edits, and model calls then run in the sandbox, and the sessions still show in your local OpenCode.Workspaces are experimental in OpenCode. Set
OPENCODE_EXPERIMENTAL_WORKSPACES=true to turn them on.anthropic-key secret from Via the SDK, so the sandbox gets a stand-in token and never your real key.
-
Add the Superserve SDK to
~/.config/opencode/package.json. OpenCode installs it when it starts. -
Save the plugin as
~/.config/opencode/plugins/superserve.ts. Keep it in your global config, so the copy of the project in the sandbox does not load it. -
In a git project, start OpenCode with workspaces turned on:
-
Run
/warpand select Superserve under New workspace. Your next prompt runs in the new sandbox. Run/workspacesto see or delete workspaces. Deleting a workspace deletes its sandbox.
OPENCODE_EXPERIMENTAL_WORKSPACES=true opencode serve in the project. Then install a client and call the server API:
- The plugin copies the committed files of your current branch into the sandbox, at the same path as on your machine. Commit your changes before you create a workspace. Run OpenCode on macOS or Linux, because the sandbox uses Linux paths.
- Edits in a workspace stay in its sandbox. Your local files do not change.
- The OpenCode server in the sandbox listens on a private preview port. The plugin sends the preview token with each request.
- Keep the sandbox running while you use the workspace. Requests through the preview URL do not resume a paused sandbox, so the workspace disconnects. Resume the sandbox, for example with
Sandbox.connect(), then restart OpenCode to reconnect.