> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Boat API reference

> API reference for the Boat plugin in Corsair: every `boat.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Account

### getCallerAddress

`account.getCallerAddress`

Get the caller's address. The public address that this request comes from, as boat sees it. Use it as an entry of network.inboundAllow. Your network can use another address for the other IP version (IPv4 or IPv6): add both. Any key or session can call this route. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.account.getCallerAddress({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `address` | `string \| null \| null` | No | The public address that this request comes from, as boat sees it. Null when boat cannot tell. Use it as an entry of `network.inboundAllow`. |

***

### getDataRetention

`account.getDataRetention`

Get account data-retention policy. Returns the current zero-data-retention policy. Per-Boat API keys cannot access this account-wide setting. Responses are never cached. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.account.getDataRetention({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `enabledAt` | `string \| null \| null` | No | — |
| `queuedSandboxes` | `number \| null` | No | Archived Sandboxes newly queued for deletion by this policy update. |
| `acceptedDeletionOperationsIrreversible` | `boolean \| null` | No | Always true on updates. Disabling the policy does not cancel accepted deletion operations. |
| `snapshotsOff` | `boolean \| null` | No | When true, every new sandbox of this account is created with snapshots off. |
| `snapshotsOffAt` | `string \| null \| null` | No | — |
| `monitoringOff` | `boolean \| null` | No | When true, every new sandbox of this account is created with monitoring off. |
| `monitoringOffAt` | `string \| null \| null` | No | — |

***

### getLimits

`account.getLimits`

Get Boat limits. Check remaining machine starts, included VM time, the wallet, overage prices, access readiness, and concurrent-sandbox capacity for the wallet a create would bill: the org / X-Boat-Org you pass (id or name), else the account's active wallet, else personal.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.account.getLimits({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `teamId` | `string` | No | Legacy alias for `org`. Takes precedence over `org` / `X-Boat-Org` when set. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `accessTier` | `string \| null` | No | — |
| `blockedReason` | `string \| null \| null` | No | — |
| `currentLimits` | `object \| null` | No | — |
| `standardLimits` | `object \| null` | No | — |
| `trialLimits` | `object \| null` | No | — |
| `upgradeEffects` | `object \| null` | No | — |
| `canStart` | `boolean \| null` | No | Whether the authenticated account can create or operate sandboxes right now. |
| `checkoutRequired` | `boolean \| null` | No | — |
| `startBlockedReason` | `string \| null \| null` | No | — |
| `contactMessage` | `string \| null \| null` | No | — |
| `activeSandboxes` | `number \| null` | No | — |
| `activeStates` | `string[] \| null` | No | — |
| `maxActiveSandboxes` | `number \| null` | No | — |
| `maxCreationRequestsPerMinute` | `number \| null` | No | — |
| `maxCreationRequestsPerDay` | `number \| null \| null` | No | — |
| `startLimits` | `object \| null` | No | Plan caps for machine starts. Null on unlimited accounts. Create, fork and resume each count as one start. |
| `wallet` | `object \| null` | No | The one wallet of this account or organization, in US dollars. It pays overage only: VM time past the plan, saved snapshots past the included count, extra starts and the AI proxy. It never pays the plan. Null on unlimited accounts. |
| `planIncluded` | `object \| null` | No | What the plan includes this billing period. Null on unlimited accounts. |
| `overagePrices` | `object \| null` | No | What the wallet pays past the plan. |
| `nextStartDollars` | `number \| null \| null` | No | What the next start costs now. 0 inside every limit; null when it would be refused. |
| `startLimitsWithWallet` | `object \| null` | No | Start ceilings with extra starts: the hour and day limits times `overagePrices.startLimitMultiplier`, and the minute limit times `overagePrices.startMinuteLimitMultiplier`. Starts above `startLimits` and up to these ceilings are paid from the wallet at the `overagePrices.startBrackets` prices. Null when extra starts are not available now (before the first payment, an empty wallet, extra starts set to fail, or an unlimited account). |
| `starts` | `object \| null` | No | Remaining machine starts in the rolling minute, hour and day windows. Null windows mean the account is unlimited. |
| `creditBalanceHours` | `number \| null \| null` | No | Deprecated. Read `planIncluded.vmHoursRemaining` and `wallet.balanceDollars`. |
| `packBalanceHours` | `number \| null` | No | Deprecated. Read `wallet.balanceDollars`. |
| `packBalanceDollars` | `number \| null` | No | Deprecated. Read `wallet.balanceDollars`. |
| `hasPaymentHistory` | `boolean \| null` | No | — |
| `subscriptionQuotaSeconds` | `number \| null` | No | — |
| `subscriptionRemainingSeconds` | `number \| null` | No | — |
| `packBalanceSeconds` | `number \| null` | No | Deprecated. Read `wallet.balanceDollars`. |
| `creditPurchasedSeconds` | `number \| null` | No | Deprecated. |
| `creditUsedSeconds` | `number \| null` | No | — |
| `liveUsageSeconds` | `number \| null` | No | — |
| `creditSecondsPerDollar` | `number \| null` | No | — |
| `sandboxPlanKey` | `string \| null` | No | Current plan key, or `trial` before any payment. |
| `sandboxPlanDollars` | `number \| null` | No | Monthly price of the current plan in dollars. |
| `sandboxPlanTiers` | `object[] \| null` | No | Every plan tier and its limits. |
| `accountPlan` | `string \| null` | No | — |
| `plan` | `string \| null \| null` | No | `service` for service accounts, otherwise null. |
| `planName` | `string \| null \| null` | No | `Service` for service accounts, otherwise null. |
| `serviceAccount` | `boolean \| null` | No | — |
| `unlimited` | `boolean \| null` | No | True when the account has no machine-time or start limits. |
| `hasSeatPlan` | `boolean \| null` | No | True when an organization has an active per-seat plan. |
| `last24hUsageSeconds` | `number \| null` | No | Machine time used in the last 24 hours, in seconds. Useful to estimate how long the included time and the wallet last. |
| `trialComputeCapSeconds` | `number \| null \| null` | No | Lifetime VM-time allowance for new sandboxes while the account has not paid, a plan trial included. Null once the account has paid. |
| `trialComputeUsedSeconds` | `number \| null \| null` | No | VM time already used against trialComputeCapSeconds. Null once the account has paid. |
| `trialLine` | `string \| null \| null` | No | The trial limits in one readable line. Null on paid accounts. |
| `machineTypes` | `object[] \| null` | No | Each sandbox type, and whether this account can create it now. A blocked type carries the reason. |
| `giftLimit` | `object \| null` | No | Fair-use caps on a gifted account, or null when there are none. |
| `billingStatus` | `string \| null` | No | Account access state returned by the current backend. Billing endpoints are not part of v1. |
| `subscriptionStatus` | `string \| null \| null` | No | — |
| `subscriptionCancelAtPeriodEnd` | `boolean \| null` | No | — |
| `hasSubscription` | `boolean \| null` | No | — |
| `subscriptionTrialEndsAt` | `string \| null \| null` | No | — |
| `subscriptionCurrentPeriodEnd` | `string \| null \| null` | No | — |
| `creditBalanceSeconds` | `number \| null` | No | Deprecated. Read `planIncluded.vmHoursRemaining` and `wallet.balanceDollars`. |
| `teamId` | `string \| null` | No | Present when limits were read for a team wallet (`?teamId=`, `?org=`, or `X-Boat-Org`). |
| `teamRole` | `string \| null` | No | Caller's role on that team when `teamId` is present. |

> [accordion] currentLimits full type
>
> ```ts theme={null}
> {
>   activeSandboxes?: number | null,
>   creationRatePerMinute?: number | null,
>   creationRequestsPerHour?: number | null | null,
>   creationRequestsPerDay?: number | null | null
> } | null
> ```

> [accordion] standardLimits full type
>
> ```ts theme={null}
> {
>   activeSandboxes?: number | null,
>   creationRatePerMinute?: number | null,
>   creationRequestsPerHour?: number | null | null,
>   creationRequestsPerDay?: number | null | null
> } | null
> ```

> [accordion] trialLimits full type
>
> ```ts theme={null}
> {
>   activeSandboxes?: number | null,
>   creationRatePerMinute?: number | null,
>   creationRequestsPerHour?: number | null | null,
>   creationRequestsPerDay?: number | null | null
> } | null
> ```

> [accordion] upgradeEffects full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] startLimits full type
>
> ```ts theme={null}
> {
>   perMinute?: number | null,
>   perHour?: number | null,
>   perDay?: number | null
> } | null | null
> ```

> [accordion] wallet full type
>
> ```ts theme={null}
> {
>   balanceDollars?: number | null
> } | null | null
> ```

> [accordion] planIncluded full type
>
> ```ts theme={null}
> {
>   vmHours?: number | null,
>   vmHoursRemaining?: number | null,
>   periodEnd?: string | null | null
> } | null | null
> ```

> [accordion] overagePrices full type
>
> ```ts theme={null}
> {
>   vmHourDollars?: number | null,
>   savedSnapshotDayDollars?: number | null,
>   startBrackets?: {
>     aboveMultiple?: number | null,
>     upToMultiple?: number | null,
>     dollars?: number | null
>   }[] | null,
>   startLimitMultiplier?: number | null,
>   startMinuteLimitMultiplier?: number | null
> } | null
> ```

> [accordion] startLimitsWithWallet full type
>
> ```ts theme={null}
> {
>   perMinute?: number | null,
>   perHour?: number | null,
>   perDay?: number | null
> } | null | null
> ```

> [accordion] starts full type
>
> ```ts theme={null}
> {
>   unlimited?: boolean | null,
>   minute?: {
>     limit?: number | null,
>     used?: number | null,
>     remaining?: number | null
>   } | null | null,
>   hour?: {
>     limit?: number | null,
>     used?: number | null,
>     remaining?: number | null
>   } | null | null,
>   day?: {
>     limit?: number | null,
>     used?: number | null,
>     remaining?: number | null
>   } | null | null
> } | null
> ```

> [accordion] sandboxPlanTiers full type
>
> ```ts theme={null}
> {
>   key?: string | null,
>   dollars?: number | null,
>   displayPrice?: string | null,
>   maxActiveSandboxes?: number | null,
>   startsPerMinute?: number | null,
>   startsPerHour?: number | null,
>   startsPerDay?: number | null,
>   includedSeconds?: number | null,
>   purchasable?: boolean | null
> }[] | null
> ```

> [accordion] machineTypes full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   available?: boolean | null,
>   reason?: string | null | null
> }[] | null
> ```

> [accordion] giftLimit full type
>
> ```ts theme={null}
> {
>   maxActiveSandboxes?: number | null | null,
>   maxTtlSeconds?: number | null | null,
>   line?: string | null | null,
>   message?: string | null
> } | null | null
> ```

***

### getMe

`account.getMe`

