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

# Start Browse

> **WebRouter is in closed beta.** It's available to selected accounts, and the API may still change. To get access, [talk to the Nimble team](https://nimbleway.com/contact-general/).

Start a browse task: a provider's agent drives a real browser, clicking, typing and reading through pages until the task is done, which usually takes minutes and is billed. Worth it for what needs a browser, such as filling in a form or working through a site's own search; to read a page you have the URL of, use `POST /v2/web-router/extract`. Answers at once with a `job_id`: call `GET /v2/web-router/browse/{job_id}` with the id until `state` is 'completed', 'failed' or 'cancelled', or `POST /v2/web-router/browse/{job_id}/cancel` to stop the task. Every call starts, and pays for, a new task: poll the one you have rather than starting it again, and if a start fails with an error saying a task may have started (`may_have_started`), start no other but tell the user. Nimble picks the provider, your own keys first, and tries no other once one may have started a task. Answers `{meta, job}`: what the task was started with, and its `job_id`, `provider` and `state`.



## OpenAPI

````yaml /api-reference/web-router-openapi.json post /v2/web-router/browse
openapi: 3.1.0
info:
  title: WebRouter API
  version: 1.0.0
  description: >-
    Closed beta. One API to search, extract, research and browse the web, on
    Nimble or any provider your account may use. `route` picks the tool and
    provider for a query and runs it in one call. Search and extract answer
    within the call. Research and browse are jobs: start one, then poll it by
    `job_id` until `state` is `completed`, `failed` or `cancelled`. Authenticate
    with `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://sdk.nimbleway.com
security: []
paths:
  /v2/web-router/browse:
    post:
      tags:
        - WebRouter
      summary: Start Browse
      description: >-
        **WebRouter is in closed beta.** It's available to selected accounts,
        and the API may still change. To get access, [talk to the Nimble
        team](https://nimbleway.com/contact-general/).


        Start a browse task: a provider's agent drives a real browser, clicking,
        typing and reading through pages until the task is done, which usually
        takes minutes and is billed. Worth it for what needs a browser, such as
        filling in a form or working through a site's own search; to read a page
        you have the URL of, use `POST /v2/web-router/extract`. Answers at once
        with a `job_id`: call `GET /v2/web-router/browse/{job_id}` with the id
        until `state` is 'completed', 'failed' or 'cancelled', or `POST
        /v2/web-router/browse/{job_id}/cancel` to stop the task. Every call
        starts, and pays for, a new task: poll the one you have rather than
        starting it again, and if a start fails with an error saying a task may
        have started (`may_have_started`), start no other but tell the user.
        Nimble picks the provider, your own keys first, and tries no other once
        one may have started a task. Answers `{meta, job}`: what the task was
        started with, and its `job_id`, `provider` and `state`.
      operationId: browse
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrowseRequest'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobStartedResponse'
        '401':
          description: Missing or invalid API key, or Nimble refused your account.
        '402':
          description: 'Nimble refused your account: out of credits.'
        '403':
          description: Nimble refused your account, or WebRouter is not enabled for it.
        '422':
          description: The request is invalid, or the provider cannot serve it as asked.
        '429':
          description: 'Nimble refused to start another run: your account''s limit.'
        '502':
          description: >-
            The provider failed. On a start, `may_have_started` says when a job
            may have started.
        '503':
          description: Your account's settings could not be read.
        '504':
          description: >-
            The provider did not answer in time. On a start, `may_have_started`
            says when a job may have started.
      security:
        - BearerAuth: []
components:
  schemas:
    BrowseRequest:
      properties:
        start_url:
          anyOf:
            - type: string
              minLength: 1
              pattern: ^[Hh][Tt][Tt][Pp][Ss]?://\S+$
            - type: 'null'
          title: Start Url
          description: The page the agent starts on.
        output_schema:
          anyOf:
            - additionalProperties: true
              type: object
              minProperties: 1
            - type: 'null'
          title: Output Schema
          description: >-
            JSON Schema the answer must conform to. Unset asks for prose
            instead. Its root must be an object with non-empty `properties`, or
            an array with `items`.
        max_steps:
          anyOf:
            - type: integer
              maximum: 10000
              minimum: 1
            - type: 'null'
          title: Max Steps
          description: >-
            Upper bound on the actions the agent may take. Unset is the
            provider's own limit.
        allowed_domains:
          anyOf:
            - items:
                type: string
                minLength: 1
                pattern: ^[^\x00]*$
              type: array
              maxItems: 50
              minItems: 1
            - type: 'null'
          title: Allowed Domains
          description: Keep the agent on these domains.
        task:
          type: string
          maxLength: 10000
          pattern: >-
            [^\s\x00-\x1f\x7f-\x9f\xad\u0600-\u0605\u061c\u06dd\u070f\u0890\u0891\u08e2\u180e\u200b-\u200f\u202a-\u202e\u2060-\u2064\u2066-\u206f\ufeff\ufff9-\ufffb]
          title: Task
          description: What the agent should do, in plain words.
          examples:
            - Find the pricing page and list the plan names
      additionalProperties: false
      type: object
      required:
        - task
      title: BrowseRequest
      description: A browse request.
      examples:
        - start_url: https://example.com
          task: Find the pricing page and list the plan names
    JobStartedResponse:
      properties:
        meta:
          $ref: '#/components/schemas/ToolMeta'
          description: The tool that ran.
        job:
          $ref: '#/components/schemas/StartedJob'
          description: >-
            The job: poll it until its `state` is 'completed', 'failed' or
            'cancelled'.
      type: object
      required:
        - meta
        - job
      title: JobStartedResponse
    ToolMeta:
      properties:
        tool:
          $ref: '#/components/schemas/Tool'
          description: The tool that ran.
      type: object
      required:
        - tool
      title: ToolMeta
    StartedJob:
      properties:
        job_id:
          type: string
          title: Job Id
          description: 'The job''s id: poll it and cancel it with this.'
        provider:
          type: string
          title: Provider
          description: >-
            `nimble_selection` when Nimble picked and served the call. The
            provider's name when your own key served it, with `byok` true.
          examples:
            - nimble_selection
        byok:
          type: boolean
          title: Byok
          description: Whether your own provider key served the call.
        state:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
            - cancelled
          title: State
          description: 'Where it stands: ''queued'' or ''running'' on a start.'
        job_url:
          type: string
          title: Job Url
          description: >-
            The job's path on the server. Poll the job by its `job_id` at `GET
            /v2/web-router/research/{job_id}` or `GET
            /v2/web-router/browse/{job_id}`.
      type: object
      required:
        - job_id
        - provider
        - byok
        - state
        - job_url
      title: StartedJob
    Tool:
      type: string
      enum:
        - search
        - extract
        - extract_template
        - browse
        - research
        - answer
      title: Tool
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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