BoatApi, configure auth, and call snake_case methods like sandbox.create, sandbox.prompt, and sandbox.events.
Configure
boat_sdk.models.
Prompting requires the selected provider (harness) to be configured for the authenticated account. Providers are codex, claude-code (alias claude), pi, opencode, prime-agent (alias prime), kimi, and mistral; omit provider to use the account’s dashboard default. If the selected provider’s credentials are missing, sandbox.prompt(...) raises ApiException with code provider_not_configured.
A Sandbox runs many conversations in parallel: pass new=True to start a fresh one or conversation_id to continue a specific one, and read conversation_id back off the response.
Create, prompt, and clean up
Machine size
Passtype to create a bigger Boat. large consumes machine time at 2x, small at half rate. A
fork inherits the source sandbox’s type, and passing type to resume or fork moves a sandbox between
sizes.
Per-sandbox environment variables
Passenv to inject variables into a single sandbox, on top of your account-level secrets
(per-sandbox values win on name conflicts). At most 100 variables, 64KB total.
env unless the fork supplies its own.
No-env sandboxes
When you hand a sandbox to your own end users, create it withno_env=True so none of your
account secrets reach it. Model keys, GitHub token, dashboard environment variables, SSH
identity, and secret files are all withheld. SSH, desktop, snapshots, public URLs, and
forks still work. A fork of a no-env Boat is always no-env and cannot be downgraded.
Methods
All methods are called onBoatApi. Request bodies use model classes from boat_sdk.models.
Browse a stopped sandbox’s filesystem
Snapshot reads never touch the machine, so they work while the sandbox is archived:Waiters and helpers
The package exports first-class waiters and deterministic file/command helper functions:wait_for_prompt/wait_for_prompt_done instead of inferring completion from sandbox.state plus event polling. Use stream_prompt or stream_events when you need incremental response/tool-call events as work runs.
Types
Python models use snake_case attributes. JSON serialization uses the API’s camelCase field names.Errors
Methods raiseApiException for non-2xx responses. Log the status, reason, and response body when debugging, but redact API keys, Boat secrets, SSH keys, and desktop URLs.
Streaming responses and tool calls
The Python helper module exportsstream_events and stream_prompt for response streaming. They long-poll the sandbox v1 events cursor API; no separate SSE or WebSocket endpoint is required. response events carry text in event.data.content; streaming partials set event.data.is_streaming; tool-call events are response events with event.data.tools.
stream_events(sandbox, sandbox_id, type="prompt,response").