Get current Boat user. Returns GitHub identity for the authenticated Boat account.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.account.getMe({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `user` | `object \| null` | No | — |

> [accordion] user full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   login?: string | null,
>   email?: string | null | null,
>   displayName?: string | null,
>   connectionMethod?: string | null,
>   connectionMethods?: string[] | null,
>   accountPlan?: string | null,
>   serviceAccount?: boolean | null,
>   accountStatus?: string | null,
>   suspended?: boolean | null,
>   suspendedAt?: string | null | null,
>   suspendedReason?: string | null | null,
>   closed?: boolean | null,
>   closedAt?: string | null | null,
>   purgeAt?: string | null | null,
>   purgedAt?: string | null | null,
>   closureContactEmail?: string | null,
>   zeroDataRetention?: boolean | null,
>   zeroDataRetentionEnabledAt?: string | null | null
> } | null
> ```

***

### updateDataRetention

`account.updateDataRetention`

Update account data-retention policy. Requires an interactive sandbox session; API keys and legacy permanent tokens are refused. Enabling requires the exact confirmation phrase delete archived sandbox data. Disabling affects future archives only and cannot cancel deletion operations already accepted. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.account.updateDataRetention({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `enabled` | `boolean` | No | — |
| `snapshotsOff` | `boolean` | No | Turn snapshots off for every sandbox created from now on. Existing sandboxes keep their setting. While on, a create or fork that passes `snapshots: true` is refused with 409 `snapshots_off_for_account`. |
| `monitoringOff` | `boolean` | No | Turn monitoring off for every sandbox created from now on. Existing sandboxes keep their setting. While on, a create or fork that passes `monitoring: true` is refused with 409 `monitoring_off_for_account`. |
| `confirmation` | `delete archived sandbox data` | No | Required when enabling and must exactly equal `delete archived sandbox data`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `enabled` | `boolean \| null` | No | — |
| `enabledAt` | `string \| null \| null` | No | — |
| `queuedSandboxes` | `number \| null` | No | Archived Sandboxes newly queued for deletion by this policy update. |
| `acceptedDeletionOperationsIrreversible` | `boolean \| null` | No | Always true on updates. Disabling the policy does not cancel accepted deletion operations. |
| `snapshotsOff` | `boolean \| null` | No | When true, every new sandbox of this account is created with snapshots off. |
| `snapshotsOffAt` | `string \| null \| null` | No | — |
| `monitoringOff` | `boolean \| null` | No | When true, every new sandbox of this account is created with monitoring off. |
| `monitoringOffAt` | `string \| null \| null` | No | — |

***

## Ai Proxy

### get

`aiProxy.get`

Get AI credentials proxy. Returns the AI credentials proxy switch of the account in scope, a person or an organization, with its price. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.aiProxy.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `accountId` | `string \| null` | No | The account the switch belongs to, a person or an organization. |
| `org` | `boolean \| null` | No | True when `accountId` is an organization. |
| `enabled` | `boolean \| null` | No | — |
| `enabledAt` | `string \| null \| null` | No | — |
| `pricing` | `object \| null` | No | — |
| `proxyUrl` | `string \| null` | No | The base URL sandboxes call instead of the providers. |

> [accordion] pricing full type
>
> ```ts theme={null}
> {
>   dailyDollars?: number | null,
>   dollarsPer1000Requests?: number | null
> } | null
> ```

***

### getUsage

`aiProxy.getUsage`

Get AI usage. Proxied AI usage, per sandbox and in total, per UTC day, credential and model. Without profile, the usage charged to the wallet in scope. With profile, the requests made with that profile's credentials, whoever pays; only its managers can read it. Needs an API key with account.read. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.aiProxy.getUsage({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `days` | `number` | No | Days of history, today included. |
| `profile` | `string` | No | A credential profile id. Counts that profile's requests instead of a wallet's. |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `accountId` | `string \| null \| null` | No | The wallet the usage is charged to. Null with `profile`. |
| `profileId` | `string \| null \| null` | No | The credential profile whose requests are counted. Null without `profile`. |
| `since` | `string \| null` | No | First UTC day included. |
| `sandboxes` | `object[] \| null` | No | — |
| `usage` | `object[] \| null` | No | — |
| `totals` | `object \| null` | No | Token counts are the numbers the provider reports in its replies. |
| `dollars` | `number \| null` | No | — |

> [accordion] sandboxes full type
>
> ```ts theme={null}
> {
>   sandboxId?: string | null | null,
>   name?: string | null | null,
>   blocked?: boolean | null,
>   usage?: {
>     day?: string | null,
>     credential?: string | null,
>     model?: string | null,
>     requests?: number | null,
>     errors?: number | null,
>     inputTokens?: number | null,
>     outputTokens?: number | null,
>     cacheReadTokens?: number | null,
>     cacheWriteTokens?: number | null
>   }[] | null,
>   totals?: {
>     requests?: number | null,
>     errors?: number | null,
>     inputTokens?: number | null,
>     outputTokens?: number | null,
>     cacheReadTokens?: number | null,
>     cacheWriteTokens?: number | null
>   } | null,
>   dollars?: number | null
> }[] | null
> ```

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   day?: string | null,
>   credential?: string | null,
>   model?: string | null,
>   requests?: number | null,
>   errors?: number | null,
>   inputTokens?: number | null,
>   outputTokens?: number | null,
>   cacheReadTokens?: number | null,
>   cacheWriteTokens?: number | null
> }[] | null
> ```

> [accordion] totals full type
>
> ```ts theme={null}
> {
>   requests?: number | null,
>   errors?: number | null,
>   inputTokens?: number | null,
>   outputTokens?: number | null,
>   cacheReadTokens?: number | null,
>   cacheWriteTokens?: number | null
> } | null
> ```

***

### update

`aiProxy.update`

Turn the AI credentials proxy on or off. With the proxy on, sandboxes get placeholder keys and base URLs that point at Boat. Boat swaps in the real key on each request. Real keys never enter the sandbox. Running sandboxes switch at their next start. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.aiProxy.update({ enabled: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `enabled` | `boolean` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `accountId` | `string \| null` | No | The account the switch belongs to, a person or an organization. |
| `org` | `boolean \| null` | No | True when `accountId` is an organization. |
| `enabled` | `boolean \| null` | No | — |
| `enabledAt` | `string \| null \| null` | No | — |
| `pricing` | `object \| null` | No | — |
| `proxyUrl` | `string \| null` | No | The base URL sandboxes call instead of the providers. |

> [accordion] pricing full type
>
> ```ts theme={null}
> {
>   dailyDollars?: number | null,
>   dollarsPer1000Requests?: number | null
> } | null
> ```

***

## Api Keys

### createScoped

`apiKeys.createScoped`

Create a scoped API key. Creates a scoped, expiring API key. Requires a dashboard/CLI session or an admin-scoped token. The secret is returned once. At least one of preset, actions, sandboxIds, or environmentIds is required. Full account access requires an explicit admin preset. Mints a new API key; its secret is returned once. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.apiKeys.createScoped({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | No | — |
| `ttl` | `string` | No | Duration such as 90d, 24h, or seconds, up to 365d; or `never` for a key that works until revoked. Default 90d. |
| `preset` | `read-only \| full-sandbox \| ci \| admin` | No | — |
| `actions` | `string[]` | No | — |
| `sandboxIds` | `string[]` | No | — |
| `environmentIds` | `string[]` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `apiKey` | `object \| null` | No | — |
| `secret` | `string \| null` | No | Raw secret returned once. Store it before closing the response. |
| `apiKeys` | `object[] \| null` | No | — |

> [accordion] apiKey full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   credentialLane?: string | null,
>   keyPrefix?: string | null,
>   keyLastFour?: string | null,
>   sandboxId?: string | null | null,
>   createdAt?: string | null,
>   lastUsedAt?: string | null | null,
>   usage?: {
>     requests?: number | null,
>     windowDays?: number | null
>   } | null,
>   resources?: {
>     total?: number | null,
>     sandboxes?: number | null,
>     agents?: number | null
>   } | null,
>   expiresAt?: string | null | null,
>   expired?: boolean | null,
>   expiringSoon?: boolean | null,
>   scope?: {
>     expiresAt?: string | null | null,
>     actions?: string[] | null,
>     sandboxes?: string | string[] | null,
>     environments?: string | string[] | null,
>     restriction?: string | null,
>     grandfathered?: boolean | null
>   } | null
> } | null
> ```

> [accordion] apiKeys full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   credentialLane?: string | null,
>   keyPrefix?: string | null,
>   keyLastFour?: string | null,
>   sandboxId?: string | null | null,
>   createdAt?: string | null,
>   lastUsedAt?: string | null | null,
>   usage?: {
>     requests?: number | null,
>     windowDays?: number | null
>   } | null,
>   resources?: {
>     total?: number | null,
>     sandboxes?: number | null,
>     agents?: number | null
>   } | null,
>   expiresAt?: string | null | null,
>   expired?: boolean | null,
>   expiringSoon?: boolean | null,
>   scope?: {
>     expiresAt?: string | null | null,
>     actions?: string[] | null,
>     sandboxes?: string | string[] | null,
>     environments?: string | string[] | null,
>     restriction?: string | null,
>     grandfathered?: boolean | null
>   } | null
> }[] | null
> ```

***

### getUsage

`apiKeys.getUsage`

Get API key usage. Returns the key's request total for the 30-day UTC window and the sandboxes and Agents it created that still exist, including sandboxes that never got a sandbox row. Works for revoked keys owned by the authenticated account. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.apiKeys.getUsage({ apiKeyId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `apiKeyId` | `string` | Yes | API key ID returned by `GET /api-keys`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `id` | `string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `credentialLane` | `string \| null` | No | Credential storage lane. Scoped secrets are never stored in the legacy hash column. |
| `keyPrefix` | `string \| null` | No | — |
| `keyLastFour` | `string \| null` | No | — |
| `sandboxId` | `string \| null \| null` | No | Sandbox ID for a platform-managed machine key, or null for a user-created key. |
| `createdAt` | `string \| null` | No | — |
| `lastUsedAt` | `string \| null \| null` | No | — |
| `usage` | `object \| null` | No | — |
| `resources` | `object \| null` | No | — |
| `expiresAt` | `string \| null \| null` | No | — |
| `expired` | `boolean \| null` | No | — |
| `expiringSoon` | `boolean \| null` | No | — |
| `scope` | `object \| null` | No | — |
| `createdResources` | `object[] \| null` | No | — |

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   requests?: number | null,
>   windowDays?: number | null
> } | null
> ```

> [accordion] resources full type
>
> ```ts theme={null}
> {
>   total?: number | null,
>   sandboxes?: number | null,
>   agents?: number | null
> } | null
> ```

> [accordion] scope full type
>
> ```ts theme={null}
> {
>   expiresAt?: string | null | null,
>   actions?: string[] | null,
>   sandboxes?: string | string[] | null,
>   environments?: string | string[] | null,
>   restriction?: string | null,
>   grandfathered?: boolean | null
> } | null
> ```

> [accordion] createdResources full type
>
> ```ts theme={null}
> {
>   kind?: string | null,
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   createdAt?: string | null | null
> }[] | null
> ```

***

### list

`apiKeys.list`

List API keys. Lists API key metadata only. Raw key secrets are not returned after creation/rotation. Results include expiry and scope. A restricted API-key caller receives apiKeys: \[]; only an unrestricted account key or browser/CLI session receives the account inventory. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.apiKeys.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `apiKeys` | `object[] \| null` | No | — |
| `catalog` | `object \| null` | No | — |

> [accordion] apiKeys full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   credentialLane?: string | null,
>   keyPrefix?: string | null,
>   keyLastFour?: string | null,
>   sandboxId?: string | null | null,
>   createdAt?: string | null,
>   lastUsedAt?: string | null | null,
>   usage?: {
>     requests?: number | null,
>     windowDays?: number | null
>   } | null,
>   resources?: {
>     total?: number | null,
>     sandboxes?: number | null,
>     agents?: number | null
>   } | null,
>   expiresAt?: string | null | null,
>   expired?: boolean | null,
>   expiringSoon?: boolean | null,
>   scope?: {
>     expiresAt?: string | null | null,
>     actions?: string[] | null,
>     sandboxes?: string | string[] | null,
>     environments?: string | string[] | null,
>     restriction?: string | null,
>     grandfathered?: boolean | null
>   } | null
> }[] | null
> ```

> [accordion] catalog full type
>
> ```ts theme={null}
> {
>   actions?: string[] | null,
>   presets?: Record<string, string[]> | null,
>   defaultTtl?: string | null,
>   maxTtl?: string | null,
>   scopedCreationEnabled?: boolean | null,
>   scopeResources?: {
>     sandboxes?: {
>       id?: string | null,
>       name?: string | null,
>       organizationId?: string | null,
>       organizationName?: string | null
>     }[] | null,
>     environments?: {
>       id?: string | null,
>       name?: string | null,
>       organizationId?: string | null,
>       organizationName?: string | null
>     }[] | null
>   } | null
> } | null
> ```

***

### revoke

`apiKeys.revoke`

Revoke an API key. Revokes the key immediately. Command streams opened with it end within 15 seconds. It does not remove SSH keys that were added to a sandbox, stop running commands, or rotate hosted port tokens. Requires a dashboard or CLI session, or an admin-scoped key. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.apiKeys.revoke({ apiKeyId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `apiKeyId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `apiKeys` | `object[] \| null` | No | — |

> [accordion] apiKeys full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   credentialLane?: string | null,
>   keyPrefix?: string | null,
>   keyLastFour?: string | null,
>   sandboxId?: string | null | null,
>   createdAt?: string | null,
>   lastUsedAt?: string | null | null,
>   usage?: {
>     requests?: number | null,
>     windowDays?: number | null
>   } | null,
>   resources?: {
>     total?: number | null,
>     sandboxes?: number | null,
>     agents?: number | null
>   } | null,
>   expiresAt?: string | null | null,
>   expired?: boolean | null,
>   expiringSoon?: boolean | null,
>   scope?: {
>     expiresAt?: string | null | null,
>     actions?: string[] | null,
>     sandboxes?: string | string[] | null,
>     environments?: string | string[] | null,
>     restriction?: string | null,
>     grandfathered?: boolean | null
>   } | null
> }[] | null
> ```

***

### rotate

`apiKeys.rotate`

Rotate an API key. Replaces the raw secret without changing expiry or scope. Requires a dashboard or CLI session, or an admin-scoped key. A key rotates itself or a key it could create. The old secret stops working at once. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.apiKeys.rotate({ apiKeyId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `apiKeyId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `apiKey` | `object \| null` | No | — |
| `secret` | `string \| null` | No | Raw secret returned once. Store it before closing the response. |
| `apiKeys` | `object[] \| null` | No | — |

> [accordion] apiKey full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   credentialLane?: string | null,
>   keyPrefix?: string | null,
>   keyLastFour?: string | null,
>   sandboxId?: string | null | null,
>   createdAt?: string | null,
>   lastUsedAt?: string | null | null,
>   usage?: {
>     requests?: number | null,
>     windowDays?: number | null
>   } | null,
>   resources?: {
>     total?: number | null,
>     sandboxes?: number | null,
>     agents?: number | null
>   } | null,
>   expiresAt?: string | null | null,
>   expired?: boolean | null,
>   expiringSoon?: boolean | null,
>   scope?: {
>     expiresAt?: string | null | null,
>     actions?: string[] | null,
>     sandboxes?: string | string[] | null,
>     environments?: string | string[] | null,
>     restriction?: string | null,
>     grandfathered?: boolean | null
>   } | null
> } | null
> ```

> [accordion] apiKeys full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   credentialLane?: string | null,
>   keyPrefix?: string | null,
>   keyLastFour?: string | null,
>   sandboxId?: string | null | null,
>   createdAt?: string | null,
>   lastUsedAt?: string | null | null,
>   usage?: {
>     requests?: number | null,
>     windowDays?: number | null
>   } | null,
>   resources?: {
>     total?: number | null,
>     sandboxes?: number | null,
>     agents?: number | null
>   } | null,
>   expiresAt?: string | null | null,
>   expired?: boolean | null,
>   expiringSoon?: boolean | null,
>   scope?: {
>     expiresAt?: string | null | null,
>     actions?: string[] | null,
>     sandboxes?: string | string[] | null,
>     environments?: string | string[] | null,
>     restriction?: string | null,
>     grandfathered?: boolean | null
>   } | null
> }[] | null
> ```

***

## Ci

### connectGithub

`ci.connectGithub`

Connect GitHub for CI. Returns a GitHub URL to install the boat CI app, or to authorize an existing installation when account is set. An owner of the GitHub organization must complete authorization and confirm the boat account. Jobs bill org or the wallet in scope. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.ci.connectGithub({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | The organization whose wallet pays for the jobs. Omit for the wallet in scope. |
| `account` | `string` | No | GitHub organization or user login. Set this to authorize and link an existing installation. Omit it to install the app. |
| `orgApp` | `boolean` | No | Install Boat CI for orgs instead. It needs only the organization permission Self-hosted runners, not repository Administration. GitHub organizations only. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `installUrl` | `string \| null` | No | Open it in a browser to install the app or authorize an existing installation. Valid 30 minutes. |

***

### getJob

`ci.getJob`

Get CI job. One job with its wait, run time, cost, sandbox and error. Needs an API key with account.read. A personal key with the admin preset got 403 api\_key\_action\_forbidden (live 11-28). An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.ci.getJob({ jobId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `jobId` | `string` | Yes | GitHub workflow job id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `job` | `object \| null` | No | — |

> [accordion] job full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   repo?: string | null,
>   runId?: string | null,
>   jobName?: string | null,
>   workflowName?: string | null | null,
>   headBranch?: string | null | null,
>   headSha?: string | null | null,
>   htmlUrl?: string | null | null,
>   label?: string | null,
>   machineClass?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   sandboxId?: string | null | null,
>   sandboxState?: string | null | null,
>   queuedAt?: string | null,
>   runStartedAt?: string | null | null,
>   finishedAt?: string | null | null,
>   waitSeconds?: number | null | null,
>   runSeconds?: number | null | null,
>   costDollars?: number | null | null
> } | null
> ```

***

### getJobLog

`ci.getJobLog`

Get CI job log. The job's log from GitHub, up to the last 1 MB. Poll it while the job runs. Needs an API key with account.read. A personal key with the admin preset got 403 api\_key\_action\_forbidden (live 11-28). An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.ci.getJobLog({ jobId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `jobId` | `string` | Yes | GitHub workflow job id. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `log` | `string \| null` | No | The GitHub log, one timestamped line each, last 1 MB. Empty before the job starts. |

***

### getOverview

`ci.getOverview`

Get CI overview. GitHub Actions on boat (runs-on: boat): the setup steps and the next one, jobs boat did not run and why, the linked GitHub accounts with every repository they can see, 7-day stats, and the jobs. The same data as the dashboard's CI tab and boat ci. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.ci.getOverview({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account` | `string` | No | Only this GitHub account (organization or user login). |
| `repo` | `string` | No | Only this repository, as owner/name. |
| `state` | `all \| active \| failed` | No | active = queued or running. failed = failed, never started, or refused. |
| `limit` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `setup` | `object \| null` | No | The four setup steps, the next one to do, and jobs boat did not run (grouped by repository and reason). |
| `installations` | `object[] \| null` | No | — |
| `filter` | `object \| null` | No | — |
| `counts` | `object \| null` | No | Jobs in the last 7 days in the account and repo scope, per state tab. |
| `stats` | `object \| null` | No | — |
| `jobs` | `object[] \| null` | No | — |

> [accordion] setup full type
>
> ```ts theme={null}
> {
>   complete?: boolean | null,
>   next?: string | null | null,
>   steps?: {
>     id?: string | null,
>     title?: string | null,
>     done?: boolean | null,
>     detail?: string | null
>   }[] | null,
>   problems?: {
>     jobId?: string | null,
>     repo?: string | null,
>     message?: string | null,
>     at?: string | null,
>     count?: number | null
>   }[] | null
> } | null
> ```

> [accordion] installations full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   accountLogin?: string | null,
>   accountType?: string | null,
>   teamId?: string | null | null,
>   allowPublicRepos?: boolean | null,
>   publicRepoUsers?: string[] | null,
>   manageUrl?: string | null,
>   repositories?: {
>     fullName?: string | null,
>     private?: boolean | null,
>     htmlUrl?: string | null,
>     status?: string | null,
>     jobs7d?: number | null,
>     lastState?: string | null | null,
>     lastAt?: string | null | null,
>     lastError?: string | null | null
>   }[] | null
> }[] | null
> ```

> [accordion] filter full type
>
> ```ts theme={null}
> {
>   account?: string | null | null,
>   repo?: string | null | null,
>   state?: string | null
> } | null
> ```

> [accordion] counts full type
>
> ```ts theme={null}
> {
>   all?: number | null,
>   active?: number | null,
>   failed?: number | null
> } | null
> ```

> [accordion] stats full type
>
> ```ts theme={null}
> {
>   jobs?: number | null,
>   running?: number | null,
>   successRate?: number | null | null,
>   medianWaitSeconds?: number | null | null,
>   medianRunSeconds?: number | null | null,
>   costDollars?: number | null,
>   perDay?: {
>     day?: string | null,
>     success?: number | null,
>     failure?: number | null,
>     other?: number | null
>   }[] | null
> } | null
> ```

> [accordion] jobs full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   repo?: string | null,
>   runId?: string | null,
>   jobName?: string | null,
>   workflowName?: string | null | null,
>   headBranch?: string | null | null,
>   headSha?: string | null | null,
>   htmlUrl?: string | null | null,
>   label?: string | null,
>   machineClass?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   sandboxId?: string | null | null,
>   sandboxState?: string | null | null,
>   queuedAt?: string | null,
>   runStartedAt?: string | null | null,
>   finishedAt?: string | null | null,
>   waitSeconds?: number | null | null,
>   runSeconds?: number | null | null,
>   costDollars?: number | null | null
> }[] | null
> ```

***

### setPublicRepos

`ci.setPublicRepos`

Set CI public repositories. Turns jobs from a linked account's public repositories on or off, and sets the GitHub users whose runs may use boat there. A run is allowed only when both its author and the user who started it (a re-run) are on the list. Each user is checked on GitHub. Lets runs from those repositories bill the account. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.ci.setPublicRepos({ account: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `account` | `string` | Yes | The linked GitHub account (login) or installation ID. |
| `allow` | `boolean` | No | true = jobs from public repositories run. Omit to keep the current value. |
| `users` | `string \| string[]` | No | GitHub users allowed: "alice, @bob" or a list. Commas, spaces, @ and profile URLs are accepted. "" = anyone. Omit to keep the current list. |
| `dryRun` | `boolean` | No | Only check the users on GitHub; change nothing. |
| `org` | `string` | No | The organization in scope. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `allowPublicRepos` | `boolean \| null` | No | — |
| `publicRepoUsers` | `object[] \| null` | No | — |

> [accordion] publicRepoUsers full type
>
> ```ts theme={null}
> {
>   login?: string | null,
>   avatarUrl?: string | null | null
> }[] | null
> ```

***

## Credential Profiles

### accounts.add

`credentialProfiles.accounts.add`

Add another API key to a credential. Adds an API key as another account of the credential, ready to switch to. The first key of a credential becomes the one in use. A sign-in returns 400 not\_an\_api\_key; add another sign-in with "Add another account" on the dashboard. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.credentialProfiles.accounts.add({ profile: 'example', credential: 'anthropic-api-key', value: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |
| `credential` | `anthropic-api-key \| openai-api-key \| openrouter-api-key \| llmgateway-api-key \| deepseek-api-key \| moonshot-api-key \| mistral-api-key \| xai-api-key \| opencode-api-key \| claude-subscription \| chatgpt-subscription \| kimi-subscription \| mistral-vibe-subscription \| grok-subscription \| claude-bedrock \| codex-bedrock` | Yes | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |
| `value` | `string` | Yes | The API key. Boat encrypts it at rest. |
| `keepCurrent` | `boolean` | No | Keep the key this one replaces as another account of the credential, ready to switch back to. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profileId` | `string \| null` | No | — |
| `credential` | `string \| null` | No | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |
| `accounts` | `object[] \| null` | No | In the order the accounts were added, so their numbers stay the same across switches. The one in use is marked `active`. |

> [accordion] accounts full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   label?: string | null,
>   active?: boolean | null,
>   addedAt?: string | null
> }[] | null
> ```

***

### accounts.delete

`credentialProfiles.accounts.delete`

Forget an account of a credential. Deletes an account. For the account in use, the credential switches to another account first, or is removed when it was the last one. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.credentialProfiles.accounts.delete({ profile: 'example', credential: 'anthropic-api-key', account: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |
| `credential` | `anthropic-api-key \| openai-api-key \| openrouter-api-key \| llmgateway-api-key \| deepseek-api-key \| moonshot-api-key \| mistral-api-key \| xai-api-key \| opencode-api-key \| claude-subscription \| chatgpt-subscription \| kimi-subscription \| mistral-vibe-subscription \| grok-subscription \| claude-bedrock \| codex-bedrock` | Yes | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |
| `account` | `string` | Yes | The account id from the list. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profileId` | `string \| null` | No | — |
| `credential` | `string \| null` | No | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |
| `accounts` | `object[] \| null` | No | In the order the accounts were added, so their numbers stay the same across switches. The one in use is marked `active`. |

> [accordion] accounts full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   label?: string | null,
>   active?: boolean | null,
>   addedAt?: string | null
> }[] | null
> ```

***

### accounts.list

`credentialProfiles.accounts.list`

List the accounts of a credential. Every account of one credential (several ChatGPT sign-ins, several OpenAI keys), in the order they were added, the one in use marked. Labels only, never a secret. Needs an API key with account.admin, on a profile you manage: an org member who only uses an org profile gets 403. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.credentialProfiles.accounts.list({ profile: 'example', credential: 'anthropic-api-key' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |
| `credential` | `anthropic-api-key \| openai-api-key \| openrouter-api-key \| llmgateway-api-key \| deepseek-api-key \| moonshot-api-key \| mistral-api-key \| xai-api-key \| opencode-api-key \| claude-subscription \| chatgpt-subscription \| kimi-subscription \| mistral-vibe-subscription \| grok-subscription \| claude-bedrock \| codex-bedrock` | Yes | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profileId` | `string \| null` | No | — |
| `credential` | `string \| null` | No | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |
| `accounts` | `object[] \| null` | No | In the order the accounts were added, so their numbers stay the same across switches. The one in use is marked `active`. |

> [accordion] accounts full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   label?: string | null,
>   active?: boolean | null,
>   addedAt?: string | null
> }[] | null
> ```

***

### accounts.switch

`credentialProfiles.accounts.switch`

Switch a credential to another account. Makes this account the one in use; the previous one stays as another account. Switching to the account already in use changes nothing. Every sandbox that uses the profile gets it at once, running ones included, with no restart. Use it when one account runs out of credits. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.credentialProfiles.accounts.switch({ profile: 'example', credential: 'anthropic-api-key', account: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |
| `credential` | `anthropic-api-key \| openai-api-key \| openrouter-api-key \| llmgateway-api-key \| deepseek-api-key \| moonshot-api-key \| mistral-api-key \| xai-api-key \| opencode-api-key \| claude-subscription \| chatgpt-subscription \| kimi-subscription \| mistral-vibe-subscription \| grok-subscription \| claude-bedrock \| codex-bedrock` | Yes | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |
| `account` | `string` | Yes | The account id from the list. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profileId` | `string \| null` | No | — |
| `credential` | `string \| null` | No | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |
| `accounts` | `object[] \| null` | No | In the order the accounts were added, so their numbers stay the same across switches. The one in use is marked `active`. |

> [accordion] accounts full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   label?: string | null,
>   active?: boolean | null,
>   addedAt?: string | null
> }[] | null
> ```

***

### create

`credentialProfiles.create`

Create a credential profile. Creates an empty profile, or a copy of copyFrom. With org, the profile belongs to that organization and only its owners can create it. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.credentialProfiles.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | Unique among the owner's profiles. |
| `org` | `string` | No | Organization id or name. The profile then belongs to that organization. Omit for a personal profile. |
| `copyFrom` | `string` | No | Id or name of a profile you manage. The new profile starts with a copy of its credentials. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profile` | `object \| null` | No | A named set of AI credentials. Secret values are never returned. |

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   owner?: {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null,
>     aiProxyEnabled?: boolean | null
>   } | null,
>   canManage?: boolean | null,
>   connected?: string[] | null,
>   accounts?: Record<string, {
>     id?: string | null,
>     label?: string | null,
>     active?: boolean | null,
>     addedAt?: string | null
>   }[]> | null,
>   customApis?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null
> } | null
> ```

***

### customApis.delete

`credentialProfiles.customApis.delete`

Remove a custom API. Removes one custom API from the profile. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.credentialProfiles.customApis.delete({ profile: 'default', name: 'STRIPE_KEY' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |
| `name` | `string` | Yes | Environment variable name of the custom API, for example `STRIPE_KEY`. Provider names (`ANTHROPIC_*`, `OPENAI_*`, and so on) and names that end in `_BASE_URL` are reserved. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profile` | `object \| null` | No | A named set of AI credentials. Secret values are never returned. |

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   owner?: {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null,
>     aiProxyEnabled?: boolean | null
>   } | null,
>   canManage?: boolean | null,
>   connected?: string[] | null,
>   accounts?: Record<string, {
>     id?: string | null,
>     label?: string | null,
>     active?: boolean | null,
>     addedAt?: string | null
>   }[]> | null,
>   customApis?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null
> } | null
> ```

***

### customApis.set

`credentialProfiles.customApis.set`

Set a custom API. Adds or replaces one custom API. The sandbox gets \<NAME> and \<NAME>\_BASE\_URL. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.credentialProfiles.customApis.set({
	profile: 'default',
	name: 'STRIPE_KEY',
	value: 'sk_test_example',
	baseUrl: 'https://api.stripe.com',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |
| `name` | `string` | Yes | Environment variable name of the custom API, for example `STRIPE_KEY`. Provider names (`ANTHROPIC_*`, `OPENAI_*`, and so on) and names that end in `_BASE_URL` are reserved. |
| `value` | `string` | Yes | The secret. The sandbox gets it as the variable named in the path. |
| `baseUrl` | `string` | Yes | Public HTTPS base URL of the API, on the default port, with a DNS name. The sandbox gets it as `<NAME>_BASE_URL`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profile` | `object \| null` | No | A named set of AI credentials. Secret values are never returned. |

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   owner?: {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null,
>     aiProxyEnabled?: boolean | null
>   } | null,
>   canManage?: boolean | null,
>   connected?: string[] | null,
>   accounts?: Record<string, {
>     id?: string | null,
>     label?: string | null,
>     active?: boolean | null,
>     addedAt?: string | null
>   }[]> | null,
>   customApis?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null
> } | null
> ```

***

### delete

`credentialProfiles.delete`

Delete a credential profile. Deletes the profile. A default profile returns 409 is\_default. A profile that an environment names returns 409 in\_use. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.credentialProfiles.delete({ profile: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |

***

### deleteKey

`credentialProfiles.deleteKey`

Remove a credential profile credential. Removes one credential, an API key or a sign-in. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.credentialProfiles.deleteKey({ profile: 'example', credential: 'anthropic-api-key' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |
| `credential` | `anthropic-api-key \| openai-api-key \| openrouter-api-key \| llmgateway-api-key \| deepseek-api-key \| moonshot-api-key \| mistral-api-key \| xai-api-key \| opencode-api-key \| claude-subscription \| chatgpt-subscription \| kimi-subscription \| mistral-vibe-subscription \| grok-subscription \| claude-bedrock \| codex-bedrock` | Yes | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profile` | `object \| null` | No | A named set of AI credentials. Secret values are never returned. |

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   owner?: {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null,
>     aiProxyEnabled?: boolean | null
>   } | null,
>   canManage?: boolean | null,
>   connected?: string[] | null,
>   accounts?: Record<string, {
>     id?: string | null,
>     label?: string | null,
>     active?: boolean | null,
>     addedAt?: string | null
>   }[]> | null,
>   customApis?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null
> } | null
> ```

***

### list

`credentialProfiles.list`

List credential profiles. Returns every AI credential profile you can use, yours and your organizations'. Secret values are never returned. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.credentialProfiles.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `profiles` | `object[] \| null` | No | — |

> [accordion] profiles full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   owner?: {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null,
>     aiProxyEnabled?: boolean | null
>   } | null,
>   canManage?: boolean | null,
>   connected?: string[] | null,
>   accounts?: Record<string, {
>     id?: string | null,
>     label?: string | null,
>     active?: boolean | null,
>     addedAt?: string | null
>   }[]> | null,
>   customApis?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null
> }[] | null
> ```

***

### setKey

`credentialProfiles.setKey`

Set a credential profile API key. Sets one API key. A sign-in id returns 400 not\_an\_api\_key; connect sign-ins on the dashboard Agents page. Running sandboxes that use the profile get the new key. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.credentialProfiles.setKey({ profile: 'example', credential: 'anthropic-api-key', value: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |
| `credential` | `anthropic-api-key \| openai-api-key \| openrouter-api-key \| llmgateway-api-key \| deepseek-api-key \| moonshot-api-key \| mistral-api-key \| xai-api-key \| opencode-api-key \| claude-subscription \| chatgpt-subscription \| kimi-subscription \| mistral-vibe-subscription \| grok-subscription \| claude-bedrock \| codex-bedrock` | Yes | One AI credential in a credential profile. The `*-api-key` ids are API keys you can set with `PUT /credential-profiles/{profile}/keys/{credential}`. The sign-ins (`*-subscription`) and Bedrock (`*-bedrock`) are connected on the dashboard Agents & Proxying page, with the profile picked at the top; you can remove them here. |
| `value` | `string` | Yes | The API key. Boat encrypts it at rest. |
| `keepCurrent` | `boolean` | No | Keep the key this one replaces as another account of the credential, ready to switch back to. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profile` | `object \| null` | No | A named set of AI credentials. Secret values are never returned. |

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   owner?: {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null,
>     aiProxyEnabled?: boolean | null
>   } | null,
>   canManage?: boolean | null,
>   connected?: string[] | null,
>   accounts?: Record<string, {
>     id?: string | null,
>     label?: string | null,
>     active?: boolean | null,
>     addedAt?: string | null
>   }[]> | null,
>   customApis?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null
> } | null
> ```

***

### update

`credentialProfiles.update`

Update a credential profile. Renames the profile, or makes it its owner's default. Sandboxes that use the owner's default switch to the new default at their next start. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.credentialProfiles.update({ profile: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `string` | Yes | Profile id or name. |
| `name` | `string` | No | New profile name. |
| `isDefault` | `boolean` | No | Send true to make this profile its owner's default. The previous default loses the flag. False is ignored; make another profile the default instead. |
| `access` | `object` | No | Organization profiles only. Organization owner only. |

> [accordion] access full type
>
> ```ts theme={null}
> {
>   restricted: boolean,
>   members?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `profile` | `object \| null` | No | A named set of AI credentials. Secret values are never returned. |

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   owner?: {
>     id?: string | null,
>     kind?: string | null,
>     name?: string | null,
>     aiProxyEnabled?: boolean | null
>   } | null,
>   canManage?: boolean | null,
>   connected?: string[] | null,
>   accounts?: Record<string, {
>     id?: string | null,
>     label?: string | null,
>     active?: boolean | null,
>     addedAt?: string | null
>   }[]> | null,
>   customApis?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null
> } | null
> ```

***

## Deletion Operations

### get

`deletionOperations.get`

Get deletion operation. Poll an accepted Boat or snapshot deletion. Only operations owned by the authenticated account are returned. Responses are never cached.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.deletionOperations.get({ operationId: 'bdop_0123456789abcdef0123456789abcdef' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `operationId` | `string` | Yes | Deletion operation id returned by an accepted delete request. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `operation` | `object \| null` | No | — |

> [accordion] operation full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   targetId?: string | null,
>   reason?: string | null,
>   status?: string | null,
>   stage?: string | null,
>   expectedBy?: string | null | null,
>   attemptCount?: number | null,
>   requestedAt?: string | null,
>   completedAt?: string | null | null
> } | null
> ```

***

## Environments

### addRepo

`environments.addRepo`

Add a repository to an environment. Adds a repository (or updates its base branch) by database id from the repository list. Mints a new immutable version.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.environments.addRepo({ environmentId: '1b6d1225-6394-45a2-ba97-dcb55758b552', repositoryId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `repositoryId` | `string` | Yes | The repository `databaseId` from `GET /repos`. |
| `baseBranch` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | Id of the newly minted environment version. This is a version id, not the environment's own id: the environment id you passed in the path is unchanged. |
| `versionNumber` | `number \| null` | No | — |

***

### create

`environments.create`

Create a sandbox environment. Create a new named environment. It starts on version 1 with all fine-grained flags on and safeForThirdParties off.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.environments.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `name` | `string` | Yes | Unique environment name. Letters, numbers, dot, dash, underscore; max 64 chars. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | — |
| `environments` | `object[] \| null` | No | — |

> [accordion] environments full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   latestVersionId?: string | null | null,
>   latestVersionNumber?: number | null,
>   safetyAnsweredAt?: string | null | null,
>   safeForThirdParties?: boolean | null,
>   passGithub?: boolean | null,
>   passSecrets?: boolean | null,
>   passSandboxCredentials?: boolean | null,
>   passAgentsCredentials?: boolean | null,
>   credentialProfileId?: string | null | null,
>   proxyAiCredentials?: boolean | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null
>   } | null | null,
>   envContents?: string | null,
>   secretFiles?: {
>     path?: string | null,
>     contents?: string | null
>   }[] | null,
>   selectedRepositories?: {
>     id?: number | null,
>     databaseId?: string | null,
>     name?: string | null,
>     fullName?: string | null,
>     description?: string | null | null,
>     url?: string | null,
>     private?: boolean | null,
>     permissions?: string | null,
>     pushedAt?: string | null | null,
>     lastUserCommitAt?: string | null | null,
>     baseBranch?: string | null,
>     setupRoutineId?: string | null | null,
>     setupScript?: string | null,
>     setupBlocking?: boolean | null
>   }[] | null,
>   versions?: {
>     id?: string | null,
>     versionNumber?: number | null,
>     sandboxCount?: number | null,
>     createdAt?: string | null
>   }[] | null
> }[] | null
> ```

***

### delete

`environments.delete`

Delete a sandbox environment. Soft-deletes an environment. The default environment cannot be deleted, and at least one environment is always kept. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.environments.delete({ environmentId: '1b6d1225-6394-45a2-ba97-dcb55758b552' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | Environment id returned by `GET /environments`. |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `environment` | `object \| null` | No | A named sandbox environment. All flags/contents reflect the latest version. |

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   latestVersionId?: string | null | null,
>   latestVersionNumber?: number | null,
>   safetyAnsweredAt?: string | null | null,
>   safeForThirdParties?: boolean | null,
>   passGithub?: boolean | null,
>   passSecrets?: boolean | null,
>   passSandboxCredentials?: boolean | null,
>   passAgentsCredentials?: boolean | null,
>   credentialProfileId?: string | null | null,
>   proxyAiCredentials?: boolean | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null
>   } | null | null,
>   envContents?: string | null,
>   secretFiles?: {
>     path?: string | null,
>     contents?: string | null
>   }[] | null,
>   selectedRepositories?: {
>     id?: number | null,
>     databaseId?: string | null,
>     name?: string | null,
>     fullName?: string | null,
>     description?: string | null | null,
>     url?: string | null,
>     private?: boolean | null,
>     permissions?: string | null,
>     pushedAt?: string | null | null,
>     lastUserCommitAt?: string | null | null,
>     baseBranch?: string | null,
>     setupRoutineId?: string | null | null,
>     setupScript?: string | null,
>     setupBlocking?: boolean | null
>   }[] | null,
>   versions?: {
>     id?: string | null,
>     versionNumber?: number | null,
>     sandboxCount?: number | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***

### deleteRepo

`environments.deleteRepo`

Remove a repository from an environment. Removes one repository from the environment's selection. Mints a new immutable version. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.environments.deleteRepo({ environmentId: '1b6d1225-6394-45a2-ba97-dcb55758b552', repositoryId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `repositoryId` | `string` | Yes | The repository `databaseId`. |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | Id of the newly minted environment version. This is a version id, not the environment's own id: the environment id you passed in the path is unchanged. |
| `versionNumber` | `number \| null` | No | — |

***

### deleteSecretFile

`environments.deleteSecretFile`

Remove one secret file. Removes the secret file at path. Mints a new immutable version. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.environments.deleteSecretFile({ environmentId: '1b6d1225-6394-45a2-ba97-dcb55758b552', path: 'notes.txt' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `path` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | Id of the newly minted environment version. This is a version id, not the environment's own id: the environment id you passed in the path is unchanged. |
| `versionNumber` | `number \| null` | No | — |

***

### deleteVar

`environments.deleteVar`

Remove one environment variable. Removes a single variable. Mints a new immutable version. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.environments.deleteVar({ environmentId: '1b6d1225-6394-45a2-ba97-dcb55758b552', key: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `key` | `string` | Yes | Environment variable name. |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | Id of the newly minted environment version. This is a version id, not the environment's own id: the environment id you passed in the path is unchanged. |
| `versionNumber` | `number \| null` | No | — |

***

### list

`environments.list`

List Sandbox environments. Returns every non-deleted sandbox environment with its latest-version flags, contents, and per-version sandbox usage. A default environment named base is created on first access if none exists.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.environments.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `include` | `inboundAllow[]` | No | Optional fields of the answer. `inboundAllow`: the answer holds `network.inboundAllow`, always an array, and empty when there is no list. Without it, the answer has the fields that it had before the inbound list existed. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | — |
| `environments` | `object[] \| null` | No | — |

> [accordion] environments full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   latestVersionId?: string | null | null,
>   latestVersionNumber?: number | null,
>   safetyAnsweredAt?: string | null | null,
>   safeForThirdParties?: boolean | null,
>   passGithub?: boolean | null,
>   passSecrets?: boolean | null,
>   passSandboxCredentials?: boolean | null,
>   passAgentsCredentials?: boolean | null,
>   credentialProfileId?: string | null | null,
>   proxyAiCredentials?: boolean | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null
>   } | null | null,
>   envContents?: string | null,
>   secretFiles?: {
>     path?: string | null,
>     contents?: string | null
>   }[] | null,
>   selectedRepositories?: {
>     id?: number | null,
>     databaseId?: string | null,
>     name?: string | null,
>     fullName?: string | null,
>     description?: string | null | null,
>     url?: string | null,
>     private?: boolean | null,
>     permissions?: string | null,
>     pushedAt?: string | null | null,
>     lastUserCommitAt?: string | null | null,
>     baseBranch?: string | null,
>     setupRoutineId?: string | null | null,
>     setupScript?: string | null,
>     setupBlocking?: boolean | null
>   }[] | null,
>   versions?: {
>     id?: string | null,
>     versionNumber?: number | null,
>     sandboxCount?: number | null,
>     createdAt?: string | null
>   }[] | null
> }[] | null
> ```

***

### setSecretFile

`environments.setSecretFile`

Write one secret file. Adds or replaces a single secret file by path. Mints a new immutable version.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.environments.setSecretFile({ environmentId: '1b6d1225-6394-45a2-ba97-dcb55758b552', path: 'notes.txt', contents: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `path` | `string` | Yes | In-sandbox path relative to the workspace, e.g. `.env` or `repo/.env`. |
| `contents` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | Id of the newly minted environment version. This is a version id, not the environment's own id: the environment id you passed in the path is unchanged. |
| `versionNumber` | `number \| null` | No | — |

***

### setVar

`environments.setVar`

Set one environment variable. Sets or replaces a single variable without reading or rewriting the rest. Mints a new immutable version.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.environments.setVar({ environmentId: '1b6d1225-6394-45a2-ba97-dcb55758b552', key: 'example', value: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `key` | `string` | Yes | Environment variable name. |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `value` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `versionId` | `string \| null` | No | Id of the newly minted environment version. This is a version id, not the environment's own id: the environment id you passed in the path is unchanged. |
| `versionNumber` | `number \| null` | No | — |

***

### update

`environments.update`

Update a sandbox environment. Rename, set as default, and/or edit flags and contents. Any flag or content change mints a new immutable version; existing sandboxes stay on their pinned version until you call upgrade.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.environments.update({ environmentId: '1b6d1225-6394-45a2-ba97-dcb55758b552' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | Environment id returned by `GET /environments`. |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `include` | `inboundAllow[]` | No | Optional fields of the answer. `inboundAllow`: the answer holds `network.inboundAllow`, always an array, and empty when there is no list. Without it, the answer has the fields that it had before the inbound list existed. |
| `name` | `string` | No | New environment name. |
| `isDefault` | `boolean` | No | Set to true to make this the default environment (clears the flag on the previous default). |
| `safeForThirdParties` | `boolean` | No | — |
| `passGithub` | `boolean` | No | — |
| `passSecrets` | `boolean` | No | — |
| `passSandboxCredentials` | `boolean` | No | — |
| `passAgentsCredentials` | `boolean` | No | — |
| `credentialProfileId` | `string \| null` | No | Id or name of a credential profile you can use, or null for the sandbox owner's default profile. Unknown profiles return `404 credential_profile_not_found`. |
| `proxyAiCredentials` | `boolean` | No | With `safeForThirdParties` true, pass AI credentials as proxy placeholders. Setting true needs the AI credentials proxy on for the profile owner, else `400 ai_proxy_off`. |
| `access` | `object` | No | Set who can use an organization environment (owner or admin) or profile (owner). A change does not touch running sandboxes. A bad list returns `400 invalid_access`. |
| `network` | `object \| null` | No | Replaces the outbound network policy of the environment. An object sets it, null clears it, and an absent field keeps it. It makes a new version, like every other setting: a running sandbox changes only at an upgrade. Needs the `network.write` action as well as `environment.write`. A bad policy is refused with 400 `invalid_network_policy` before anything else of the request is saved. |
| `envContents` | `string` | No | Full .env-style content for the new version. |
| `secretFiles` | `object[]` | No | — |
| `repositories` | `object[]` | No | Full replacement of the version's repository selection. Each item selects one repository by its internal `databaseId` (from `GET /repos`). |

> [accordion] access full type
>
> ```ts theme={null}
> {
>   restricted: boolean,
>   members?: string[]
> }
> ```

> [accordion] network full type
>
> ```ts theme={null}
> {
>   mode?: open | deny | allow,
>   allow?: string[],
>   inbound?: open | boat-only,
>   inboundAllow?: string[]
> } | null
> ```

> [accordion] secretFiles full type
>
> ```ts theme={null}
> {
>   path: string,
>   contents: string
> }[]
> ```

> [accordion] repositories full type
>
> ```ts theme={null}
> {
>   repositoryId: string,
>   baseBranch?: string,
>   setupScript?: string,
>   setupBlocking?: boolean
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `environment` | `object \| null` | No | A named sandbox environment. All flags/contents reflect the latest version. |

> [accordion] environment full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   isDefault?: boolean | null,
>   latestVersionId?: string | null | null,
>   latestVersionNumber?: number | null,
>   safetyAnsweredAt?: string | null | null,
>   safeForThirdParties?: boolean | null,
>   passGithub?: boolean | null,
>   passSecrets?: boolean | null,
>   passSandboxCredentials?: boolean | null,
>   passAgentsCredentials?: boolean | null,
>   credentialProfileId?: string | null | null,
>   proxyAiCredentials?: boolean | null,
>   access?: {
>     restricted?: boolean | null,
>     members?: string[] | null
>   } | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null
>   } | null | null,
>   envContents?: string | null,
>   secretFiles?: {
>     path?: string | null,
>     contents?: string | null
>   }[] | null,
>   selectedRepositories?: {
>     id?: number | null,
>     databaseId?: string | null,
>     name?: string | null,
>     fullName?: string | null,
>     description?: string | null | null,
>     url?: string | null,
>     private?: boolean | null,
>     permissions?: string | null,
>     pushedAt?: string | null | null,
>     lastUserCommitAt?: string | null | null,
>     baseBranch?: string | null,
>     setupRoutineId?: string | null | null,
>     setupScript?: string | null,
>     setupBlocking?: boolean | null
>   }[] | null,
>   versions?: {
>     id?: string | null,
>     versionNumber?: number | null,
>     sandboxCount?: number | null,
>     createdAt?: string | null
>   }[] | null
> } | null | null
> ```

***

### upgradeSandboxes

`environments.upgradeSandboxes`

Upgrade sandboxes to an environment's latest version. Repoints the caller's active sandboxes from an older version of this environment to its latest version, scrubbing any owner secrets the new version drops and hot-pushing the new config.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.environments.upgradeSandboxes({ environmentId: '1b6d1225-6394-45a2-ba97-dcb55758b552' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `environmentId` | `string` | Yes | — |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `agentIds` | `string[]` | No | Restrict the upgrade to these sandbox (agent) ids. Omit to upgrade all of the caller's active sandboxes that are on an older version of this environment. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `upgraded` | `number \| null` | No | — |
| `upgradedLive` | `number \| null` | No | Running sandboxes that received the new configuration now. |
| `upgradedStopped` | `number \| null` | No | Stopped sandboxes moved to the latest version; they pick it up when they next resume. |
| `failed` | `number \| null` | No | — |
| `failures` | `object[] \| null` | No | One entry for each sandbox that the upgrade did not move. It stays on its version, with its policy. |
| `latestVersionId` | `string \| null` | No | Id of the version the sandboxes were moved to. |

> [accordion] failures full type
>
> ```ts theme={null}
> {
>   sandboxId?: string | null | null,
>   error?: string | null,
>   message?: string | null
> }[] | null
> ```

***

## Named Snapshots

### delete

`namedSnapshots.delete`

Remove a named snapshot. Remove a named snapshot and release its storage (boat snapshot rm \<name> in the CLI). Sandboxes already deployed from it are unaffected. The older name of the savedSnapshots routes (hidden in the spec, still served). Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.namedSnapshots.delete({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

***

### get

`namedSnapshots.get`

Get a named snapshot. The older name of the savedSnapshots routes (hidden in the spec, still served).

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.namedSnapshots.get({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `snapshot` | `object \| null` | No | A named snapshot: a frozen copy of a sandbox's disk at one moment, saved under a name you pick. Independent of the source sandbox's later life: the sandbox can change, stop, or be deleted and the named snapshot still deploys. Named snapshots never expire; re-saving a name replaces its artifact. |

> [accordion] snapshot full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   status?: string | null,
>   error?: string | null,
>   sourceSandboxId?: string | null,
>   snapshotId?: string | null,
>   type?: string | null,
>   sizeBytes?: number | null,
>   createdAt?: string | null
> } | null
> ```

***

### list

`namedSnapshots.list`

List named snapshots. List your named snapshots, newest first. The older name of the savedSnapshots routes (hidden in the spec, still served).

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.namedSnapshots.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `snapshots` | `object[] \| null` | No | — |
| `allowance` | `object \| null` | No | What the request's wallet (your active organization, `?org=`, or personal) pays for named snapshots. The plan includes some; each one above costs \$0.056 a day from the wallet. An organization's count includes every member's names billed to it. |

> [accordion] snapshots full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   status?: string | null,
>   error?: string | null,
>   sourceSandboxId?: string | null,
>   snapshotId?: string | null,
>   type?: string | null,
>   sizeBytes?: number | null,
>   createdAt?: string | null
> }[] | null
> ```

> [accordion] allowance full type
>
> ```ts theme={null}
> {
>   org?: string | null | null,
>   orgName?: string | null | null,
>   free?: number | null,
>   used?: number | null,
>   extra?: number | null,
>   extraMonthlyDollars?: number | null,
>   extraDailyDollars?: number | null,
>   pricePerExtraMonthlyDollars?: number | null,
>   pricePerExtraDailyDollars?: number | null
> } | null
> ```

***

### save

`namedSnapshots.save`

Save a named snapshot. Freeze a sandbox's current state under a name (boat snapshot \<id> \<name> in the CLI). Answers 202 immediately with the snapshot in saving; a running sandbox takes a fresh capture first, which can run minutes. Poll GET /named-snapshots/\{name} until the status settles at ready or failed. The older name of the savedSnapshots routes (hidden in the spec, still served). Snapshots past the plan allowance bill monthly. The free trial refuses it: 403 (live 11-28).

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.namedSnapshots.save({ sandboxId: 'bx_23456789', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | The sandbox whose current state to freeze. |
| `name` | `string` | Yes | Name to save under. 1-63 lowercase letters, digits, or dashes, starting with a letter or digit. Reusing one of your existing names replaces that snapshot's artifact. `latest`, `tree`, `pull`, `rm`, `save`, `current`, `self`, and `new` are reserved. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `snapshot` | `object \| null` | No | A named snapshot: a frozen copy of a sandbox's disk at one moment, saved under a name you pick. Independent of the source sandbox's later life: the sandbox can change, stop, or be deleted and the named snapshot still deploys. Named snapshots never expire; re-saving a name replaces its artifact. |

> [accordion] snapshot full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   status?: string | null,
>   error?: string | null,
>   sourceSandboxId?: string | null,
>   snapshotId?: string | null,
>   type?: string | null,
>   sizeBytes?: number | null,
>   createdAt?: string | null
> } | null
> ```

***

## Orgs

### list

`orgs.list`

List organizations. The wallets this account can bill: your personal account first, then every organization you belong to, each with its id and name. Either spelling works wherever an org is passed (org, X-Boat-Org, teamId).

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.orgs.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `activeWalletChosen` | `boolean \| null` | No | Whether this account ever set its active wallet. `false` means personal by default, never a choice. |
| `orgs` | `object[] \| null` | No | — |

> [accordion] orgs full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null,
>   role?: string | null,
>   memberCount?: number | null,
>   subscriptionStatus?: string | null,
>   active?: boolean | null
> }[] | null
> ```

***

### setActive

`orgs.setActive`

Set the active organization. Set the wallet new sandboxes bill when a request names none, for this account on every client: the API, the CLI (boat org switch sets the same value) and the dashboard. Pass an organization id or name you belong to, or personal (or null) for your own account. GET /limits follows it.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.orgs.setActive({ org: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string \| null` | Yes | Organization id or name you belong to; `personal`, your own id or `null` for personal. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `active` | `object \| null` | No | — |

> [accordion] active full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   type?: string | null
> } | null
> ```

***

### update

`orgs.update`

Update organization settings. The owner renames the organization with name. Requests that name the organization by its old name fail after the rename; its id does not change. The billing name on new invoices follows when it is still the organization name.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.orgs.update({ org: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | Yes | Organization id or name. |
| `name` | `string` | No | New name. Owner only. Leading and trailing spaces are removed. |
| `newSandboxesPrivate` | `boolean` | No | True = new sandboxes start private. False = they start shared. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `name` | `string \| null` | No | — |
| `newSandboxesPrivate` | `boolean \| null` | No | — |

***

## Repos

### list

`repos.list`

List GitHub repositories available to Boat. Returns GitHub repositories grouped by installation plus the current selected repositories for new Sandboxes. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.repos.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sync` | `boolean` | No | When true, sync from GitHub before returning repository groups. |
| `limit` | `number` | No | Maximum items to return. |
| `cursor` | `string \| null` | No | Opaque pagination cursor returned as `pageInfo.nextCursor`. |
| `sort` | `asc \| desc` | No | Sort direction for cursor pagination. |
| `q` | `string` | No | Case-insensitive repository name/fullName filter. |
| `selected` | `boolean` | No | Filter to selected or unselected repositories. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `installations` | `object[] \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `subenvironmentId` | `string \| null \| null` | No | Id of the default environment. `environmentId` is the id of its latest version. |
| `selectedRepositories` | `object[] \| null` | No | — |
| `pageInfo` | `object \| null` | No | — |

> [accordion] installations full type
>
> ```ts theme={null}
> {
>   type?: string | null,
>   accountLogin?: string | null,
>   accountAvatarUrl?: string | null | null,
>   repositories?: {
>     id?: number | null,
>     databaseId?: string | null,
>     name?: string | null,
>     fullName?: string | null,
>     description?: string | null | null,
>     url?: string | null,
>     private?: boolean | null,
>     permissions?: string | null,
>     pushedAt?: string | null | null,
>     lastUserCommitAt?: string | null | null
>   }[] | null
> }[] | null
> ```

> [accordion] selectedRepositories full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   databaseId?: string | null,
>   name?: string | null,
>   fullName?: string | null,
>   description?: string | null | null,
>   url?: string | null,
>   private?: boolean | null,
>   permissions?: string | null,
>   pushedAt?: string | null | null,
>   lastUserCommitAt?: string | null | null,
>   baseBranch?: string | null,
>   setupRoutineId?: string | null | null,
>   setupScript?: string | null,
>   setupBlocking?: boolean | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   nextCursor?: string | null | null,
>   hasMore?: boolean | null,
>   limit?: number | null
> } | null
> ```

***

### select

`repos.select`

Select repository for sandboxes. Idempotently selects one repository for the sandbox environment. Use databaseId from GET /repos as repositoryId; selecting an already-selected repository updates its baseBranch. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.repos.select({ repositoryId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `repositoryId` | `string` | Yes | Internal repository `databaseId` returned by `GET /repos`. |
| `baseBranch` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `subenvironmentId` | `string \| null \| null` | No | Id of the default environment. `environmentId` is the id of its new version. |
| `selectedRepositories` | `object[] \| null` | No | — |

> [accordion] selectedRepositories full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   databaseId?: string | null,
>   name?: string | null,
>   fullName?: string | null,
>   description?: string | null | null,
>   url?: string | null,
>   private?: boolean | null,
>   permissions?: string | null,
>   pushedAt?: string | null | null,
>   lastUserCommitAt?: string | null | null,
>   baseBranch?: string | null,
>   setupRoutineId?: string | null | null,
>   setupScript?: string | null,
>   setupBlocking?: boolean | null
> }[] | null
> ```

***

## Sandboxes

### addSshKey

`sandboxes.addSshKey`

Configure sandbox SSH key. Adds an OpenSSH public key to the running sandbox so the caller can SSH as user user. The response carries machineIp, which is the host to connect to on port 22.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.addSshKey({ sandboxId: 'bx_23456789', key: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `include` | `caller[]` | No | Optional fields of the answer. `caller`: on a sandbox with an inbound list, the answer holds `caller.address` and `caller.listed`. Without it, the answer has the fields that it had before. |
| `key` | `string` | Yes | Public SSH key in OpenSSH format. Private keys are rejected. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `caller` | `object \| null` | No | Only when the request has `include=caller` and the sandbox has an inbound list. The caller of this request, as boat sees it. |
| `success` | `boolean \| null` | No | — |
| `machineIp` | `string \| null \| null` | No | — |
| `sshUser` | `string \| null` | No | — |
| `sshEndpoint` | `string \| null \| null` | No | Public IPv4 `host:port` that forwards to the sandbox SSH server, set only when the machine has no public IPv4 of its own. Connect with `ssh -p <port> user@<host>`. |
| `hostKey` | `string \| null` | No | The sandbox SSH server's public host key. Pin it in `known_hosts`. |

> [accordion] caller full type
>
> ```ts theme={null}
> {
>   address?: string | null | null,
>   listed?: boolean | null
> } | null
> ```

***

### agent.getPrompt

`sandboxes.agent.getPrompt`

Get prompt run status. Returns first-class status for a queued/running/finished prompt so clients do not infer completion from sandbox state and events.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.agent.getPrompt({ sandboxId: 'bx_23456789', promptId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `promptId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `promptRun` | `object \| null` | No | — |

> [accordion] promptRun full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   promptId?: string | null,
>   sandboxId?: string | null,
>   status?: string | null,
>   done?: boolean | null,
>   createdAt?: string | null | null,
>   model?: string | null | null,
>   reasoningEffort?: string | null | null,
>   fast?: boolean | null | null,
>   speed?: string | null | null,
>   conversationId?: string | null | null
> } | null
> ```

***

### agent.interrupt

`sandboxes.agent.interrupt`

Interrupt running work. Interrupt running agent work. By default this stops every conversation on the sandbox. Pass conversation to stop just one, leaving the others running. See Integrated agents.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.agent.interrupt({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `conversation` | `string` | No | Interrupt only this conversation id. Omit to interrupt the whole sandbox. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sandbox` | `object \| null` | No | — |
| `forced` | `boolean \| null` | No | On stop, true when this stop discards work written after the last snapshot. |
| `operation` | `object \| null` | No | On stop, the stop operation (also on a sandbox that is already stopping or stopped). |
| `statusUrl` | `string \| null \| null` | No | On stop, the path that reads this stop operation, for example `/api/v1/sandboxes/bx_23456789/stops/stop_0123456789abcdef`. |
| `giftLimitNotice` | `string \| null` | No | Present on resume or fork when a fair-use cap on a gifted account shortened the requested auto-stop time. |
| `conversationId` | `string \| null` | No | On interrupt, the conversation whose turn was interrupted. |

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> } | null | null
> ```

> [accordion] operation full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   status?: string | null,
>   requestedAt?: string | null | null,
>   lastAttemptAt?: string | null | null,
>   error?: string | null | null,
>   endedAt?: string | null | null,
>   forced?: boolean | null
> } | null | null
> ```

***

### agent.listConversations

`sandboxes.agent.listConversations`

List boat conversations. Every conversation on the sandbox, most recently prompted first, with what you need to pick one: how many prompts it holds, whether a turn is running in it right now, the last harness and model it ran on, a preview of its last prompt, and current, the one a POST /prompt without new or…

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.agent.listConversations({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | Sandbox id. |
| `conversations` | `object[] \| null` | No | — |

> [accordion] conversations full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   createdAt?: string | null | null,
>   lastPromptAt?: string | null | null,
>   prompts?: number | null,
>   running?: boolean | null,
>   lastHarness?: string | null | null,
>   lastModel?: string | null | null,
>   lastPromptPreview?: string | null | null,
>   current?: boolean | null
> }[] | null
> ```

***

### agent.listEvents

`sandboxes.agent.listEvents`

List boat events. Return Sandbox work, lifecycle, and progress events so product UIs can show what the sandbox is doing. A Sandbox runs many conversations in parallel; this streams all of them by default and every event carries a conversationId. Filter to one or more with conversation. Event payloads are extensible. Pass the ETag of the last page as ifNoneMatch: an unchanged page answers 304, raised as an error with status 304.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.agent.listEvents({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `limit` | `number` | No | Maximum items to return. |
| `cursor` | `string \| null` | No | Opaque pagination cursor returned as `pageInfo.nextCursor`. |
| `sort` | `asc \| desc` | No | Sort direction for cursor pagination. |
| `type` | `string` | No | Comma-separated event type filter, for example `prompt,response,steer`. |
| `conversation` | `string` | No | Only return events for this conversation id. Repeat the parameter (or comma-separate) for several. Omit to stream every conversation on the sandbox. See [Integrated agents](https://docs.corsair.dev/integrated-agents). |
| `ifNoneMatch` | `string` | No | The `ETag` of the last page you read. If the page is unchanged, the answer is `304` with no body. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `events` | `object[] \| null` | No | Sandbox work and lifecycle event objects. Event shapes are intentionally extensible; branch on each event `type` when present. |
| `pageInfo` | `object \| null` | No | — |

> [accordion] events full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   type?: string | null,
>   timestamp?: number | null,
>   taskId?: string | null | null,
>   conversationId?: string | null | null,
>   data?: {
>   } | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   nextCursor?: string | null | null,
>   hasMore?: boolean | null,
>   limit?: number | null
> } | null
> ```

***

### agent.prompt

`sandboxes.agent.prompt`

Prompt Sandbox. Queue a natural-language work item for an agent harness (Codex, Claude Code, pi, OpenCode, or Prime Agent) inside the sandbox. Observe progress with GET /sandboxes/\{sandboxId}/events. A Sandbox runs many conversations in parallel. Runs an agent harness with the model key or subscription connected on the Boat dashboard: it spends model usage.

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.sandboxes.agent.prompt({ sandboxId: 'bx_23456789', provider: 'codex', prompt: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `provider` | `codex \| claude-code \| claude \| pi \| opencode \| prime-agent \| prime \| kimi \| kimi-code \| mistral` | Yes | — |
| `model` | `string \| null` | No | Optional provider model id from `GET /provider-models`. Omit to use the model selected for that harness on the Agents dashboard. Unknown explicit ids are currently forwarded rather than rejected by request validation. |
| `reasoningEffort` | `string \| null` | No | Optional reasoning/thinking level (e.g. `none`, `low`, `medium`, `high`, `xhigh`, `max`). Which levels a given model accepts is listed per model in `GET /provider-models`; some models accept none. |
| `fast` | `boolean \| null` | No | Optional. `true` runs this prompt in fast mode. The model stays the same and gives output faster. The provider bills fast mode at its higher fast rate. Omit to use the choice saved on the Agents dashboard for that model. `false` forces standard speed. Only models with `fastMode` set to `true` in `GET /provider-models` accept `true`. Other models return 400 `fast_mode_not_supported`. |
| `speed` | `standard \| fast \| ultrafast \| null` | No | Optional. Same as `fast`, plus `ultrafast`, the fastest Codex tier, billed above fast. Only models with `ultrafastMode` set to `true` in `GET /provider-models` accept `ultrafast`. Other models return 400 `ultrafast_not_supported`. Ultrafast needs ChatGPT Pro, an Enterprise or Edu workspace with Ultrafast turned on, or an API organization with Ultrafast access. Without it, the prompt fails and says so. When you send both `speed` and `fast`, they must agree, or the request returns 400 `invalid_speed`. |
| `new` | `boolean` | No | Start a NEW conversation on the sandbox (runs in parallel with any existing ones) instead of continuing the most-recently-active one. Mutually exclusive with `conversationId`. |
| `conversationId` | `string \| null` | No | Continue a specific conversation by id (as returned by a previous prompt). Omit (and omit `new`) to continue the sandbox's most-recently-active conversation. |
| `prompt` | `string` | Yes | Natural-language task for the sandbox, including repo, preview, or browser-use instructions. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | Sandbox id. |
| `promptId` | `string \| null` | No | — |
| `conversationId` | `string \| null \| null` | No | The conversation this prompt was queued in. A new one when `new` was set, the one named by `conversationId`, or the sandbox's most-recently-active conversation. See [Integrated agents](https://docs.corsair.dev/integrated-agents). |
| `promptRun` | `object \| null` | No | — |
| `status` | `string \| null` | No | — |
| `provider` | `string \| null` | No | — |
| `model` | `string \| null \| null` | No | — |
| `reasoningEffort` | `string \| null \| null` | No | — |
| `fast` | `boolean \| null` | No | The prompt runs in fast mode or Ultrafast. |
| `speed` | `string \| null` | No | — |

> [accordion] promptRun full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   promptId?: string | null,
>   sandboxId?: string | null,
>   status?: string | null,
>   done?: boolean | null,
>   createdAt?: string | null | null,
>   model?: string | null | null,
>   reasoningEffort?: string | null | null,
>   fast?: boolean | null | null,
>   speed?: string | null | null,
>   conversationId?: string | null | null
> } | null
> ```

***

### agent.steer

`sandboxes.agent.steer`

Steer a running turn. Send a new message to a turn that is already running, without losing what the agent is doing. This is what typing into a coding agent while it works does: the instruction is taken into account and the work continues. Spends model usage like a prompt.

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.sandboxes.agent.steer({ sandboxId: 'bx_23456789', message: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `message` | `string` | Yes | The extra instruction for the running turn. |
| `conversation` | `string \| null` | No | Conversation id to steer. Omit to steer the sandbox's most-recently-active conversation. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | Sandbox id. |
| `conversationId` | `string \| null` | No | The conversation whose running turn was steered. |
| `promptId` | `string \| null` | No | Id of the steer record. It appears in `GET /events` as a `steer` event; it is not a prompt run and has no lifecycle to poll. |
| `native` | `boolean \| null` | No | `true` when the harness accepted the message into the turn that was already running, so nothing was interrupted. `false` when Boat interrupted that turn and immediately continued the SAME conversation with the instruction, which keeps the harness session and all of its memory but may repeat a little of the work in flight. |
| `mode` | `string \| null` | No | How the message was delivered. `native` and `fallback` mirror the `native` field; `late` means the turn finished between the request and its delivery, so the message ran as an ordinary new turn on the conversation. A steer reported `native` here can settle as `native-continued` on the `steer` event: the harness accepted it but its turn ended without acting on it, so Boat continued it immediately as its own turn on the same session. Read the event for the settled mode. |
| `status` | `string \| null` | No | — |

***

### commands.attach

`sandboxes.commands.attach`

Attach to a detached command. The output of a detached command as it is written, one JSON object per line, until the command ends. After 10 minutes the stream ends with a reconnect line: open it again with its offsets to continue with no gap. One open stream replaces polling. Needs the exec key scope. Returns \{ text, contentType }: the output as newline-delimited JSON frames, one per line.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.commands.attach({ sandboxId: 'bx_23456789', processId: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `processId` | `number` | Yes | Process id returned by a detached command start. |
| `stdoutOffset` | `number` | No | Start stdout at this byte offset. 0 sends the whole log. |
| `stderrOffset` | `number` | No | Start stderr at this byte offset. 0 sends the whole log. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `text` | `string` | Yes | The response body as text. |
| `contentType` | `string \| null` | Yes | The content type Boat answered with. |

***

### commands.get

`sandboxes.commands.get`

Get one command from the history. (GET /sandboxes/\{sandboxId}/command-history/\{commandId})

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.commands.get({ sandboxId: 'bx_23456789', commandId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `commandId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `command` | `object \| null` | No | One command run through the commands endpoint (kept 7 days), or one process of the sandbox with mode `process` (kept 72 hours). Readable while the sandbox is stopped. |

> [accordion] command full type
>
> ```ts theme={null}
> {
>   commandId?: string | null,
>   sandboxId?: string | null,
>   command?: string | null,
>   cwd?: string | null | null,
>   mode?: string | null,
>   processId?: number | null | null,
>   status?: string | null,
>   exitCode?: number | null | null,
>   signal?: string | null | null,
>   stdoutBytes?: number | null,
>   stderrBytes?: number | null,
>   outputTruncated?: boolean | null,
>   startedAt?: string | null,
>   finishedAt?: string | null | null
> } | null
> ```

***

### commands.getLogs

`sandboxes.commands.getLogs`

Read a command's stored output. Reads stdout or stderr from a byte offset, at most 1 MiB per call. Read on with nextOffset until done. A running detached command gains output every 30 s; a streamed one every 2 s. Works while the sandbox is stopped.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.commands.getLogs({ sandboxId: 'bx_23456789', commandId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `commandId` | `string` | Yes | — |
| `stream` | `stdout \| stderr` | No | — |
| `offset` | `number` | No | — |
| `limit` | `number` | No | — |
| `encoding` | `utf8 \| base64` | No | base64 returns the exact bytes. utf8 can split a character at the edge of a read. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `commandId` | `string \| null` | No | — |
| `stream` | `string \| null` | No | — |
| `offset` | `number \| null` | No | Byte position of the first byte in `data`. Greater than the requested offset only when output was not kept (see outputTruncated). |
| `nextOffset` | `number \| null` | No | Pass as `offset` to read on. |
| `size` | `number \| null` | No | Bytes the stream has so far. |
| `encoding` | `string \| null` | No | — |
| `data` | `string \| null` | No | — |
| `done` | `boolean \| null` | No | True when the command ended and this read reached the end of the stream. |

***

### commands.getStatus

`sandboxes.commands.getStatus`

Get detached command status and logs. Without offsets, the answer holds the end of each log. With stdoutOffset or stderrOffset, it holds only the output written since those byte offsets, so each poll returns only new output. A sandbox agent too old for offsets answers 409 agent\_outdated.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.commands.getStatus({ sandboxId: 'bx_23456789', processId: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `processId` | `number` | Yes | Process id returned by a detached command start. |
| `tailBytes` | `number` | No | Cap each returned log to its last N bytes. Defaults to 8388608 (8 MiB). Ignored with offsets. |
| `stdoutOffset` | `number` | No | Return only stdout written from this byte offset. Use `stdoutNextOffset` of the previous answer. |
| `stderrOffset` | `number` | No | Return only stderr written from this byte offset. Use `stderrNextOffset` of the previous answer. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `processId` | `number \| null` | No | — |
| `pid` | `number \| null` | No | — |
| `status` | `string \| null` | No | lost: the sandbox agent restarted and forgot the process; running/exitCode are then a best-effort probe and the logs come from the on-disk files. |
| `known` | `boolean \| null` | No | Whether the process is still tracked by the sandbox agent. |
| `running` | `boolean \| null` | No | — |
| `exitCode` | `number \| null \| null` | No | — |
| `signal` | `string \| null \| null` | No | — |
| `oomKilled` | `boolean \| null` | No | True when the memory ceiling killed the command or one of its processes and the command failed. |
| `command` | `string \| null \| null` | No | — |
| `cwd` | `string \| null \| null` | No | — |
| `startedAt` | `string \| null \| null` | No | — |
| `finishedAt` | `string \| null \| null` | No | — |
| `stdout` | `string \| null` | No | Tail of the stdout log file. With `stdoutOffset`: the stdout written since that offset. |
| `stderr` | `string \| null` | No | Tail of the stderr log file. With `stderrOffset`: the stderr written since that offset. |
| `stdoutTruncated` | `boolean \| null` | No | — |
| `stderrTruncated` | `boolean \| null` | No | — |
| `logPath` | `string \| null` | No | — |
| `errLogPath` | `string \| null` | No | — |
| `stdoutOffset` | `number \| null` | No | Byte offset where `stdout` starts: the offset you asked for, or 0 when the log was replaced. |
| `stderrOffset` | `number \| null` | No | Byte offset where `stderr` starts: the offset you asked for, or 0 when the log was replaced. |
| `stdoutNextOffset` | `number \| null` | No | The `stdoutOffset` for the next read. |
| `stderrNextOffset` | `number \| null` | No | The `stderrOffset` for the next read. |
| `more` | `boolean \| null` | No | True when more output is already written. Read again at once. |

***

### commands.listHistory

`sandboxes.commands.listHistory`

List the command and process history. Every command run through POST /sandboxes/\{sandboxId}/commands in the last 7 days, and every other process that wrote to its stdout/stderr in the last 72 hours (mode process), newest first. Works while the sandbox is stopped.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.commands.listHistory({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `mode` | `string` | No | Only these modes, comma-separated: sync, stream, detached, process, or `commands` for the first three. Default: all. |
| `q` | `string` | No | Only commands whose command line contains this text, in any case. |
| `limit` | `number` | No | — |
| `cursor` | `string` | No | The `nextCursor` of the previous page. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `commands` | `object[] \| null` | No | Newest first. |
| `nextCursor` | `string \| null \| null` | No | Pass as `cursor` to get the next page. Null on the last page. |

> [accordion] commands full type
>
> ```ts theme={null}
> {
>   commandId?: string | null,
>   sandboxId?: string | null,
>   command?: string | null,
>   cwd?: string | null | null,
>   mode?: string | null,
>   processId?: number | null | null,
>   status?: string | null,
>   exitCode?: number | null | null,
>   signal?: string | null | null,
>   stdoutBytes?: number | null,
>   stderrBytes?: number | null,
>   outputTruncated?: boolean | null,
>   startedAt?: string | null,
>   finishedAt?: string | null | null
> }[] | null
> ```

***

### commands.run

`sandboxes.commands.run`

Execute a command in a sandbox. Runs the command synchronously by default (timeout configurable via timeoutSeconds, 600s cap). With detached: true the command starts in the background and a process id is returned immediately; poll /sandboxes/\{sandboxId}/commands/\{processId} for status and logs. Runs on the sandbox machine. In the first seconds after a fork or resume it can answer 502 sandbox\_restoring (the command did not run): retry after 1-3 s. Without detached it waits for the command (timeoutSeconds, default 30, up to 600) and returns exitCode, stdout and stderr. For live output start it detached and read sandboxes.commands.attach.

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.sandboxes.commands.run({ sandboxId: 'bx_23456789', command: 'uname -a', timeoutSeconds: 30 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `command` | `string` | Yes | — |
| `cwd` | `string` | No | Relative working directory inside the sandbox work directory. |
| `timeoutSeconds` | `number` | No | Command timeout in seconds. Values outside 1-600 are rejected with a 400 invalid\_timeout error. |
| `detached` | `boolean` | No | Start the command in the background and return a process id immediately instead of waiting for it to finish. Output goes to a log file on the sandbox; poll the status endpoint for it. |

**Output:** `object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   ok?: boolean | null,
>   type?: string & string | null,
>   success?: boolean | null,
>   commandId?: string | null,
>   exitCode?: number | null | null,
>   signal?: string | null | null,
>   oomKilled?: boolean | null,
>   stdout?: string | null,
>   stderr?: string | null,
>   stdoutTruncated?: boolean | null,
>   stderrTruncated?: boolean | null,
>   timedOut?: boolean | null,
>   cwd?: string | null,
>   startedAt?: string | null,
>   finishedAt?: string | null
> } | {
>   ok?: boolean | null,
>   type?: string & string | null,
>   success?: boolean | null,
>   commandId?: string | null,
>   processId?: number | null,
>   pid?: number | null,
>   command?: string | null,
>   cwd?: string | null,
>   startedAt?: string | null,
>   logPath?: string | null,
>   errLogPath?: string | null
> }
> ```

***

### commands.stop

`sandboxes.commands.stop`

Stop a detached command. Sends SIGTERM to the command and every process it started, then SIGKILL to what is left after 5 s. Only a process started with detached can be stopped. The response carries the command's history record with its final state and output. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.sandboxes.commands.stop({ sandboxId: 'bx_23456789', processId: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `processId` | `number` | Yes | Process id returned by a detached command start. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `processId` | `number \| null` | No | — |
| `running` | `boolean \| null` | No | Always false after a stop. |
| `signaled` | `boolean \| null` | No | False when the process had already ended. |
| `command` | `object \| null` | No | The history record of the command, with its final state. |

> [accordion] command full type
>
> ```ts theme={null}
> {
>   commandId?: string | null,
>   sandboxId?: string | null,
>   command?: string | null,
>   cwd?: string | null | null,
>   mode?: string | null,
>   processId?: number | null | null,
>   status?: string | null,
>   exitCode?: number | null | null,
>   signal?: string | null | null,
>   stdoutBytes?: number | null,
>   stderrBytes?: number | null,
>   outputTruncated?: boolean | null,
>   startedAt?: string | null,
>   finishedAt?: string | null | null
> } | null | null
> ```

***

### create

`sandboxes.create`

Create sandbox. Provision a new cloud computer. Store the returned sandbox.id with your product job/session record. Send an Idempotency-Key header to make this call safe to retry after a lost response without creating a second billable sandbox. Starts a machine that bills by the minute until it stops (ttlSeconds, default 1 h). Pass idempotencyKey to make a retry safe. A full start window answers 429 and is not retried.

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.sandboxes.create({
	type: 'small',
	ttlSeconds: 1800,
	labels: { job: 'nightly-build' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `idempotencyKey` | `string` | No | Optional exactly-once key for creating a sandbox. Send your own opaque, account-unique value (a UUID) to make `POST /sandboxes` safe to retry when the response is lost (network timeout, 5xx): the first request creates the sandbox and binds it to the key; every later request with the **same account, key, and request body** returns that same sandbox instead of creating a second, billable one. Behavior: keys are retained for **24 hours**; a concurrent or early retry while the first sandbox is still being minted returns `409` `idempotency_in_progress` (retry shortly, same key); reusing a key with a **different body** returns `409` `idempotency_key_reused`; timeouts and 5xx are safe to retry with the same key; a create that fails before the sandbox exists releases the key within \~2 minutes so a retry can create the sandbox. Omit the header to keep the default (non-idempotent) behavior. |
| `type` | `small \| default \| large \| xlarge` | No | Machine size. `small` consumes machine time at half rate and `large` at twice the default rate (see the Billing guide). `xlarge` needs the \$100/month plan or higher, or an account access grant from an administrator. Otherwise, create, resume and fork return 403 `machine_class_plan_required`. A fork inherits the source sandbox's type unless the fork request passes its own, and resume and fork can move a sandbox between sizes. |
| `ttlSeconds` | `number \| null` | No | Number of seconds before automatic archival. `null` disables auto-stop. The backend also accepts the string `infinite` for legacy compatibility; new clients should send null. |
| `labels` | `Record<string, string>` | No | Key-value labels, for example your session id. Filter on them with `GET /sandboxes?label=key=value`. At most 20 labels. Keys match `[A-Za-z0-9][A-Za-z0-9._/-]{0,62}`; values are strings of at most 256 bytes. |
| `env` | `Record<string, string>` | No | Per-sandbox environment variables injected into the sandbox's tool environment, on top of the account environment's variables (per-sandbox values win on conflicts). Keys must match `[A-Za-z_][A-Za-z0-9_]{0,127}`; at most 100 variables and 64KB total. Reserved names (`ASCII_TOKEN`, `ASCII_API_URL`, `AGENT_ID`, `PRODUCT_MODE`, `ENVIRONMENT_ID`, `BOAT_ID`, `SERVICE_PREVIEW_TOKEN`, `BOAT_CLI_TOKEN`) are rejected with `invalid_env`. Forked sandboxes inherit the source sandbox's env unless the fork request supplies its own `env`. |
| `environment` | `string` | No | Name of the sandbox environment to attach to this sandbox. Environments are managed in the Boat dashboard and bundle the repositories, secrets, and credential toggles a sandbox gets. Omit to use your default environment (`base` unless you changed it). Unknown names are rejected with `unknown_environment`. An environment marked "safe for third parties" passes nothing to the sandbox, exactly like `noEnv`. |
| `noEnv` | `boolean` | No | Create a sandbox with none of the secrets attached to your account (no environment variables, secret files, or credentials), confined to itself so it cannot act on your account or other sandboxes. For sandboxes you give to your own users. SSH, SCP, desktop, snapshots, and public URLs still work; pass `env` to give the sandbox a secret of its own. A fork of a no-env sandbox is always no-env. Equivalent to attaching an environment marked "safe for third parties". |
| `snapshots` | `boolean` | No | Pass `false` to never snapshot this sandbox. Nothing is captured in the background, so it pays no CPU or memory for it, and stopping it erases its disk the way zero data retention does. It cannot be resumed, forked, or saved as a saved snapshot, and if its machine fails there is no backup to rebuild it from. |
| `monitoring` | `boolean` | No | Pass `false` for monitoring off. Boat keeps no command or process output, process list or CPU/RAM samples for this sandbox, and its history, processes and metrics calls answer 409 `monitoring_off`. Live output of a running command still works. While the account default is on, `true` is refused with 409 `monitoring_off_for_account`. |
| `network` | `object` | No | What the sandbox may connect to. Send `mode`, `inbound` or both: at least one. The side that the request does not name stays as it is. `inbound` and `inboundAllow` are one side. A sandbox that sets one side has its own policy and no longer follows its environment; `mode: environment` makes it follow again. On create, omitted means the policy of its environment; with `from`, the policy that the saved snapshot's sandbox had. On fork, omitted means what the source sandbox has. An API key without the `network.write` action always gets the policy that the sandbox would have without this field, a tighter one included: any other value is refused with 403 `api_key_action_forbidden`. A bad policy is refused with 400 `invalid_network_policy`. When no host can enforce a policy now, create and fork answer 409 `network_policy_unsupported`. A CI runner is always `open` and follows no environment. |
| `failFast` | `boolean` | No | Pass `true` to get a sandbox only if a machine of this type is ready right now. The call answers within about 1.5 s: either the usual `202` with the sandbox, or `503` `no_ready_machine` with nothing created, billed, or counted against your start limits, so you can retry or fall back at once. Without it, a create waits for a machine to be built when none is ready. Works with `from`; fork and resume take it too. |
| `count` | `number` | No | With `from`: create this many sandboxes from the saved snapshot in one request. Boat creates them together, which is faster than separate creates when you need many sandboxes at once. Start limits and the active-sandbox limit count every sandbox of the batch; if the batch does not fit, nothing is created. The answer lists all of them in `sandboxes` (and the first one in `sandbox`). Refused with 400 `count_requires_from` without `from`, and with 400 `count_with_fail_fast` together with `failFast`. |
| `setupScript` | `string` | No | Shell script that runs on the sandbox after it is ready. Ready means "ready to accept the user", not "setup done": the script starts in the background once provisioning completes and never blocks the sandbox becoming usable. It runs as the sandbox user (`user`, not root; `sudo` needs no password) via `bash`, with the sandbox's environment applied, and its output goes to a log file on the sandbox. Observe the outcome as `setupStatus` (pending/running/done/failed) and `setupError` on the sandbox. Rejected with a 400 `invalid_setup_script` error when it is not a string or exceeds 64KB. When the request also has `files`, the script starts after every file is written. |
| `name` | `string` | No | Display name of the sandbox, the same value `PATCH /sandboxes/{id}` sets. A sandbox created `from` a saved snapshot is named after the snapshot when this is omitted. |
| `visibility` | `private \| shared` | No | Who can use a sandbox billed to an organization, with the same rules as the sandbox's `visibility` field. `private`: only you can use it. `shared`: every member can, as long as it holds none of your personal logins (`noEnv`, or an environment that passes nothing). Omitted, the organization's default for new sandboxes applies (`PATCH /orgs/{org}` `newSandboxesPrivate`). It is set before the sandbox gets a machine, so a `private` sandbox is never shared, not even for a moment, and needs no `unshare` call. A personal sandbox is always private: `shared` is refused with 400 `not_org_sandbox`. Change it later with `POST /sandboxes/{id}/share` and `POST /sandboxes/{id}/unshare`. |
| `hostedPorts` | `object[]` | No | Ports to host on public HTTPS URLs, each exactly as `POST /sandboxes/{id}/host` does. The create waits for the sandbox's machine (up to 60 s, usually under a second), hosts every port at once and answers the URLs in `hostedPorts`. The ports are routed before the sandbox is ready, so a service that starts later is reachable as soon as it listens. Refused with 400 `invalid_hosted_ports` for a bad entry or a duplicate port, with 400 `count_with_hosted_ports` together with `count`, and with 400 `fail_fast_with_hosted_ports` together with `failFast`. |
| `files` | `object[]` | No | Files to write on the sandbox, each like `PUT /sandboxes/{id}/files` (a path under `/home/user` or `/tmp`, relative paths resolve against `/home/user`; missing folders are created). Boat writes them once the sandbox's disk is in place and before it reports `ready`, so a client that sees `ready`, and the `setupScript`, always find them. They are written once, at the first start: a resume does not write them again. At most 256KB in total; upload bigger files with `POST /sandboxes/{id}/files/upload-url`. `setupStatus` covers them: it stays `pending` until they are written, and a write that fails sets it `failed` with the path and the reason in `setupError` (the setup script then does not run). Refused with 400 `invalid_files` for a bad path, a duplicate path or a body over the limits. |
| `org` | `string` | No | Bill this sandbox to an organization you belong to (its shared wallet), by id or by name as `GET /orgs` lists it; `personal` or your own account id means personal billing. Omitted, the `X-Boat-Org` / `?org=` request scope applies, then the account's active wallet (`PATCH /orgs/active`), then personal. Listing, snapshots, and environments stay yours: the org is a wallet, not a shared workspace. Takes precedence over `teamId`. |
| `teamId` | `string` | No | Legacy alias for `org`. Ignored when `org` is also set. |
| `from` | `string` | No | Create the sandbox from a saved snapshot (saved with `POST /saved-snapshots`, or `boat snapshot <id> <name>` in the CLI). The sandbox starts from that exact frozen state. Omitting `type` inherits the type the snapshot was saved from; env and no-env inherit from the snapshot's source sandbox unless the request passes its own, with the same rules as forking. Also accepts a share code (`bsh_...`) that another account made with `POST /saved-snapshots/{name}/shares`. The new sandbox lives in and is billed to your account. It does not get the owner's per-sandbox env; your own environment applies normally. A wrong or revoked code returns `404 snapshot_not_found`. |

> [accordion] network full type
>
> ```ts theme={null}
> {
>   mode?: open | deny | allow | environment,
>   allow?: string[],
>   inbound?: open | boat-only,
>   inboundAllow?: string[],
>   inboundAllowAdd?: string[]
> }
> ```

> [accordion] hostedPorts full type
>
> ```ts theme={null}
> {
>   port: number,
>   public?: boolean,
>   localhost?: boolean,
>   title?: string
> }[]
> ```

> [accordion] files full type
>
> ```ts theme={null}
> {
>   path: string,
>   content: string,
>   encoding?: utf8 | base64
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `status` | `string \| null` | No | `ready` only when an idempotent retry finds a sandbox that is already past provisioning. |
| `ttlSeconds` | `number \| null \| null` | No | — |
| `sandbox` | `object \| null` | No | — |
| `sandboxes` | `object[] \| null` | No | Present when the request set `count` above 1. Every sandbox of the batch, in creation order. |
| `hostedPorts` | `object[] \| null` | No | Present when the request set `hostedPorts`, in request order. Each entry is what `POST /sandboxes/{id}/host` answers for that port: `url`, `access`, `isProtected` and `localhost`, or `error` and `message` when that one port could not be hosted (the sandbox is created anyway; host the port again with `POST /sandboxes/{id}/host`). |
| `giftLimitNotice` | `string \| null` | No | Present when a fair-use cap on a gifted account shortened the requested auto-stop time. |

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> } | null
> ```

> [accordion] sandboxes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> }[] | null
> ```

> [accordion] hostedPorts full type
>
> ```ts theme={null}
> {
>   port?: number | null,
>   url?: string | null,
>   isProtected?: boolean | null,
>   access?: string | null,
>   localhost?: boolean | null,
>   error?: string | null,
>   message?: string | null
> }[] | null
> ```

***

### delete

`sandboxes.delete`

Permanently delete sandbox data. Accept irreversible background deletion of the sandbox machine, snapshots, and content-bearing records. This is not archive: the sandbox cannot be resumed. Saved snapshots and other shared artifacts remain independent. Poll the returned operation until completed. Pass the sandboxId again as confirm. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.sandboxes.delete({ sandboxId: 'bx_23456789', confirm: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `confirm` | `string` | Yes | Must exactly equal the target `sandboxId` or `snapshotId`. A missing or mismatched value returns `409` without accepting deletion. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `operation` | `object \| null` | No | — |

> [accordion] operation full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   targetId?: string | null,
>   reason?: string | null,
>   status?: string | null,
>   stage?: string | null,
>   expectedBy?: string | null | null,
>   attemptCount?: number | null,
>   requestedAt?: string | null,
>   completedAt?: string | null | null
> } | null
> ```

***

### downloadArtifact

`sandboxes.downloadArtifact`

Download a sandbox artifact. Downloads one file of up to 50 MiB, under /home/user or /tmp, as raw bytes.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.downloadArtifact({ sandboxId: 'bx_23456789', path: 'notes.txt' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentBase64` | `string` | No | The file, base64-encoded. Missing when the file came back as text or contentOmitted is set. |
| `text` | `string` | No | The file as text, in place of contentBase64, when it is a text file (CSV, JSON, Markdown, XML and the like) in UTF-8. |
| `contentType` | `string` | Yes | Media type of the file, for example application/pdf. |
| `byteLength` | `number` | Yes | Size of the file in bytes. |
| `filename` | `string` | No | The file name, when known. |
| `contentOmitted` | `not_requested \| over_limit` | No | Set when the content was left out: the caller did not ask for it, or the file was over the limit. |
| `fileId` | `string` | No | Where the host saved the file. Over the limit it comes in place of the content; a host that keeps every file sets it beside the content too. On Corsair it is a Files id (fil\_…): pass it to another app wherever that app takes a file URL, or read a text file or PDF with files.read\_text. |

***

### files.createDownloadUrl

`sandboxes.files.createDownloadUrl`

Get a download URL for a sandbox file. Returns a short-lived URL that the sandbox serves itself. GET it to download the file as raw bytes, with no size limit and no Authorization header. The URL is bound to this path and expires after ttlSeconds (default 15 minutes, at most 1 hour). Needs file.read.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.files.createDownloadUrl({ sandboxId: 'bx_23456789', path: 'notes.txt' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | Yes | Absolute path, or path relative to the sandbox work directory (/home/user). It must resolve under /home/user or /tmp. |
| `ttlSeconds` | `number` | No | How long the URL stays valid. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `url` | `string \| null` | No | The signed URL. Send the request straight to it; it needs no Authorization header. |
| `method` | `string \| null` | No | GET downloads the file. PUT uploads the request body as the file. |
| `path` | `string \| null` | No | The canonical path the URL is bound to. |
| `expiresAt` | `string \| null` | No | — |

***

### files.createFolder

`sandboxes.files.createFolder`

Create a directory in a sandbox. Missing parent directories are created. An existing directory is not an error. Needs file.write.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.files.createFolder({ sandboxId: 'bx_23456789', path: 'notes.txt' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | Yes | Missing parent directories are created. |
| `mode` | `string` | No | Octal permission bits, for example "755". |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `path` | `string \| null` | No | Absolute path on the sandbox. |
| `isDir` | `boolean \| null` | No | — |
| `isSymlink` | `boolean \| null` | No | — |
| `size` | `number \| null` | No | — |
| `mode` | `string \| null` | No | Octal permission bits, for example "0644". |
| `modifiedAt` | `string \| null` | No | — |
| `success` | `boolean \| null` | No | — |

***

### files.createUploadUrl

`sandboxes.files.createUploadUrl`

Get an upload URL for a sandbox file. Returns a short-lived URL that the sandbox serves itself. PUT the file as the raw request body to write it, with no size limit and no Authorization header. Missing directories are created; an existing file is replaced only once the upload completes.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.files.createUploadUrl({ sandboxId: 'bx_23456789', path: 'notes.txt' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | Yes | Absolute path, or path relative to the sandbox work directory (/home/user). It must resolve under /home/user or /tmp. |
| `ttlSeconds` | `number` | No | How long the URL stays valid. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `url` | `string \| null` | No | The signed URL. Send the request straight to it; it needs no Authorization header. |
| `method` | `string \| null` | No | GET downloads the file. PUT uploads the request body as the file. |
| `path` | `string \| null` | No | The canonical path the URL is bound to. |
| `expiresAt` | `string \| null` | No | — |

***

### files.delete

`sandboxes.files.delete`

Delete a file or directory in a sandbox. A directory needs recursive=true. A symlink is deleted itself, never its target. /home/user and /tmp themselves cannot be deleted. Needs file.write. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.sandboxes.files.delete({ sandboxId: 'bx_23456789', path: 'notes.txt' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | Yes | — |
| `recursive` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `path` | `string \| null` | No | — |

***

### files.find

`sandboxes.files.find`

Find text in sandbox files. Every line under path that contains pattern. pattern is plain text; with regex=true it is an extended regular expression. Binary files are skipped and symlinks are not followed. Needs file.read.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.files.find({ sandboxId: 'bx_23456789', pattern: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | No | — |
| `pattern` | `string` | Yes | — |
| `regex` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `matches` | `object[] \| null` | No | At most 1,000 matches. Each line is cut at 500 characters. |
| `truncated` | `boolean \| null` | No | — |
| `errors` | `string[] \| null` | No | Present only when part of the tree could not be searched. The matches are then incomplete. An invalid regular expression is an error response. |

> [accordion] matches full type
>
> ```ts theme={null}
> {
>   file?: string | null,
>   line?: number | null,
>   content?: string | null
> }[] | null
> ```

***

### files.getInfo

`sandboxes.files.getInfo`

Get file or directory details in a sandbox. Size, permission bits, type and modification time. Needs file.read.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.files.getInfo({ sandboxId: 'bx_23456789', path: 'notes.txt' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `path` | `string \| null` | No | Absolute path on the sandbox. |
| `isDir` | `boolean \| null` | No | — |
| `isSymlink` | `boolean \| null` | No | — |
| `size` | `number \| null` | No | — |
| `mode` | `string \| null` | No | Octal permission bits, for example "0644". |
| `modifiedAt` | `string \| null` | No | — |
| `success` | `boolean \| null` | No | — |

***

### files.list

`sandboxes.files.list`

List a directory in a sandbox. One level, sorted by name. A symlink is listed as a symlink, not followed. Defaults to /home/user. Needs file.read.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.files.list({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `path` | `string \| null` | No | — |
| `files` | `object[] \| null` | No | — |
| `truncated` | `boolean \| null` | No | True when the directory holds more than 10,000 entries. |

> [accordion] files full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   path?: string | null,
>   isDir?: boolean | null,
>   isSymlink?: boolean | null,
>   size?: number | null,
>   mode?: string | null,
>   modifiedAt?: string | null
> }[] | null
> ```

***

### files.move

`sandboxes.files.move`

Move or rename a file or directory in a sandbox. Works across /home/user and /tmp. A symlink is moved itself, never its target. Needs file.write.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.files.move({ sandboxId: 'bx_23456789', source: 'example', destination: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `source` | `string` | Yes | — |
| `destination` | `string` | Yes | The new full path. Missing parent directories are created. |
| `overwrite` | `boolean` | No | Replace an existing destination. Without it, an existing destination is an error. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `path` | `string \| null` | No | — |
| `destination` | `string \| null` | No | — |

***

### files.read

`sandboxes.files.read`

Read a file from a sandbox. Files up to 5 MiB. For a larger file, use POST /sandboxes/\{sandboxId}/files/download-url. On a sandbox that is still starting, the call waits until it is ready (up to 60 s, like a command), so it reads the sandbox's own disk and never the machine's stock one.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.files.read({ sandboxId: 'bx_23456789', path: 'notes.txt' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | Yes | Absolute path, or path relative to the sandbox work directory (/home/user). The canonicalized path must resolve under /home/user or /tmp; anything else is rejected with a 400 invalid\_path error. |
| `encoding` | `utf8 \| base64` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `path` | `string \| null` | No | — |
| `encoding` | `string \| null` | No | — |
| `size` | `number \| null` | No | — |
| `content` | `string \| null` | No | — |

***

### files.replace

`sandboxes.files.replace`

Replace text in sandbox files. Replaces every occurrence of pattern with newValue in each file. Needs file.write.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.files.replace({
	sandboxId: 'bx_23456789',
	paths: ['notes.txt'],
	pattern: 'example',
	newValue: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `paths` | `string[]` | Yes | Files up to 5 MiB each. |
| `pattern` | `string` | Yes | Plain text. Every occurrence is replaced, byte for byte; the rest of the file is not changed. |
| `newValue` | `string` | Yes | Required. Use "" to delete the matches. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `results` | `object[] \| null` | No | One result per file. A file that fails does not stop the others. |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   file?: string | null,
>   success?: boolean | null,
>   replacements?: number | null,
>   error?: string | null
> }[] | null
> ```

***

### files.search

`sandboxes.files.search`

Search files by name in a sandbox. Every file and directory under path whose name matches the glob pattern (for example \*.py). Symlinks are not followed. Needs file.read.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.files.search({ sandboxId: 'bx_23456789', pattern: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | No | — |
| `pattern` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `files` | `string[] \| null` | No | Absolute paths, at most 10,000. |
| `truncated` | `boolean \| null` | No | — |
| `errors` | `string[] \| null` | No | Present only when part of the tree could not be searched (for example a folder you cannot read). The results are then incomplete. A search that fails completely is an error response. |

***

### files.setPermissions

`sandboxes.files.setPermissions`

Set file permissions in a sandbox. Sets the permission bits. Files belong to the sandbox user; the owner and group do not change. Needs file.write.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.files.setPermissions({ sandboxId: 'bx_23456789', path: 'notes.txt', mode: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | Yes | — |
| `mode` | `string` | Yes | Octal permission bits, for example "755". |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `path` | `string \| null` | No | Absolute path on the sandbox. |
| `isDir` | `boolean \| null` | No | — |
| `isSymlink` | `boolean \| null` | No | — |
| `size` | `number \| null` | No | — |
| `mode` | `string \| null` | No | Octal permission bits, for example "0644". |
| `modifiedAt` | `string \| null` | No | — |
| `success` | `boolean \| null` | No | — |

***

### files.write

`sandboxes.files.write`

Write a file in a sandbox. Files up to 5 MiB after decoding. For a larger file, use POST /sandboxes/\{sandboxId}/files/upload-url. On a sandbox that is still starting, the call waits until it is ready (up to 60 s, like a command): a sandbox's files are in place only once it is ready, so a write any earlier would not stay.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.files.write({ sandboxId: 'bx_23456789', path: 'notes.txt', content: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `path` | `string` | Yes | Absolute path, or path relative to the sandbox work directory (/home/user). The canonicalized path must resolve under /home/user or /tmp; anything else is rejected with a 400 invalid\_path error. |
| `content` | `string` | Yes | — |
| `encoding` | `utf8 \| base64` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `path` | `string \| null` | No | — |
| `encoding` | `string \| null` | No | — |
| `size` | `number \| null` | No | — |

***

### fork

`sandboxes.fork`

Fork sandbox. Provision a new sandbox from an existing one. Send an Idempotency-Key header to make this call safe to retry after a lost response without creating a second billable fork. Starts a new machine that bills like a create. Pass idempotencyKey to make a retry safe.

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.sandboxes.fork({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `idempotencyKey` | `string` | No | Optional exactly-once key for creating a sandbox. Send your own opaque, account-unique value (a UUID) to make `POST /sandboxes` safe to retry when the response is lost (network timeout, 5xx): the first request creates the sandbox and binds it to the key; every later request with the **same account, key, and request body** returns that same sandbox instead of creating a second, billable one. Behavior: keys are retained for **24 hours**; a concurrent or early retry while the first sandbox is still being minted returns `409` `idempotency_in_progress` (retry shortly, same key); reusing a key with a **different body** returns `409` `idempotency_key_reused`; timeouts and 5xx are safe to retry with the same key; a create that fails before the sandbox exists releases the key within \~2 minutes so a retry can create the sandbox. Omit the header to keep the default (non-idempotent) behavior. |
| `labels` | `Record<string, string>` | No | Labels of the fork. The fork never takes the source's labels. Same rules as `CreateSandboxRequest.labels`. |
| `failFast` | `boolean` | No | Pass `true` to fork only if a machine is ready right now. Within about 1.5 s you get the usual `202`, or `503` `no_ready_machine` with no fork created and nothing counted against your start limits. |
| `monitoring` | `boolean` | No | `false` creates the fork with monitoring off: Boat keeps no command or process output, process list or CPU/RAM samples for it. Omitted, the fork keeps the source sandbox's setting. `true` turns it on for the fork, unless the account has monitoring off by default (`409` `monitoring_off_for_account`). |
| `network` | `object` | No | What the sandbox may connect to. Send `mode`, `inbound` or both: at least one. The side that the request does not name stays as it is. `inbound` and `inboundAllow` are one side. A sandbox that sets one side has its own policy and no longer follows its environment; `mode: environment` makes it follow again. On create, omitted means the policy of its environment; with `from`, the policy that the saved snapshot's sandbox had. On fork, omitted means what the source sandbox has. An API key without the `network.write` action always gets the policy that the sandbox would have without this field, a tighter one included: any other value is refused with 403 `api_key_action_forbidden`. A bad policy is refused with 400 `invalid_network_policy`. When no host can enforce a policy now, create and fork answer 409 `network_policy_unsupported`. A CI runner is always `open` and follows no environment. |
| `env` | `Record<string, string>` | No | Replaces the env the fork would otherwise inherit from the source sandbox. Same validation rules as `CreateSandboxRequest.env`. |
| `environment` | `string` | No | Optionally pin the fork to a different named sandbox environment. Omit to inherit the source sandbox's environment. Unknown names are rejected with `unknown_environment`. |
| `noEnv` | `boolean` | No | Make the fork no-env (see `CreateSandboxRequest.noEnv`). A fork of a no-env sandbox is always no-env regardless of this field. |
| `type` | `small \| default \| large \| xlarge` | No | Machine size for the fork. Omit to inherit the source sandbox's type. `xlarge` needs the \$100/month plan or higher (403 `machine_class_plan_required`). The source sandbox is never modified. Shrinking is rejected with `type_too_small` when the source's data would not fit the smaller disk. |
| `ttlSeconds` | `number \| null` | No | Auto-stop for the fork, in seconds. Omit for the 1 hour default; the fork does NOT inherit the source sandbox's TTL, so forking a sandbox that has auto-stop disabled still gives you a fork that stops itself. `null` disables auto-stop, which means nothing will ever stop this sandbox for you. |

> [accordion] network full type
>
> ```ts theme={null}
> {
>   mode?: open | deny | allow | environment,
>   allow?: string[],
>   inbound?: open | boat-only,
>   inboundAllow?: string[],
>   inboundAllowAdd?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sandbox` | `object \| null` | No | — |
| `forced` | `boolean \| null` | No | On stop, true when this stop discards work written after the last snapshot. |
| `operation` | `object \| null` | No | On stop, the stop operation (also on a sandbox that is already stopping or stopped). |
| `statusUrl` | `string \| null \| null` | No | On stop, the path that reads this stop operation, for example `/api/v1/sandboxes/bx_23456789/stops/stop_0123456789abcdef`. |
| `giftLimitNotice` | `string \| null` | No | Present on resume or fork when a fair-use cap on a gifted account shortened the requested auto-stop time. |
| `conversationId` | `string \| null` | No | On interrupt, the conversation whose turn was interrupted. |

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> } | null | null
> ```

> [accordion] operation full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   status?: string | null,
>   requestedAt?: string | null | null,
>   lastAttemptAt?: string | null | null,
>   error?: string | null | null,
>   endedAt?: string | null | null,
>   forced?: boolean | null
> } | null | null
> ```

***

### get

`sandboxes.get`

Get sandbox. Poll this endpoint after create, stop, resume, or fork operations.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.get({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `sandbox` | `object \| null` | No | — |
| `giftLimitNotice` | `string \| null` | No | Present when a fair-use cap on a gifted account shortened the requested auto-stop time. |

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> } | null
> ```

***

### getAiUsage

`sandboxes.getAiUsage`

Get sandbox AI usage. One sandbox's proxied AI usage per UTC day, credential and model, and whether it is blocked. Needs an API key with sandbox.read on the sandbox. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.getAiUsage({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `days` | `number` | No | Days of history, today included. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `sandboxId` | `string \| null` | No | — |
| `blocked` | `boolean \| null` | No | True when the proxy refuses this sandbox's placeholders. |
| `proxied` | `boolean \| null` | No | True when the sandbox holds placeholders, not real keys. |
| `credentialProfileId` | `string \| null \| null` | No | The profile the sandbox uses. Null means its owner's default. |
| `since` | `string \| null` | No | — |
| `usage` | `object[] \| null` | No | — |
| `totals` | `object \| null` | No | Token counts are the numbers the provider reports in its replies. |
| `dollars` | `number \| null` | No | — |

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   day?: string | null,
>   credential?: string | null,
>   model?: string | null,
>   requests?: number | null,
>   errors?: number | null,
>   inputTokens?: number | null,
>   outputTokens?: number | null,
>   cacheReadTokens?: number | null,
>   cacheWriteTokens?: number | null
> }[] | null
> ```

> [accordion] totals full type
>
> ```ts theme={null}
> {
>   requests?: number | null,
>   errors?: number | null,
>   inputTokens?: number | null,
>   outputTokens?: number | null,
>   cacheReadTokens?: number | null,
>   cacheWriteTokens?: number | null
> } | null
> ```

***

### getDesktopUrl

`sandboxes.getDesktopUrl`

Get desktop streaming URL. Create or fetch a secret-bearing desktop/noVNC URL for live computer-use visibility. Use ?vnc=1 for noVNC; a provisioning: true response means poll again. The URL carries an access token: keep it out of logs.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.getDesktopUrl({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `vnc` | `1` | No | Use VNC/noVNC streaming mode. |
| `theme` | `light \| dark` | No | Desktop streaming theme for non-VNC mode. |
| `publicAccess` | `boolean` | No | For `?vnc=1`, return a noVNC URL that does not require an access token. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `desktopUrl` | `string \| null \| null` | No | Secret-bearing desktop or noVNC URL. Redact from logs. |
| `ip` | `string \| null \| null` | No | — |
| `mode` | `string \| null` | No | — |
| `provisioning` | `boolean \| null` | No | For `?vnc=1`, true means VNC is still being prepared; poll again. |
| `message` | `string \| null` | No | — |

***

### getNetworkPolicy

`sandboxes.getNetworkPolicy`

Get a sandbox's network policy. The network policy (outbound and inbound), and whether the sandbox's host enforces it. To read the inbound list, add ?include=inboundAllow. Needs sandbox.read.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.getNetworkPolicy({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `include` | `(inboundAllow \| access)[]` | No | Optional fields of the answer, separated by commas: `?include=inboundAllow,access`. `inboundAllow`: the answer holds `network.inboundAllow`, always an array, and empty when there is no list. `access`: the answer holds `access`. Without a name, the answer does not hold that field. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `network` | `object \| null` | No | The sandbox's outbound network policy. |
| `sandbox` | `object \| null` | No | The sandbox of this policy and its state now. |
| `access` | `object \| null` | No | What the caller may do with this policy. Only when the request has `include=access`. |

> [accordion] network full type
>
> ```ts theme={null}
> {
>   mode?: string | null,
>   allow?: string[] | null,
>   status?: string | null,
>   inbound?: string | null,
>   inboundAllow?: string[] | null,
>   pendingReason?: string | null,
>   apiBound?: boolean | null | null,
>   source?: string | null,
>   updatedAt?: string | null | null
> } | null
> ```

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   state?: string | null | null
> } | null
> ```

> [accordion] access full type
>
> ```ts theme={null}
> {
>   canChange?: boolean | null,
>   managed?: boolean | null
> } | null
> ```

***

### getStop

`sandboxes.getStop`

Get a stop by id. Returns one stop of this sandbox by the id that POST /sandboxes/\{sandboxId}/stop returned. Old stops stay readable after a resume or a later stop. Returns 404 when the id is unknown or belongs to another sandbox.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.getStop({ sandboxId: 'bx_23456789', stopId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `stopId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `stop` | `object \| null` | No | — |

> [accordion] stop full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   status?: string | null,
>   requestedAt?: string | null | null,
>   lastAttemptAt?: string | null | null,
>   error?: string | null | null,
>   endedAt?: string | null | null,
>   forced?: boolean | null
> } | null
> ```

***

### getUsage

`sandboxes.getUsage`

Get boat usage. Machine time one sandbox consumed, and what it costs, so you can bill your own users per sandbox. Same meter as GET /limits: billable seconds with the sandbox type's multiplier applied, paused past a refused stop, never counting time stopped.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.getUsage({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `since` | `string` | No | Count from this time, ISO 8601 or Unix epoch seconds. Default is the sandbox's creation. |
| `until` | `string` | No | Count up to this time, ISO 8601 or Unix epoch seconds. Default is now. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `sandboxId` | `string \| null` | No | — |
| `sandboxType` | `string \| null` | No | The sandbox's current machine size, which sets `billingMultiplier`. |
| `billingMultiplier` | `number \| null` | No | Rate at which this sandbox consumes machine time. 0.5 for `small`, 1 for `default`, 2 for `large`, and 50/9 (about 5.56) for `xlarge`. |
| `since` | `string \| null` | No | Start of the window the figures cover. The sandbox's creation time when the request did not pass `since`. |
| `until` | `string \| null` | No | End of the window. Now when the request did not pass `until`, or passed one in the future. |
| `seconds` | `number \| null` | No | Billable machine-seconds inside the window, the type multiplier already applied: a `large` sandbox that ran ten minutes reads 1200. Includes a running sandbox's time up to `until`. Time while stopped is never counted and time past a refused stop is excluded. |
| `dollars` | `number \| null` | No | `seconds` at list price (`seconds / secondsPerDollar`), whatever plan, trial or gift actually paid for it. Up to six decimals. |
| `secondsPerDollar` | `number \| null` | No | How many billable seconds one dollar buys, so you can price `seconds` yourself. |
| `running` | `boolean \| null` | No | The meter is still moving: the sandbox is up and no refused stop is holding it paused. Read again after it stops for the final figure. `false` on a sandbox that is up but paused past a refused stop, whose figure will not change until it is used again. |

***

### hostPort

`sandboxes.hostPort`

Expose a sandbox port on a public HTTPS URL. Registers a stable https\://\<sandbox-subdomain>-\<port>.on.boat.dev route for a port inside the sandbox and opens the sandbox firewall for it. Idempotent: calling it again for the same sandbox and port returns the same URL and token.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.hostPort({ sandboxId: 'bx_23456789', port: 1 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `port` | `number` | Yes | Port the service listens on inside the sandbox. |
| `public` | `boolean` | No | Return an ungated URL instead of one that requires the `_token` query parameter. |
| `localhost` | `boolean` | No | Set when the service listens on localhost (`127.0.0.1` or `::1`) only. The sandbox relays the URL to it. Leave unset for a service bound to `0.0.0.0`. Each call sets the value again. |
| `title` | `string` | No | Display title for the hosted port. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `success` | `boolean \| null` | No | — |
| `port` | `number \| null` | No | — |
| `url` | `string \| null` | No | Public HTTPS URL. Carries the `_token` query parameter unless the port is public; redact from logs. |
| `isProtected` | `boolean \| null` | No | — |
| `access` | `string \| null` | No | — |
| `localhost` | `boolean \| null` | No | The sandbox relays the URL to a service that listens on localhost only. |

***

### list

`sandboxes.list`

List sandboxes. Your sandboxes. In an organization's scope (the active wallet, org, or X-Boat-Org) the list also holds every sandbox that organization pays for, whoever created it; createdBy and access say whose it is and what you may do with it.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `limit` | `number` | No | Maximum items to return. |
| `cursor` | `string \| null` | No | Opaque pagination cursor returned as `pageInfo.nextCursor`. |
| `sort` | `asc \| desc` | No | Sort direction for cursor pagination. |
| `state` | `string` | No | Comma-separated sandbox state filter, for example `ready,idle,running`. |
| `name` | `string` | No | Keep the sandboxes with exactly this name. |
| `namePrefix` | `string` | No | Keep sandboxes whose name starts with this text, for example `myapp-`. The match is literal. |
| `stoppedBefore` | `string` | No | Keep stopped sandboxes that stopped before this ISO 8601 time. Every stop counts, auto-stops too. |
| `dataExpired` | `boolean` | No | `true` keeps sandboxes whose data retention deleted (`dataExpiredAt` is set). `false` keeps the others. |
| `label` | `string[]` | No | `key=value`. Repeat it to require several labels, for example `label=session%3Dabc&label=env%3Dprod`. |
| `include` | `string` | No | Comma-separated. `cost` adds each sandbox's `cost` this calendar month (UTC), at list price. `deletedCost` adds wallet-wide machine time of deleted sandboxes this list would show (not for API keys limited to some sandboxes). |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `sandboxes` | `object[] \| null` | No | — |
| `pageInfo` | `object \| null` | No | — |
| `deletedCost` | `object \| null` | No | Only with `include=deletedCost`, and not for an API key limited to some sandboxes. Machine time this calendar month (UTC) of deleted sandboxes this list would otherwise show. They are not in the list, but their time was billed. Add it to the sandboxes' `cost` to get the full total. |

> [accordion] sandboxes full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   nextCursor?: string | null | null,
>   hasMore?: boolean | null,
>   limit?: number | null
> } | null
> ```

> [accordion] deletedCost full type
>
> ```ts theme={null}
> {
>   since?: string | null,
>   seconds?: number | null,
>   dollars?: number | null
> } | null
> ```

***

### listProcesses

`sandboxes.listProcesses`

List the processes in a sandbox. A running sandbox: every user-space process, read now, busiest first. A stopped sandbox: the last sample kept (live: false).

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.listProcesses({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `live` | `boolean \| null` | No | True: read from the running sandbox now. False: the sandbox is stopped (or its agent is not upgraded yet), and this is the last sample kept (top 12 processes, every 30 s, 7 days). |
| `sampledAt` | `string \| null \| null` | No | — |
| `total` | `number \| null` | No | Processes on the sandbox. The list holds at most 500, busiest first. |
| `processes` | `object[] \| null` | No | — |

> [accordion] processes full type
>
> ```ts theme={null}
> {
>   pid?: number | null,
>   parentPid?: number | null,
>   user?: string | null,
>   cpuPercent?: number | null,
>   memoryMB?: number | null,
>   startedAt?: string | null,
>   command?: string | null,
>   commandId?: string | null | null
> }[] | null
> ```

***

### recover

`sandboxes.recover`

Recover a sandbox that stopped responding. Power-cycle the machine of a sandbox that stopped answering. The disk is not touched. The sandbox usually answers again within 1-2 minutes and then saves your work by itself; sandbox.recovered fires when it does. Refused with 409: - sandbox\_is\_reachable: the sandbox answers normally. Power-cycles the machine. A sandbox that still answers gets 409 (and some machines cannot be power-cycled: 409 with the boat stop --force advice).

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.sandboxes.recover({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `message` | `string \| null` | No | — |

***

### resume

`sandboxes.resume`

Resume sandbox. Starts the machine again; it bills until it stops.

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.sandboxes.resume({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `failFast` | `boolean` | No | Pass `true` to resume only if a machine is ready right now. Within about 1.5 s you get the usual `202`, or `503` `no_ready_machine` with the sandbox left stopped and nothing counted against your start limits. |
| `type` | `small \| default \| large \| xlarge` | No | Resume onto a different machine size. Omit to keep the sandbox's current type. `xlarge` needs the \$100/month plan or higher, or an account access grant from an administrator (403 `machine_class_plan_required` otherwise). A resume already restores onto a fresh machine, so changing size costs nothing extra. Shrinking is rejected with `type_too_small` when the sandbox's data would not fit the smaller disk. |
| `env` | `Record<string, string>` | No | Replaces the sandbox's per-sandbox environment variables. Omit to keep the sandbox's current env. Same validation rules as `CreateSandboxRequest.env`. |
| `environment` | `string` | No | Optionally re-pin the sandbox to a different named sandbox environment on resume. Omit to keep the sandbox's current environment. Unknown names are rejected with `unknown_environment`. |
| `noEnv` | `boolean` | No | Resume into a no-env sandbox: withhold account secrets and scrub inherited owner secrets from the restored snapshot before the sandbox is exposed. One-way; once a sandbox is resumed as no-env it stays no-env on later resumes. |
| `ttlSeconds` | `number \| null` | No | Auto-stop for the resumed sandbox, in seconds, stored on the sandbox. Omit to keep the TTL the sandbox already had. `null` disables auto-stop, which means nothing will ever stop this sandbox for you. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sandbox` | `object \| null` | No | — |
| `forced` | `boolean \| null` | No | On stop, true when this stop discards work written after the last snapshot. |
| `operation` | `object \| null` | No | On stop, the stop operation (also on a sandbox that is already stopping or stopped). |
| `statusUrl` | `string \| null \| null` | No | On stop, the path that reads this stop operation, for example `/api/v1/sandboxes/bx_23456789/stops/stop_0123456789abcdef`. |
| `giftLimitNotice` | `string \| null` | No | Present on resume or fork when a fair-use cap on a gifted account shortened the requested auto-stop time. |
| `conversationId` | `string \| null` | No | On interrupt, the conversation whose turn was interrupted. |

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> } | null | null
> ```

> [accordion] operation full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   status?: string | null,
>   requestedAt?: string | null | null,
>   lastAttemptAt?: string | null | null,
>   error?: string | null | null,
>   endedAt?: string | null | null,
>   forced?: boolean | null
> } | null | null
> ```

***

### setAiAccess

`sandboxes.setAiAccess`

Block or unblock sandbox AI access. Blocks or unblocks the sandbox's AI placeholders, running or stopped. The proxy refuses a blocked sandbox's requests with 403. It has no effect on a sandbox that holds real keys. The sandbox creator, or a manager of its credential profile, can call it. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.setAiAccess({ sandboxId: 'bx_23456789', blocked: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `blocked` | `boolean` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `sandboxId` | `string \| null` | No | — |
| `blocked` | `boolean \| null` | No | — |

***

### setNetworkPolicy

`sandboxes.setNetworkPolicy`

Replace a sandbox's network policy. Sets the policy, on a running or a stopped sandbox. The side that the request does not name (mode and allow, or inbound and inboundAllow) stays as it is. To add one address to the inbound list, send inboundAllowAdd. A change also ends open connections that the new policy does not allow.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.setNetworkPolicy({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `include` | `(inboundAllow \| access)[]` | No | Optional fields of the answer, separated by commas: `?include=inboundAllow,access`. `inboundAllow`: the answer holds `network.inboundAllow`, always an array, and empty when there is no list. `access`: the answer holds `access`. Without a name, the answer does not hold that field. |
| `mode` | `open \| deny \| allow \| environment` | No | `open`: no limit. `deny`: the sandbox opens no connection. `allow`: it connects only to the entries of `allow`. `environment`: no policy of its own; the sandbox follows the policy of its environment (open when the environment sets none). This is the default on create. In an organization environment that sets a policy, only owners and admins can give a sandbox another policy: members get 403 `network_policy_managed`. |
| `allow` | `string[]` | No | With mode `allow`, 1 to 100 entries; empty or omitted with any other mode. An empty list with no `mode`, or with mode `open` or `deny`, means no list. Each entry is a domain (`github.com`), a wildcard (`*.github.com`, which covers the domain itself and every subdomain), a public IP address or a public CIDR range. No scheme, port or path. A domain entry allows TCP 443 (matched by TLS SNI) and TCP 80 (matched by HTTP Host). An IP or CIDR entry allows every protocol and port. |
| `inbound` | `open \| boat-only` | No | Who can connect to the sandbox. `open`: anyone on the internet, on the ports that the sandbox opens. `boat-only`: only boat. The host drops every other connection to the sandbox, so code inside cannot make a port public. SSH, editors, port forwards, the desktop and raw ports stop: their routes answer 403 `inbound_closed`. A caller outside the sandbox (a session, or an API key that does not live in a sandbox) can still publish a port with `POST /sandboxes/{id}/host`. Commands and files through the API keep working. Omitted on PUT: the sandbox keeps what it has. Omitted on create or fork: what the sandbox inherits, else `open`. A change of `inbound` is a change of the policy: the same rules on keys and on organization environments apply. With `boat-only`, the addresses of `inboundAllow` keep SSH and raw ports. |
| `inboundAllow` | `string[]` | No | The public addresses that can still connect directly to the sandbox when `inbound` is `boat-only`. Each entry is a public IPv4 or IPv6 address, or a public CIDR range. No domain, port or path. At most 50 entries. Private ranges, reserved ranges and `/0` are refused with 400 `invalid_network_policy`. A listed address reaches SSH and the raw ports of the sandbox. The desktop, the browser stream, signed file URLs and `host <port>` inside the sandbox stay off: they answer 403 `inbound_closed`. A list with entries needs `inbound: boat-only` in the same request. A request that names `inbound` without `inboundAllow` empties the list. An empty list means no list. A request that names neither keeps both. |
| `inboundAllowAdd` | `string[]` | No | Only on `PUT /sandboxes/{sandboxId}/network`: not on create, fork or environments. The entries to add to the list that the sandbox has. The entry rules of `inboundAllow` apply. It needs `inbound: boat-only` in the same request. Do not send it together with an `inboundAllow` that has entries. boat adds the entries when the write runs. Two callers that each add an address both keep their address. An address that another caller removed stays removed. An open sandbox becomes `boat-only` with these entries only. A result of more than 50 entries is refused with 400 `invalid_network_policy`. The answer shows the whole list in `network.inboundAllow` when the request has `include=inboundAllow`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `network` | `object \| null` | No | The sandbox's outbound network policy. |
| `sandbox` | `object \| null` | No | The sandbox of this policy and its state now. |
| `access` | `object \| null` | No | What the caller may do with this policy. Only when the request has `include=access`. |

> [accordion] network full type
>
> ```ts theme={null}
> {
>   mode?: string | null,
>   allow?: string[] | null,
>   status?: string | null,
>   inbound?: string | null,
>   inboundAllow?: string[] | null,
>   pendingReason?: string | null,
>   apiBound?: boolean | null | null,
>   source?: string | null,
>   updatedAt?: string | null | null
> } | null
> ```

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   state?: string | null | null
> } | null
> ```

> [accordion] access full type
>
> ```ts theme={null}
> {
>   canChange?: boolean | null,
>   managed?: boolean | null
> } | null
> ```

***

### share

`sandboxes.share`

Share sandbox with the organization. Let every member of the organization that pays for this sandbox use it. A sandbox that holds none of your personal logins is shared at once. Only a sandbox billed to an organization can be shared (400 otherwise).

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.share({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandbox` | `object \| null` | No | — |
| `restartRequired` | `boolean \| null` | No | True when the sandbox was running: what runs on it still holds your logins in memory, so it stays `view` for the organization until you stop and resume it. |
| `message` | `string \| null` | No | — |

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> } | null
> ```

***

### snapshots.deleteAll

`sandboxes.snapshots.deleteAll`

Permanently delete all snapshots of a sandbox. Accept irreversible deletion of every unpinned snapshot of this sandbox. The sandbox itself and its saved snapshots stay. Snapshots disappear from lists, restores and forks immediately; their stored data is purged in the background. Set X-Ascii-Confirm-Delete to the sandbox id. Pass the sandboxId again as confirm. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.sandboxes.snapshots.deleteAll({ sandboxId: 'bx_23456789', confirm: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `confirm` | `string` | Yes | Must exactly equal the target `sandboxId` or `snapshotId`. A missing or mismatched value returns `409` without accepting deletion. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `operations` | `object[] \| null` | No | — |

> [accordion] operations full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   targetId?: string | null,
>   reason?: string | null,
>   status?: string | null,
>   stage?: string | null,
>   expectedBy?: string | null | null,
>   attemptCount?: number | null,
>   requestedAt?: string | null,
>   completedAt?: string | null | null
> }[] | null
> ```

***

### snapshots.getLatest

`sandboxes.snapshots.getLatest`

Get latest boat snapshot. Return the most recent completed snapshot for this sandbox, or null if it has none.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.snapshots.getLatest({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `snapshot` | `object \| null` | No | — |

> [accordion] snapshot full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   sandboxId?: string | null,
>   status?: string | null,
>   kind?: string | null | null,
>   generation?: number | null | null,
>   chainId?: string | null | null,
>   createdAt?: string | null,
>   completedAt?: string | null | null,
>   sizeBytes?: number | null | null,
>   fileCount?: number | null | null,
>   contentSizeBytes?: number | null | null,
>   contentFileCount?: number | null | null,
>   origin?: string | null
> } | null | null
> ```

***

### snapshots.list

`sandboxes.snapshots.list`

List boat snapshots. List visible completed snapshots for one sandbox with uncapped cursor pagination.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.sandboxes.snapshots.list({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `limit` | `number` | No | Maximum items to return. |
| `cursor` | `string \| null` | No | Opaque pagination cursor returned as `pageInfo.nextCursor`. |
| `sort` | `asc \| desc` | No | Sort direction for cursor pagination. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `snapshots` | `object[] \| null` | No | — |
| `pageInfo` | `object \| null` | No | — |

> [accordion] snapshots full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   sandboxId?: string | null,
>   status?: string | null,
>   kind?: string | null | null,
>   generation?: number | null | null,
>   chainId?: string | null | null,
>   createdAt?: string | null,
>   completedAt?: string | null | null,
>   sizeBytes?: number | null | null,
>   fileCount?: number | null | null,
>   contentSizeBytes?: number | null | null,
>   contentFileCount?: number | null | null,
>   origin?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   nextCursor?: string | null | null,
>   hasMore?: boolean | null,
>   limit?: number | null
> } | null
> ```

***

### stop

`sandboxes.stop`

Stop and archive sandbox. Stop active work and archive/snapshot the sandbox for later resume or fork. A stop always saves the sandbox's disk first. If that save is failing, the stop is refused and the sandbox keeps running so your work is not discarded, we retry automatically and email you.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.stop({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `force` | `boolean` | No | Stop the sandbox even if its disk cannot be snapshotted. It keeps its last successful snapshot and everything written since then is permanently LOST. Without this, a sandbox whose snapshot pipeline is failing is left running rather than discarding your work, and you are not billed for that time. Only use this after a stop has already been refused. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `id` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `sandbox` | `object \| null` | No | — |
| `forced` | `boolean \| null` | No | On stop, true when this stop discards work written after the last snapshot. |
| `operation` | `object \| null` | No | On stop, the stop operation (also on a sandbox that is already stopping or stopped). |
| `statusUrl` | `string \| null \| null` | No | On stop, the path that reads this stop operation, for example `/api/v1/sandboxes/bx_23456789/stops/stop_0123456789abcdef`. |
| `giftLimitNotice` | `string \| null` | No | Present on resume or fork when a fair-use cap on a gifted account shortened the requested auto-stop time. |
| `conversationId` | `string \| null` | No | On interrupt, the conversation whose turn was interrupted. |

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> } | null | null
> ```

> [accordion] operation full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   status?: string | null,
>   requestedAt?: string | null | null,
>   lastAttemptAt?: string | null | null,
>   error?: string | null | null,
>   endedAt?: string | null | null,
>   forced?: boolean | null
> } | null | null
> ```

***

### unshare

`sandboxes.unshare`

Make an organization sandbox private. Make a shared organization sandbox private again, at once. Only you can then use it. Teammates still see it in their list and can stop it. Their SSH keys are removed from the running machine. Nothing on the sandbox changes: files, installs and its environment stay. Only a sandbox billed to an organization can be made private (400 otherwise).

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.unshare({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandbox` | `object \| null` | No | — |
| `message` | `string \| null` | No | — |

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> } | null
> ```

***

### update

`sandboxes.update`

Update sandbox. (PATCH /sandboxes/\{sandboxId})

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.sandboxes.update({ sandboxId: 'bx_23456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | Public Sandbox id returned by create/list/get sandbox calls. |
| `name` | `string` | No | New display name. Empty strings are rejected; longer names are truncated to 120 chars by the backend. |
| `labels` | `Record<string, string> \| null` | No | Replaces all labels of the sandbox. `{}` or `null` removes them. Same rules as `CreateSandboxRequest.labels`. |
| `ttlSeconds` | `number \| null` | No | New auto-stop TTL. The deadline becomes now + `ttlSeconds`, so calling this again extends a running sandbox's life. `null` disables auto-stop. |
| `subdomain` | `string` | No | Rename the sandbox's stable subdomain (the `<subdomain>.on.boat.dev` label). Lowercase letters, digits and hyphens; no leading/trailing/double hyphens; cannot end in `-desktop` or `-<number>` (reserved for the desktop and hosted-port URLs). Must be globally unique. The base URL, desktop URL and every live `host <port>` URL are re-pointed to the new name with no downtime and their access tokens preserved; the old URLs stop resolving. On a transient routing error the rename is saved but returns 502 `gateway_error` - retry with the same value to finish activating routes. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `sandbox` | `object \| null` | No | — |
| `giftLimitNotice` | `string \| null` | No | Present when a fair-use cap on a gifted account shortened the requested auto-stop time. |

> [accordion] sandbox full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null,
>   state?: string | null,
>   error?: string | null | null,
>   dataExpiredAt?: string | null | null,
>   stoppedAt?: string | null | null,
>   labels?: Record<string, string> | null,
>   health?: string | null,
>   healthReason?: string | null | null,
>   degradedSince?: string | null | null,
>   hydrated?: boolean | null,
>   hydratedAt?: string | null | null,
>   hydration?: {
>     phase?: string | null,
>     entriesDone?: number | null,
>     entriesTotal?: number | null | null,
>     percent?: number | null | null
>   } | null | null,
>   type?: string | null,
>   vcpu?: number | null,
>   memoryGB?: number | null,
>   billingMultiplier?: number | null,
>   machineProvider?: string | null,
>   url?: string | null | null,
>   ip?: string | null | null,
>   sshEndpoint?: string | null | null,
>   createdAt?: string | null | null,
>   updatedAt?: string | null | null,
>   archiveAfter?: string | null | null,
>   ttlSeconds?: number | null | null,
>   desktopAvailable?: boolean | null,
>   desktopUrl?: string | null | null,
>   snapshots?: boolean | null,
>   monitoring?: boolean | null,
>   network?: {
>     mode?: string | null,
>     allow?: string[] | null,
>     status?: string | null,
>     inbound?: string | null,
>     inboundAllow?: string[] | null,
>     pendingReason?: string | null,
>     apiBound?: boolean | null | null,
>     source?: string | null,
>     updatedAt?: string | null | null
>   } | null,
>   snapshotAvailable?: boolean | null,
>   snapshotCompletedAt?: string | null | null,
>   snapshotVerifiedAt?: string | null | null,
>   team?: {
>     id?: string | null,
>     name?: string | null
>   } | null | null,
>   createdBy?: string | null | null,
>   createdById?: string | null | null,
>   access?: string | null,
>   holdsCreatorLogins?: boolean | null,
>   visibility?: string | null | null,
>   cost?: {
>     since?: string | null,
>     seconds?: number | null,
>     dollars?: number | null
>   } | null,
>   wipePendingUntilRestart?: boolean | null,
>   subdomain?: string | null | null,
>   lastSnapshotAttemptAt?: string | null | null,
>   lastSnapshotStatus?: string | null | null,
>   lastReboot?: {
>     at?: string | null,
>     reason?: string | null
>   } | null | null,
>   setupStatus?: string | null | null,
>   setupError?: string | null | null,
>   environment?: string | null | null,
>   environmentVersion?: number | null | null,
>   stop?: {
>     id?: string | null,
>     status?: string | null,
>     requestedAt?: string | null | null,
>     lastAttemptAt?: string | null | null,
>     error?: string | null | null,
>     endedAt?: string | null | null,
>     forced?: boolean | null
>   } | null | null
> } | null
> ```

***

## Saved Snapshots

### delete

`savedSnapshots.delete`

Remove a saved snapshot. Remove a saved snapshot and release its storage (boat snapshot rm \<name> in the CLI). Sandboxes already deployed from it are unaffected. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.savedSnapshots.delete({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `status` | `string \| null` | No | — |

***

### get

`savedSnapshots.get`

Get a saved snapshot. (GET /saved-snapshots/\{name})

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.savedSnapshots.get({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `snapshot` | `object \| null` | No | A saved snapshot: a frozen copy of a sandbox's disk at one moment, saved under a name you pick. Independent of the source sandbox's later life: the sandbox can change, stop, or be deleted and the saved snapshot still deploys. Saved snapshots never expire; re-saving a name replaces its artifact. |

> [accordion] snapshot full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   status?: string | null,
>   error?: string | null,
>   sourceSandboxId?: string | null,
>   snapshotId?: string | null,
>   type?: string | null,
>   sizeBytes?: number | null,
>   createdAt?: string | null
> } | null
> ```

***

### list

`savedSnapshots.list`

List saved snapshots. List your saved snapshots, newest first. An unknown query parameter is refused with 400 invalid\_query, which names it.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.savedSnapshots.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `org` | `string` | No | Billing wallet for this request: an organization you belong to, by id (`team_…`) or by name as `GET /orgs` lists it (case-insensitive), or `personal`. Omitted, the account's active wallet applies (`PATCH /orgs/active`; personal until set). Two organizations sharing the name answer `409 ambiguous_org` and need the id. Sandboxes and snapshots stay creator-private. On `/environments` routes, only this query parameter selects the organization's shared environments; the `X-Boat-Org` header and the active wallet do not apply there. Members read them, owners and admins change them. |
| `name` | `string` | No | Keep the saved snapshot with exactly this name. |
| `namePrefix` | `string` | No | Keep saved snapshots whose name starts with this text, for example `ci-`. The match is literal. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `snapshots` | `object[] \| null` | No | — |
| `allowance` | `object \| null` | No | What the request's wallet (your active organization, `?org=`, or personal) pays for saved snapshots. The plan includes some; each one above costs \$0.056 a day from the wallet. An organization's count includes every member's names billed to it. |

> [accordion] snapshots full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   status?: string | null,
>   error?: string | null,
>   sourceSandboxId?: string | null,
>   snapshotId?: string | null,
>   type?: string | null,
>   sizeBytes?: number | null,
>   createdAt?: string | null
> }[] | null
> ```

> [accordion] allowance full type
>
> ```ts theme={null}
> {
>   org?: string | null | null,
>   orgName?: string | null | null,
>   included?: number | null,
>   free?: number | null,
>   used?: number | null,
>   extra?: number | null,
>   extraMonthlyDollars?: number | null,
>   extraDailyDollars?: number | null,
>   pricePerExtraMonthlyDollars?: number | null,
>   pricePerExtraDailyDollars?: number | null
> } | null
> ```

***

### save

`savedSnapshots.save`

Save a saved snapshot. Freeze a sandbox's current state under a name (boat snapshot \<id> \<name> in the CLI). Answers 202 immediately with the snapshot in saving; a running sandbox takes a fresh capture first, which can run minutes. Poll GET /saved-snapshots/\{name} until the status settles at ready or failed. Snapshots past the plan allowance bill monthly. The free trial refuses it: 403 (live 11-28).

**Risk:** `destructive`

```ts theme={null}
await corsair.boat.api.savedSnapshots.save({ sandboxId: 'bx_23456789', name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sandboxId` | `string` | Yes | The sandbox whose current state to freeze. |
| `name` | `string` | Yes | Name to save under. 1-63 lowercase letters, digits, or dashes, starting with a letter or digit. Reusing one of your existing names replaces that snapshot's artifact. `latest`, `tree`, `pull`, `rm`, `save`, `current`, `self`, and `new` are reserved. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `status` | `string \| null` | No | — |
| `snapshot` | `object \| null` | No | A saved snapshot: a frozen copy of a sandbox's disk at one moment, saved under a name you pick. Independent of the source sandbox's later life: the sandbox can change, stop, or be deleted and the saved snapshot still deploys. Saved snapshots never expire; re-saving a name replaces its artifact. |

> [accordion] snapshot full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   status?: string | null,
>   error?: string | null,
>   sourceSandboxId?: string | null,
>   snapshotId?: string | null,
>   type?: string | null,
>   sizeBytes?: number | null,
>   createdAt?: string | null
> } | null
> ```

***

### shares.create

`savedSnapshots.shares.create`

Share a saved snapshot. Make a secret code that lets any Boat account create a sandbox from this saved snapshot (boat snapshot share \<name> in the CLI). The response shows the code once; Boat stores only a hash. Re-saving the name changes what the code deploys. Removing the name removes its codes. Mints a share code anyone with it can use to start a sandbox from the snapshot.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.savedSnapshots.shares.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `name` | `string \| null` | No | The named snapshot the code deploys. |
| `shareCode` | `string \| null` | No | The share code, for example `bsh_...`. Boat shows it only in this response. Store it now; you cannot get it again. |
| `share` | `object \| null` | No | A share code for a named snapshot. Any Boat account that holds the code can create a sandbox from the snapshot. Boat stores only a hash of the code. The full code is in the create response only. |

> [accordion] share full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   codePrefix?: string | null,
>   status?: string | null,
>   useCount?: number | null,
>   lastUsedAt?: string | null | null,
>   revokedAt?: string | null | null,
>   createdAt?: string | null
> } | null
> ```

***

### shares.list

`savedSnapshots.shares.list`

List share codes of a saved snapshot. List the share codes of a saved snapshot, active and revoked (boat snapshot shares \<name> in the CLI). The full codes are not returned. Needs snapshot.read.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.savedSnapshots.shares.list({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `shares` | `object[] \| null` | No | — |

> [accordion] shares full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   codePrefix?: string | null,
>   status?: string | null,
>   useCount?: number | null,
>   lastUsedAt?: string | null | null,
>   revokedAt?: string | null | null,
>   createdAt?: string | null
> }[] | null
> ```

***

### shares.revoke

`savedSnapshots.shares.revoke`

Revoke a share code. Revoke a share code (boat snapshot unshare \<name> \<share-id> in the CLI). The code stops creating new sandboxes. Sandboxes already created from it keep their own copy. Needs snapshot.write. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.savedSnapshots.shares.revoke({ name: 'example', shareId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `shareId` | `string` | Yes | Share id, for example `shr_...`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `name` | `string \| null` | No | — |
| `share` | `object \| null` | No | A share code for a named snapshot. Any Boat account that holds the code can create a sandbox from the snapshot. Boat stores only a hash of the code. The full code is in the create response only. |

> [accordion] share full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   codePrefix?: string | null,
>   status?: string | null,
>   useCount?: number | null,
>   lastUsedAt?: string | null | null,
>   revokedAt?: string | null | null,
>   createdAt?: string | null
> } | null
> ```

***

## Secrets

### get

`secrets.get`

Get Boat secrets setup. Returns the environment variables and secret files configured for sandboxes. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.secrets.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `subenvironmentId` | `string \| null` | No | Id of the default environment. `environmentId` is the id of its latest version. |
| `envContents` | `string \| null` | No | — |
| `secretFiles` | `object[] \| null` | No | — |
| `pushed` | `object \| null` | No | Present on update; counts how many active sandboxes received the new environment. |

> [accordion] secretFiles full type
>
> ```ts theme={null}
> {
>   path?: string | null,
>   contents?: string | null
> }[] | null
> ```

> [accordion] pushed full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### update

`secrets.update`

Update Boat secrets setup. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.secrets.update({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `envContents` | `string` | No | Full .env-style content to sync into sandboxes. Send the complete desired file contents, not a patch. |
| `secretFiles` | `object[]` | No | Full list of secret files to keep configured. Send existing files again if they should remain. |

> [accordion] secretFiles full type
>
> ```ts theme={null}
> {
>   path: string,
>   contents: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `success` | `boolean \| null` | No | — |
| `environmentId` | `string \| null` | No | — |
| `subenvironmentId` | `string \| null` | No | Id of the default environment. `environmentId` is the id of its latest version. |
| `envContents` | `string \| null` | No | — |
| `secretFiles` | `object[] \| null` | No | — |
| `pushed` | `object \| null` | No | Present on update; counts how many active sandboxes received the new environment. |

> [accordion] secretFiles full type
>
> ```ts theme={null}
> {
>   path?: string | null,
>   contents?: string | null
> }[] | null
> ```

> [accordion] pushed full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

## Snapshots

### delete

`snapshots.delete`

Permanently delete snapshot data. Accept irreversible deletion of an unpinned snapshot owned by the authenticated account. Any such snapshot is accepted: it disappears from lists, restores and forks immediately, and its stored data is purged in the background once nothing still reads it (see the operation's stage). Pass the snapshotId again as confirm. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.snapshots.delete({ snapshotId: 'snap_0123456789', confirm: 'snap_0123456789' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `snapshotId` | `string` | Yes | Snapshot id returned by the snapshot list/latest calls. |
| `confirm` | `string` | Yes | Must exactly equal the target `sandboxId` or `snapshotId`. A missing or mismatched value returns `409` without accepting deletion. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `operation` | `object \| null` | No | — |

> [accordion] operation full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   kind?: string | null,
>   targetId?: string | null,
>   reason?: string | null,
>   status?: string | null,
>   stage?: string | null,
>   expectedBy?: string | null | null,
>   attemptCount?: number | null,
>   requestedAt?: string | null,
>   completedAt?: string | null | null
> } | null
> ```

***

### getDownload

`snapshots.getDownload`

Get snapshot download. Return time-limited signed URLs for every chunk needed to reconstruct the sandbox filesystem at this snapshot (the full chain, base through this generation), plus the inventory. Download the chunks and reassemble them as described by reconstruct.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.snapshots.getDownload({ snapshotId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `snapshotId` | `string` | Yes | Snapshot id returned by the snapshot list/latest calls. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `snapshotId` | `string \| null` | No | — |
| `sandboxId` | `string \| null` | No | — |
| `kind` | `string \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `expiresInSeconds` | `number \| null` | No | Lifetime of every `signedUrl` in this response. |
| `reconstruct` | `string \| null` | No | Human-readable note on how to reassemble the chunks into a filesystem. |
| `inventory` | `object \| null` | No | — |
| `chunks` | `object[] \| null` | No | Every chunk across the chain (all generations up to and including this snapshot), ordered by `(generation, chunkIndex)`. |

> [accordion] inventory full type
>
> ```ts theme={null}
> {
>   r2Key?: string | null,
>   signedUrl?: string | null
> } | null | null
> ```

> [accordion] chunks full type
>
> ```ts theme={null}
> {
>   snapshotId?: string | null,
>   generation?: number | null,
>   chunkIndex?: number | null,
>   r2Key?: string | null,
>   sizeBytes?: number | null | null,
>   sha256?: string | null | null,
>   signedUrl?: string | null
> }[] | null
> ```

***

### getFile

`snapshots.getFile`

Download a file or folder from a snapshot. Stream a single file's bytes, or a folder subtree as a tar archive, directly out of a snapshot, the sandbox can be stopped or archived; the machine is never contacted. Use GET /snapshots/\{snapshotId}/tree to list paths, then pass one here.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.snapshots.getFile({ snapshotId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `snapshotId` | `string` | Yes | Snapshot id returned by the snapshot list/latest calls. |
| `path` | `string` | No | File or folder path inside the snapshot. Empty for the whole snapshot. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentBase64` | `string` | No | The file, base64-encoded. Missing when the file came back as text or contentOmitted is set. |
| `text` | `string` | No | The file as text, in place of contentBase64, when it is a text file (CSV, JSON, Markdown, XML and the like) in UTF-8. |
| `contentType` | `string` | Yes | Media type of the file, for example application/pdf. |
| `byteLength` | `number` | Yes | Size of the file in bytes. |
| `filename` | `string` | No | The file name, when known. |
| `contentOmitted` | `not_requested \| over_limit` | No | Set when the content was left out: the caller did not ask for it, or the file was over the limit. |
| `fileId` | `string` | No | Where the host saved the file. Over the limit it comes in place of the content; a host that keeps every file sets it beside the content too. On Corsair it is a Files id (fil\_…): pass it to another app wherever that app takes a file URL, or read a text file or PDF with files.read\_text. |

***

### getTree

`snapshots.getTree`

Get snapshot file tree. List the files and folders captured in a snapshot, with sizes. Returns a flat list of entries you can render as a tree.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.snapshots.getTree({ snapshotId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `snapshotId` | `string` | Yes | Snapshot id returned by the snapshot list/latest calls. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `snapshotId` | `string \| null` | No | — |
| `sandboxId` | `string \| null` | No | — |
| `generation` | `number \| null` | No | — |
| `treeAvailable` | `boolean \| null` | No | `false` for legacy snapshots or inventories too large to expand; see `reason`. |
| `truncated` | `boolean \| null` | No | `true` when the file list was capped; not every entry is returned. |
| `fileCount` | `number \| null` | No | Number of your files in this snapshot (base-image system files excluded). |
| `totalSizeBytes` | `number \| null` | No | Total bytes of your data in this snapshot (base-image system files excluded). |
| `entries` | `object[] \| null` | No | Exactly the files/dirs a resume or download returns, your data only; base-image system entries are not listed. |
| `reason` | `string \| null` | No | Why the tree is unavailable, when `treeAvailable` is `false`. |

> [accordion] entries full type
>
> ```ts theme={null}
> {
>   path?: string | null,
>   kind?: string | null,
>   size?: number | null
> }[] | null
> ```

***

### list

`snapshots.list`

List snapshots. List visible completed snapshots across all of your sandboxes using immutable ownership attribution. Pinned, deletion-scheduled, and privacy-fenced sandbox snapshots are omitted. Follow nextCursor through the complete history; there is no hidden 500-snapshot cap.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.snapshots.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Maximum items to return. |
| `cursor` | `string \| null` | No | Opaque pagination cursor returned as `pageInfo.nextCursor`. |
| `sort` | `asc \| desc` | No | Sort direction for cursor pagination. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string & string \| null` | No | — |
| `snapshots` | `object[] \| null` | No | — |
| `pageInfo` | `object \| null` | No | — |

> [accordion] snapshots full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   sandboxId?: string | null,
>   status?: string | null,
>   kind?: string | null | null,
>   generation?: number | null | null,
>   chainId?: string | null | null,
>   createdAt?: string | null,
>   completedAt?: string | null | null,
>   sizeBytes?: number | null | null,
>   fileCount?: number | null | null,
>   contentSizeBytes?: number | null | null,
>   contentFileCount?: number | null | null,
>   origin?: string | null
> }[] | null
> ```

> [accordion] pageInfo full type
>
> ```ts theme={null}
> {
>   nextCursor?: string | null | null,
>   hasMore?: boolean | null,
>   limit?: number | null
> } | null
> ```

***

## Telemetry

### delete

`telemetry.delete`

Remove OpenTelemetry export. Removes the export and its queued deliveries. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.telemetry.delete({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `telemetry` | `object \| null` | No | — |

> [accordion] telemetry full type
>
> ```ts theme={null}
> {
>   endpoint?: string | null,
>   headers?: string[] | null,
>   lastExportAt?: string | null | null,
>   lastError?: {
>     message?: string | null,
>     status?: number | null | null,
>     at?: string | null
>   } | null | null,
>   createdAt?: string | null
> } | null | null
> ```

***

### get

`telemetry.get`

Get OpenTelemetry export. Returns the account's OpenTelemetry export, or telemetry null when none is set. Header values are never included. Needs an API key with account.admin. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.telemetry.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `telemetry` | `object \| null` | No | — |

> [accordion] telemetry full type
>
> ```ts theme={null}
> {
>   endpoint?: string | null,
>   headers?: string[] | null,
>   lastExportAt?: string | null | null,
>   lastError?: {
>     message?: string | null,
>     status?: number | null | null,
>     at?: string | null
>   } | null | null,
>   createdAt?: string | null
> } | null | null
> ```

***

### set

`telemetry.set`

Set OpenTelemetry export. Sets the account's one OTLP/HTTP destination, or replaces it. Boat then sends one metrics export at once and returns the collector's answer in test. Every 60 seconds Boat sends the sandbox and account gauges to \<endpoint>/v1/metrics. Each sandbox lifecycle event goes to \<endpoint>/v1/logs. Boat resolves the endpoint host when it is set: a name that does not resolve answers 400. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.telemetry.set({ endpoint: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `endpoint` | `string` | Yes | HTTPS URL on port 443 or 4318. Boat removes a trailing `/v1/metrics` or `/v1/logs`. |
| `headers` | `Record<string, string>` | No | Headers sent with every export, for example the vendor API key. Boat encrypts them at rest. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `telemetry` | `object \| null` | No | — |
| `test` | `object \| null` | No | — |

> [accordion] telemetry full type
>
> ```ts theme={null}
> {
>   endpoint?: string | null,
>   headers?: string[] | null,
>   lastExportAt?: string | null | null,
>   lastError?: {
>     message?: string | null,
>     status?: number | null | null,
>     at?: string | null
>   } | null | null,
>   createdAt?: string | null
> } | null | null
> ```

> [accordion] test full type
>
> ```ts theme={null}
> {
>   ok?: boolean | null,
>   status?: number | null | null,
>   message?: string | null | null
> } | null
> ```

***

## Webhooks

### create

`webhooks.create`

Create webhook. Registers an account-wide endpoint for sandbox lifecycle events. The endpoint must use HTTPS on port 443 and resolve only to public addresses. Redirects are not followed during delivery. The signing secret is returned only in this response. An account can register at most 10 unique endpoint URLs. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.webhooks.create({
	name: 'production',
	url: 'https://example.com/hooks/boat',
	events: ['sandbox.ready', 'sandbox.archived'],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string \| null` | No | — |
| `url` | `string` | Yes | — |
| `events` | `(sandbox.ready \| sandbox.error \| sandbox.archived \| sandbox.hydrated \| sandbox.degraded \| sandbox.recovered)[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `webhook` | `object \| null` | No | — |
| `secret` | `string \| null` | No | Signing secret returned only when created or rotated. |

> [accordion] webhook full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null | null,
>   url?: string | null,
>   events?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null
> ```

***

### delete

`webhooks.delete`

Delete webhook. Deletes the endpoint and its queued deliveries. An attempt already in flight can still arrive. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.webhooks.delete({ webhookId: 'wh_0123456789abcdef01234567' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhookId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `id` | `string \| null` | No | — |

***

### get

`webhooks.get`

Get webhook. Returns webhook metadata without the signing secret. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.webhooks.get({ webhookId: 'wh_0123456789abcdef01234567' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhookId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `webhook` | `object \| null` | No | — |

> [accordion] webhook full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null | null,
>   url?: string | null,
>   events?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null
> ```

***

### list

`webhooks.list`

List webhooks. Lists account-wide sandbox lifecycle webhook endpoints. Signing secrets are never included. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `read`

```ts theme={null}
await corsair.boat.api.webhooks.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `webhooks` | `object[] \| null` | No | — |

> [accordion] webhooks full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null | null,
>   url?: string | null,
>   events?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> }[] | null
> ```

***

### rotateSecret

`webhooks.rotateSecret`

Rotate webhook signing secret. Replaces the endpoint's signing secret. The new secret is returned only in this response; briefly accept the old secret for attempts already in flight. The old signing secret stops working. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.boat.api.webhooks.rotateSecret({ webhookId: 'wh_0123456789abcdef01234567' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhookId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `webhook` | `object \| null` | No | — |
| `secret` | `string \| null` | No | Signing secret returned only when created or rotated. |

> [accordion] webhook full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null | null,
>   url?: string | null,
>   events?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null
> ```

***

### update

`webhooks.update`

Update webhook. Updates the name, endpoint URL, or subscribed events without changing the signing secret. An organization API key gets 403 api\_key\_org\_forbidden here (live 11-28): it needs a personal account key.

**Risk:** `write`

```ts theme={null}
await corsair.boat.api.webhooks.update({ webhookId: 'wh_0123456789abcdef01234567' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhookId` | `string` | Yes | — |
| `name` | `string \| null` | No | — |
| `url` | `string` | No | — |
| `events` | `(sandbox.ready \| sandbox.error \| sandbox.archived \| sandbox.hydrated \| sandbox.degraded \| sandbox.recovered)[]` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `ok` | `boolean \| null` | No | — |
| `type` | `string \| null` | No | Stable success envelope discriminator added by v1. |
| `webhook` | `object \| null` | No | — |

> [accordion] webhook full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   name?: string | null | null,
>   url?: string | null,
>   events?: string[] | null,
>   createdAt?: string | null,
>   updatedAt?: string | null
> } | null
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.