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

# Restart My Box

> Restart a box without destroying it.

The escape hatch from ERROR — before this endpoint, a box with a
stale heartbeat (CPU spike / OOM / agent crash) could only be
destroyed by the user, which loses the EBS volume and forces a
fresh setup. Now the user can:

  - mode=service (default): SSM `systemctl restart bux-tg`. ~5s.
    Fixes most cases (agent process crash, wedged long-poll).
  - mode=reboot: AWS rebootInstances. ~30-60s. Public IP and EBS
    preserved (only resize/upgrade changes the IP). Fallback for
    kernel-hung / SSM-unreachable boxes.

Allowed when status is READY or ERROR. PROVISIONING / RESIZING /
AWAITING_OAUTH / DESTROYED → 409 (no instance to restart, or a
long-running operation is already in flight).

Returns the box view; status is unchanged here. The next bux_health
tick + box-agent heartbeat is what authoritatively flips ERROR →
READY when the agent comes back up. The FE polls /me to watch.



## OpenAPI

````yaml /cloud/openapi/v3.json post /boxes/me/restart
openapi: 3.1.0
info:
  title: Browser Use Public API v3
  summary: Browser Use session-based agent API (v3)
  version: 3.0.0
servers:
  - url: https://api.browser-use.com/api/v3
    description: Production server
security: []
paths:
  /boxes/me/restart:
    post:
      tags:
        - Boxes
      summary: Restart My Box
      description: |-
        Restart a box without destroying it.

        The escape hatch from ERROR — before this endpoint, a box with a
        stale heartbeat (CPU spike / OOM / agent crash) could only be
        destroyed by the user, which loses the EBS volume and forces a
        fresh setup. Now the user can:

          - mode=service (default): SSM `systemctl restart bux-tg`. ~5s.
            Fixes most cases (agent process crash, wedged long-poll).
          - mode=reboot: AWS rebootInstances. ~30-60s. Public IP and EBS
            preserved (only resize/upgrade changes the IP). Fallback for
            kernel-hung / SSM-unreachable boxes.

        Allowed when status is READY or ERROR. PROVISIONING / RESIZING /
        AWAITING_OAUTH / DESTROYED → 409 (no instance to restart, or a
        long-running operation is already in flight).

        Returns the box view; status is unchanged here. The next bux_health
        tick + box-agent heartbeat is what authoritatively flips ERROR →
        READY when the agent comes back up. The FE polls /me to watch.
      operationId: restart_my_box_boxes_me_restart_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BoxRestartRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoxView'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    BoxRestartRequest:
      properties:
        mode:
          $ref: '#/components/schemas/BoxRestartMode'
          default: service
      type: object
      title: BoxRestartRequest
    BoxView:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        profile_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Profile Id
        size:
          type: string
          enum:
            - small
            - medium
            - large
          title: Size
        size_spec:
          $ref: '#/components/schemas/BoxSizeSpecView'
        ec2_instance_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Ec2 Instance Id
        public_ip:
          anyOf:
            - type: string
            - type: 'null'
          title: Public Ip
        status:
          $ref: '#/components/schemas/BoxStatus'
        status_detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Detail
        claude_authed:
          type: boolean
          title: Claude Authed
        tg_installed:
          type: boolean
          title: Tg Installed
        tg_bot_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Tg Bot Username
        dsp_enabled:
          type: boolean
          title: Dsp Enabled
        live_browser_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Live Browser Url
        last_heartbeat_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Heartbeat At
        trial_ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Ends At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - project_id
        - profile_id
        - size
        - size_spec
        - ec2_instance_id
        - public_ip
        - status
        - status_detail
        - claude_authed
        - tg_installed
        - tg_bot_username
        - dsp_enabled
        - live_browser_url
        - last_heartbeat_at
        - created_at
        - updated_at
      title: BoxView
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BoxRestartMode:
      type: string
      enum:
        - service
        - reboot
      title: BoxRestartMode
      description: |-
        How aggressive a /me/restart should be.

        `service` — fastest, fixes ~95% of cases (agent process crash, OOM,
          wedged TG long-poll). SSM `systemctl restart bux-tg`. ~5s.
        `reboot`  — fallback for kernel-hung / SSM-unreachable boxes. AWS
          rebootInstances. ~30-60s. IP + EBS preserved.
    BoxSizeSpecView:
      properties:
        name:
          type: string
          enum:
            - small
            - medium
            - large
          title: Name
        vcpu:
          type: integer
          title: Vcpu
        ram_gb:
          type: integer
          title: Ram Gb
        disk_gb:
          type: integer
          title: Disk Gb
        daily_usd:
          type: number
          title: Daily Usd
        min_balance_usd:
          type: number
          title: Min Balance Usd
      type: object
      required:
        - name
        - vcpu
        - ram_gb
        - disk_gb
        - daily_usd
        - min_balance_usd
      title: BoxSizeSpecView
      description: |-
        User-visible spec sheet for one size tier. Returned alongside
        BoxView so the UI can render the tooltip ("2 vCPU · 4 GB · 20 GB")
        without a second round trip + so the picker on /bux can show all
        three rows without us hardcoding prices in the frontend.
    BoxStatus:
      type: string
      enum:
        - provisioning
        - awaiting_oauth
        - ready
        - resizing
        - error
        - halted
        - destroyed
      title: BoxStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Browser-Use-API-Key

````