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

# Web Search

> Search the public web and return ranked results.



## OpenAPI

````yaml /tools/web-tools.json post /v1/web-search
openapi: 3.0.0
info:
  title: Modellix Web Tools API
  version: 1.0.0
  description: OpenAPI contract for the Modellix Web Search and Web Fetch endpoints.
servers:
  - url: https://tool.modellix.ai
security:
  - bearerAuth: []
paths:
  /v1/web-search:
    post:
      summary: Web Search
      description: Search the public web and return ranked results.
      operationId: webSearch
      parameters:
        - $ref: '#/components/parameters/MdlxUserId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebSearchRequest'
      responses:
        '200':
          description: Search completed and billed once according to depth.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebSearchResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientBalance'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
        '504':
          $ref: '#/components/responses/Timeout'
components:
  parameters:
    MdlxUserId:
      name: X-Mdlx-User-Id
      in: header
      required: true
      description: Stable end-user identifier supplied by the API caller.
      schema:
        type: string
        minLength: 8
        maxLength: 128
        pattern: ^[A-Za-z0-9_-]+$
  schemas:
    WebSearchRequest:
      type: object
      additionalProperties: false
      required:
        - query
      properties:
        query:
          type: string
          minLength: 1
          pattern: .*\S.*
          description: Search query. Whitespace-only values are rejected by the service.
        depth:
          type: string
          enum:
            - lite
            - standard
            - rich
          default: standard
        max_results:
          type: integer
          minimum: 1
          maximum: 20
          default: 5
        include_domains:
          type: array
          maxItems: 50
          items:
            type: string
        exclude_domains:
          type: array
          maxItems: 50
          items:
            type: string
        time_range:
          type: string
          nullable: true
          enum:
            - day
            - week
            - month
            - year
        start_date:
          type: string
          format: date
          description: Optional inclusive start date. It must not be after end_date.
        end_date:
          type: string
          format: date
          description: Optional inclusive end date.
        topic:
          type: string
          enum:
            - general
            - news
            - finance
          default: general
        country:
          type: string
          nullable: true
          pattern: ^[A-Za-z]{2}$
          description: ISO 3166-1 alpha-2 country code.
        include_answer:
          type: boolean
          default: false
          description: Must be false when depth is lite.
    WebSearchResponse:
      type: object
      additionalProperties: false
      required:
        - query
        - depth
        - answer
        - results
        - warnings
        - billing
        - request_id
      properties:
        query:
          type: string
        depth:
          type: string
          enum:
            - lite
            - standard
            - rich
        answer:
          type: string
          nullable: true
        results:
          type: array
          items:
            $ref: '#/components/schemas/SearchResult'
        warnings:
          type: array
          items:
            type: string
        billing:
          $ref: '#/components/schemas/WebSearchBilling'
        request_id:
          type: string
    SearchResult:
      type: object
      additionalProperties: false
      required:
        - title
        - url
        - content
        - summary
        - score
        - published_at
        - favicon
      properties:
        title:
          type: string
        url:
          type: string
          format: uri
        content:
          type: string
        summary:
          type: string
          nullable: true
        score:
          type: number
          format: double
        published_at:
          type: string
          nullable: true
        favicon:
          type: string
          nullable: true
    WebSearchBilling:
      type: object
      additionalProperties: false
      required:
        - sku
        - amount_usd
      properties:
        sku:
          type: string
          enum:
            - web-search.lite
            - web-search.standard
            - web-search.rich
        amount_usd:
          type: number
          format: double
          minimum: 0
    ErrorEnvelope:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
  responses:
    BadRequest:
      description: Invalid request or required user identifier.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    InsufficientBalance:
      description: Team balance is insufficient for the maximum charge.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: Team RPM or concurrency limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unavailable:
      description: Pricing, platform, or upstream providers are unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Timeout:
      description: The request exceeded its total deadline.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Modellix API Key

````