> ## 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 Research

> **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 research run: the provider searches, reads and cross-checks sources over many steps, which usually takes minutes and is billed, the more at a higher `effort`. Worth it for a question a handful of searches cannot settle, a comparison across sources, or structured data (`output_schema`, `records`); for a lookup, use `POST /v2/web-router/search`. Answers at once with a `job_id`: call `GET /v2/web-router/research/{job_id}` with the id until `state` is 'completed', 'failed' or 'cancelled', or `POST /v2/web-router/research/{job_id}/cancel` to stop the run. Every call starts, and pays for, a new run: poll the one you have rather than starting it again, and if a start fails with an error saying a run 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 run. `optimized_for` sets what Nimble favors when it picks the provider; it does not set `effort`. Answers `{meta, job}`: what the run was started with, and its `job_id`, `provider` and `state`.



## OpenAPI

````yaml /api-reference/web-router-openapi.json post /v2/web-router/research
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/research:
    post:
      tags:
        - WebRouter
      summary: Start Research
      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 research run: the provider searches, reads and cross-checks
        sources over many steps, which usually takes minutes and is billed, the
        more at a higher `effort`. Worth it for a question a handful of searches
        cannot settle, a comparison across sources, or structured data
        (`output_schema`, `records`); for a lookup, use `POST
        /v2/web-router/search`. Answers at once with a `job_id`: call `GET
        /v2/web-router/research/{job_id}` with the id until `state` is
        'completed', 'failed' or 'cancelled', or `POST
        /v2/web-router/research/{job_id}/cancel` to stop the run. Every call
        starts, and pays for, a new run: poll the one you have rather than
        starting it again, and if a start fails with an error saying a run 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 run. `optimized_for` sets what Nimble favors when
        it picks the provider; it does not set `effort`. Answers `{meta, job}`:
        what the run was started with, and its `job_id`, `provider` and `state`.
      operationId: research
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResearchRequest'
        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:
    ResearchRequest:
      properties:
        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`.
        effort:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
            - type: 'null'
          title: Effort
          description: >-
            How much work the run should do, and so how long it takes and what
            it costs: 'low' a quick pass, closest in cost to a deep search;
            'medium' a typical agentic run; 'high' several rounds of gathering
            and cross-checking. Unset is each provider's own default, which for
            some is a deep and costly tier.
        include_domains:
          anyOf:
            - items:
                type: string
                minLength: 1
                pattern: ^[^\x00]*$
              type: array
              maxItems: 50
              minItems: 1
            - type: 'null'
          title: Include Domains
          description: Restrict sources to these domains.
        exclude_domains:
          anyOf:
            - items:
                type: string
                minLength: 1
                pattern: ^[^\x00]*$
              type: array
              maxItems: 50
              minItems: 1
            - type: 'null'
          title: Exclude Domains
          description: Keep these domains out of the sources.
        optimized_for:
          anyOf:
            - $ref: '#/components/schemas/OptimizedFor'
            - type: 'null'
          description: >-
            What to favour: speed, cost or coverage. Unset or empty is
            `balanced`.
        query:
          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: Query
          description: The question, or the instructions for the run.
          examples:
            - What is the headquarters country of Infineon?
        records:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
              maxItems: 1000
              minItems: 1
            - type: 'null'
          title: Records
          description: >-
            Partial records to enrich, each shaped like `output_schema`, e.g.
            `[{"company": "NXP Semiconductors"}]`: the completed answer's
            `structured` is then a list, one row per record. Nimble needs
            `effort` 'medium' or above for it. Unset researches the query alone.
      additionalProperties: false
      type: object
      required:
        - query
      title: ResearchRequest
      description: A research request.
      examples:
        - effort: low
          query: What is the headquarters country of Infineon?
    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
    OptimizedFor:
      type: string
      enum:
        - speed
        - cost
        - coverage
        - balanced
      title: OptimizedFor
      description: '`balanced` is what a request that sends no `optimized_for` asks for.'
    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.