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

# Create a remote browser session

> Creates a remote tf-browser session and returns CDP connection details. Optionally accepts a target URL to select the best proxy for that domain. Connect to the browser via CDP WebSocket at `cdp_url`.

Use `timeout_seconds` to set a custom inactivity timeout (5–86400 seconds). If omitted, null, or greater than your plan maximum, the plan maximum is used (15 min on free tier, 60 min on paid).



## OpenAPI

````yaml https://agent.tinyfish.ai/v1/openapi/browser post /
openapi: 3.0.0
info:
  title: TinyFish Browser API
  version: 1.0.0
  description: Create remote browser sessions for direct Playwright/CDP control.
  contact:
    name: TinyFish Support
    email: support@tinyfish.ai
servers:
  - url: https://api.browser.tinyfish.ai
security: []
paths:
  /:
    post:
      summary: Create a remote browser session
      description: >-
        Creates a remote tf-browser session and returns CDP connection details.
        Optionally accepts a target URL to select the best proxy for that
        domain. Connect to the browser via CDP WebSocket at `cdp_url`.


        Use `timeout_seconds` to set a custom inactivity timeout (5–86400
        seconds). If omitted, null, or greater than your plan maximum, the plan
        maximum is used (15 min on free tier, 60 min on paid).
      operationId: createBrowserSession
      requestBody:
        description: Browser session parameters
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: >-
                    Target URL the browser session will navigate to on startup.
                    Bare domains (e.g. tinyfish.ai) are automatically prefixed
                    with https://. If omitted, the browser starts at
                    about:blank.
                  example: https://www.tinyfish.ai
                timeout_seconds:
                  type: integer
                  nullable: true
                  minimum: 5
                  maximum: 86400
                  description: >-
                    Inactivity timeout in seconds (5–86400). If omitted, null,
                    or greater than your plan maximum, the plan maximum is used.
                  example: 300
              description: Browser session creation parameters
      responses:
        '201':
          description: Browser session created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_id:
                    type: string
                    minLength: 1
                    description: Unique identifier for this browser session.
                    example: br-a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  cdp_url:
                    type: string
                    format: uri
                    description: >-
                      WebSocket URL for browser connection. Pass this to
                      Playwright's connect_over_cdp or any WebSocket-based CDP
                      client.
                    example: wss://browser.example.tinyfish.io/session/cdp
                  base_url:
                    type: string
                    format: uri
                    description: >-
                      HTTPS base URL for the session. Use to access session
                      endpoints such as /pages.
                    example: https://browser.example.tinyfish.io/session
                required:
                  - session_id
                  - cdp_url
                  - base_url
                description: >-
                  Browser session created successfully. Connect to the browser
                  via cdp_url.
              example:
                session_id: tf-a1b2c3d4-e5f6-7890-abcd-ef1234567890
                cdp_url: wss://tetra-abc123.cluster.unikraft.cloud/cdp
                base_url: https://tetra-abc123.cluster.unikraft.cloud
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                required:
                  - error
                description: Standard error response format
        '402':
          description: Forbidden - Insufficient credits or no active subscription
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                required:
                  - error
                description: Standard error response format
        '404':
          description: Browser API is not available
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                required:
                  - error
                description: Standard error response format
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                required:
                  - error
                description: Standard error response format
        '502':
          description: Browser session creation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                required:
                  - error
                description: Standard error response format
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication. Get your key from the API Keys page.

````