boat api-key create <name> or in the Boat dashboard. Keys start with boat_ (older box_ keys still work). Things to know before you write:
- Which key. An organization key works on the organization’s sandboxes, environments, snapshots, limits and usage. Account settings (webhooks, API keys, credential profiles, CI, telemetry, AI proxy, secrets, repositories, caller address, data retention) answer 403
api_key_org_forbiddento it: use a personal account key there. A scoped key (apiKeys.createScoped) can be limited to some sandboxes, environments or actions. - Sandboxes bill while they run.
sandboxes.create,fork,resumeandrecoverstart a machine that bills until it stops (ttlSeconds, default one hour;nullturns auto-stop off), so they aredestructive.sandboxes.stopsaves the disk and stops billing; a stopped sandbox reads asarchived. SendidempotencyKeywith create and fork to make a retry safe. A full start window answers 429rate_limitedand is not retried:account.getLimitsshowscanStartand what is left. - Commands and files go to the sandbox machine.
sandboxes.commands.runwaits for the command (30 s by default, up to 600 s); start long jobs withdetached: true, then readcommands.getStatusorcommands.attach. A call right after a start can answer 409sandbox_starting: retry after a few seconds. File reads stop at 5 MiB (413); usefiles.createDownloadUrlfor bigger files. - Integrated agents (
sandboxes.agent.*) run Codex, Claude Code, pi, OpenCode and other harnesses inside the sandbox with the model key or subscription connected on the dashboard, so a prompt spends that account’s model usage. With no harness set up at all, prompts answer 409provider_not_configured; a prompt to a provider that has no key is accepted and the run fails in the harness (agent.getPromptshowsfailed). - Snapshots. Every stop leaves a snapshot (
snapshots.*,sandboxes.snapshots.*); a fork or resume starts from it. Saved snapshots (savedSnapshots.*, with share codes) need a paid plan: the free trial answers 403. A command in the first seconds after a fork or resume can answer 502sandbox_restoring(it did not run): retry after 1-3 s. - Deletes of sandboxes and snapshots take the id a second time as
confirm, Boat’s guard against deleting the wrong one. - Webhooks. Boat posts sandbox lifecycle events (
sandbox.ready,hydrated,error,archived,degraded,recovered) to endpoints made withwebhooks.create, signed with HMAC-SHA256 (X-Ascii-Signature). The plugin checks the signature with the endpoint’swhsec_secret.
- 125 typed API operations
- 6 incoming webhook event types
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Boat API key before the first call: More: API Key
pnpm corsair setup --plugin=boat --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List sandboxesWebhooks
This plugin registers 6 webhook event types. Configure the provider to POST to your Corsair HTTP handler, then usewebhookHooks on the plugin factory.
See Webhooks for every event path and payload shape, and Webhooks concept for routing.
What’s next
API reference
Every
boat.api.* operation with input and output types.Webhooks
Event paths, payloads, and
webhookHooks examples.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.