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

> ## Agent Instructions
> Authenticate REST, SDK, and CLI requests with the `x-api-key` header using the `HYPERBROWSER_API_KEY` environment variable (create keys at https://app.hyperbrowser.ai).
> Always stop browser sessions (`sessions.stop(id)` / `PUT /api/session/{id}/stop`) and sandboxes (`sandboxes.stop(id)` / `PUT /api/sandbox/{id}/stop`) in `try`/`finally` blocks to avoid idle billing.
> Choose the right surface: use Web API (`/api/web/fetch`, `batch-fetch`, `crawl`, `search`) for stateless reading and extraction (prefer it over legacy `/api/scrape`); Browser Sessions (`/api/session`) for interactive, authenticated, or Playwright/Puppeteer workflows; Cloud Agents (`/api/task/*`) for autonomous browser tasks; and Sandboxes (`/api/sandbox`) for isolated Linux or macOS code execution.
> Use `@hyperbrowser/sdk` for Node.js/TypeScript, `hyperbrowser` 1.0+ typed-dict request params for Python (avoid legacy Pydantic request classes), the unified `hx` CLI for terminal workflows, and hosted OAuth MCP at `https://mcp.hyperbrowser.ai/mcp/web` (web tools; use `https://mcp.hyperbrowser.ai/mcp` only when browser, sandbox, admin, and usage tools are needed).

# Extend a session

> Extend the timeout of an active browser session by 1–1440 minutes. Requires scope `browser.sessions.update`. See [Runtime Updates & Extensions](/sessions/runtime-updates).



## OpenAPI

````yaml openapi.json PUT /api/session/{id}/extend-session
openapi: 3.0.1
info:
  title: Hyperbrowser API
  version: 1.0.0
servers:
  - url: https://api.hyperbrowser.ai
    description: Production server
security: []
tags:
  - name: Sessions
    description: Create, control, update, snapshot, and observe cloud browser sessions.
  - name: WebMCP
    description: Discover and invoke page-provided WebMCP tools inside a browser session.
  - name: Profiles
    description: >-
      Persist and reuse browser cookies, storage, and auth state across
      sessions.
  - name: Extensions
    description: Upload and manage Chrome extensions loaded into browser sessions.
  - name: Static IPs
    description: Manage dedicated static IP addresses for browser sessions.
  - name: Web API
    description: High-speed web fetch, batch fetch, crawl, and search endpoints.
  - name: Legacy Scraping
    description: Maintained legacy scrape, batch scrape, crawl, and extract endpoints.
  - name: Cloud Agents
    description: Managed autonomous browser agent tasks.
  - name: Sandboxes
    description: ''
  - name: Volumes
    description: Persistent shared volumes mounted across sandboxes.
  - name: Persistent Disks
    description: Persistent writable and snapshot disks for macOS sandboxes.
  - name: Images & Builds
    description: Build, reuse, list, and delete custom sandbox images.
  - name: Snapshots
    description: Manage Hyperbrowser memory snapshots for sub-second sandbox boots.
  - name: Secrets
    description: >-
      Create and version encrypted secrets for sandboxes and browser credential
      fill.
  - name: Vaults
    description: Group related secrets into reusable vaults.
  - name: Platform & Billing
    description: Inspect team credits and per-job credit/token usage.
  - name: X402
    description: Pay-per-request HTTP 402 endpoints for sessions, fetch, and search.
paths:
  /api/session/{id}/extend-session:
    put:
      tags:
        - Sessions
      summary: Extend a running session
      description: >-
        Extend the timeout of an active browser session by 1–1440 minutes.
        Requires scope `browser.sessions.update`. See [Runtime Updates &
        Extensions](/sessions/runtime-updates).
      parameters:
        - name: id
          in: path
          required: true
          description: Session UUID
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtendSessionParams'
      responses:
        '200':
          description: Session extended
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: typescript
          label: Node.js
          source: |-
            import { Hyperbrowser } from "@hyperbrowser/sdk";

            const client = new Hyperbrowser({ apiKey: "your-api-key" });

            await client.sessions.extendSession("session-id", 30);
        - lang: python
          label: Python
          source: |-
            from hyperbrowser import Hyperbrowser

            client = Hyperbrowser(api_key="your-api-key")

            client.sessions.extend_session("session-id", 30)
        - lang: bash
          label: cURL
          source: >-
            curl -X PUT
            "https://api.hyperbrowser.ai/api/session/<id>/extend-session" \
              -H "x-api-key: $HYPERBROWSER_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{"durationMinutes": 30}'
components:
  schemas:
    ExtendSessionParams:
      type: object
      required:
        - durationMinutes
      properties:
        durationMinutes:
          type: integer
          minimum: 1
          maximum: 1440
          description: Number of minutes to extend the running session (1–1440).
    BasicResponse:
      type: object
      properties:
        success:
          type: boolean
      required:
        - success
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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