boat-sdk
Use Boat from your application code.
Install
pip install boat-sdk
Links
Flow
- Create an API key in the Boat dashboard.
- Create or resume a sandbox.
- Prompt the sandbox.
- Read events until the work is done.
- Open desktop access when you need browser or GUI visibility.
- Stop, resume, fork, or delete the sandbox according to your retention policy.
Notes
- Put cleanup in
finally: stop/archive or delete sandboxes you create for tests.
- Treat API key secrets, Boat secrets, SSH keys, and desktop stream URLs as sensitive.
updateSecrets / update_secrets replaces the entire secret setup. Read the current setup first and send every env var and secret file that should remain.
rotateApiKey / rotate_api_key rotates the raw secret in place. Store the returned secret immediately; it is shown once.
- Repository selection is idempotent. Selecting an already-selected repository updates its base branch.
Example
import os
import time
from boat_sdk import ApiClient, Configuration
from boat_sdk.api.boat_api import BoatApi
from boat_sdk.models.create_sandbox_request import CreateSandboxRequest
from boat_sdk.models.prompt_request import PromptRequest
from boat_sdk.models.update_sandbox_request import UpdateSandboxRequest
config = Configuration(
host=os.getenv("BOAT_BASE_URL", "https://boat.dev/api/v1"),
access_token=os.environ["BOAT_API_KEY"],
)
sandbox_id = None
with ApiClient(config) as client:
sandbox = BoatApi(client)
try:
created = sandbox.create(CreateSandboxRequest(ttl_seconds=1800))
sandbox_id = created.sandbox.id
sandbox.update(sandbox_id, UpdateSandboxRequest(name="sdk-demo"))
while sandbox.get(sandbox_id).sandbox.state not in {"ready", "idle"}:
time.sleep(2)
sandbox.prompt(
sandbox_id,
PromptRequest(
provider="codex",
prompt="Inspect the repository and summarize the test command.",
),
)
events = sandbox.events(sandbox_id)
print(events.events)
finally:
if sandbox_id:
sandbox.stop(sandbox_id)
License
This SDK is MIT licensed. Boat, the Boat API, the Boat CLI, and the sandbox product are proprietary.