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

# Turn the AI credentials proxy on or off

> Give sandboxes placeholder keys instead of real keys, or stop.



## OpenAPI

````yaml openapi/boat-v1.yaml PUT /ai-proxy
openapi: 3.1.0
info:
  title: Boat Public API v1
  version: 1.0.0
  description: >
    Public JSON API for creating, operating, prompting, observing, and exposing
    sandboxes from backend services, CI jobs, hosted workers, and Boat
    automation products.


    The v1 reference intentionally documents the developer integration surface
    only. Dashboard billing actions are not part of v1.
servers:
  - url: https://boat.dev/api/v1
security:
  - BoatBearerAuth: []
tags:
  - name: Boat
    description: >-
      Unified Boat account, setup, lifecycle, prompting, event history, desktop
      access, and SSH operations.
paths:
  /ai-proxy:
    put:
      tags:
        - Boat
      summary: Turn the AI credentials proxy on or off
      description: >
        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. While on, the account pays
        $1 of Boat time for each UTC day, plus $1 per 1,000 proxied requests,
        charged to the wallet each sandbox bills. For an organization, only its
        owner can change the switch. Needs an API key with `account.admin`.
      operationId: updateAiProxy
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/OrgHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAiProxyRequest'
      responses:
        '200':
          description: The new state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiProxySettings'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    OrgId:
      name: org
      in: query
      required: false
      schema:
        type: string
      description: >-
        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.
    OrgHeader:
      name: X-Boat-Org
      in: header
      required: false
      schema:
        type: string
      description: Same as the `org` query parameter. Query wins when both are set.
  schemas:
    UpdateAiProxyRequest:
      type: object
      required:
        - enabled
      properties:
        enabled:
          type: boolean
    AiProxySettings:
      allOf:
        - $ref: '#/components/schemas/SuccessBase'
        - type: object
          required:
            - success
            - accountId
            - org
            - enabled
            - enabledAt
            - pricing
            - proxyUrl
          properties:
            success:
              type: boolean
            accountId:
              type: string
              description: The account the switch belongs to, a person or an organization.
            org:
              type: boolean
              description: True when `accountId` is an organization.
            enabled:
              type: boolean
            enabledAt:
              type:
                - string
                - 'null'
              format: date-time
            pricing:
              type: object
              required:
                - dailyDollars
                - dollarsPer1000Requests
              properties:
                dailyDollars:
                  type: number
                  examples:
                    - 1
                  description: Charged to the account for each UTC day the proxy is on.
                dollarsPer1000Requests:
                  type: number
                  examples:
                    - 1
                  description: Charged per 1,000 proxied requests.
            proxyUrl:
              type: string
              format: uri
              description: The base URL sandboxes call instead of the providers.
    SuccessBase:
      type: object
      required:
        - ok
        - type
      properties:
        ok:
          type: boolean
          examples:
            - true
        type:
          type: string
          description: Stable success envelope discriminator added by v1.
    ErrorEnvelope:
      type: object
      required:
        - ok
        - type
        - status
        - code
        - message
        - error
        - requestId
      properties:
        ok:
          type: boolean
          examples:
            - false
        type:
          type: string
          examples:
            - sandbox.error
        status:
          type: integer
          examples:
            - 409
        code:
          type: string
          examples:
            - provider_not_configured
        message:
          type: string
          examples:
            - Prompting is locked until Codex is configured on the Agents page.
        requestId:
          type: string
          examples:
            - req_01HX...
        error:
          type: object
          required:
            - code
            - message
            - status
          properties:
            code:
              type: string
            message:
              type: string
            status:
              type: integer
            details:
              type: object
              additionalProperties: true
  responses:
    BadRequest:
      description: Invalid request body or parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            invalid:
              value:
                ok: false
                type: sandbox.error
                status: 400
                code: invalid_json
                message: Request body must be valid JSON.
                error:
                  code: invalid_json
                  message: Request body must be valid JSON.
                  status: 400
                requestId: req_01HX...
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            unauthorized:
              value:
                ok: false
                type: sandbox.error
                status: 401
                code: unauthorized
                message: Unauthorized
                error:
                  code: unauthorized
                  message: Unauthorized
                  status: 401
                requestId: req_01HX...
    Forbidden:
      description: Authenticated token is not allowed to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            forbidden:
              value:
                ok: false
                type: sandbox.error
                status: 403
                code: forbidden
                message: Forbidden
                error:
                  code: forbidden
                  message: Forbidden
                  status: 403
                requestId: req_01HX...
  securitySchemes:
    BoatBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sandbox_api_key
      description: >-
        Boat bearer token in the form `boat_...`. Service API keys authenticate
        sandbox operations.

````

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