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

# OpenAI Web Search

> Ask a question and get an OpenAI-model answer grounded in a live web search, with the underlying sources and URL citations, billed at exact cost.

Ask a question and get an answer that an OpenAI model wrote after searching the live web. Send a Responses request — an `input` string (or message array) — and the endpoint injects a fixed, server-pinned model and the `web_search` tool for you; the model, tool and per-request search cap are server-controlled to keep cost bounded. The reply is a standard OpenAI Responses object: `output[]` contains `web_search_call` items (each a search that ran) and a `message` item with the answer text and URL citations, and the billed search count equals the number of `web_search_call` items. Billing is pay-as-you-go at exact cost: `web_search_calls × $0.01` plus the model's own token cost (fresh input = `input_tokens − cached`), with no markup. Use this when you want a written, cited answer grounded in current web content from an OpenAI model — for the Anthropic-model equivalent see [`post_anthropic_websearch_search`](/docs/api-reference/search/post_anthropic-websearch-search), and for raw ranked links with extracted page text use [`post_tavily_search`](/docs/api-reference/search/post_tavily-search).


## OpenAPI

````yaml openapi/websearch.json POST /openai-websearch/search
openapi: 3.0.0
info:
  title: Web Search API
  version: 1.0.0
  description: >-
    Model-grounded web search endpoints that run a real web search inside a
    fixed frontier model and return the model's answer together with the
    underlying search results and citations. Billed pay-as-you-go at exact
    provider cost (no markup).
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - bearerAuth: []
paths:
  /openai-websearch/search:
    post:
      tags:
        - https://platform.openai.com/docs/guides/tools-web-search
      summary: Model-grounded web search (OpenAI).
      description: >-
        Ask a question and get an answer that an OpenAI model wrote after
        searching the live web. Send a Responses request — an `input` string (or
        message array) — and the endpoint injects a fixed, server-pinned model
        and the `web_search` tool for you; the model, tool and per-request
        search cap are server-controlled to keep cost bounded. The reply is a
        standard OpenAI Responses object: `output[]` contains `web_search_call`
        items (each a search that ran) and a `message` item with the answer text
        and URL citations, and the billed search count equals the number of
        `web_search_call` items. Billing is pay-as-you-go at exact cost:
        `web_search_calls × $0.01` plus the model's own token cost (fresh input
        = `input_tokens − cached`), with no markup. Use this when you want a
        written, cited answer grounded in current web content from an OpenAI
        model — for the Anthropic-model equivalent see
        [`post_anthropic_websearch_search`](/api-reference/search/post_anthropic-websearch-search),
        and for raw ranked links with extracted page text use
        [`post_tavily_search`](/api-reference/search/post_tavily-search).
      operationId: post_openai_websearch_search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - input
              properties:
                input:
                  type: string
                  description: >-
                    Your question or instruction, same format as the OpenAI
                    Responses API `input`. A message array is also accepted.
                  example: >-
                    What are the three biggest AI announcements this week? Give
                    one sentence each with sources.
                max_output_tokens:
                  type: integer
                  description: >-
                    Optional cap on the number of tokens generated in the
                    answer.
                  example: 1024
                instructions:
                  type: string
                  description: >-
                    Optional high-level instructions to steer the answer's tone
                    or format.
            example:
              input: >-
                What are the three biggest AI announcements this week? Give one
                sentence each with sources.
              max_output_tokens: 1024
      responses:
        '200':
          description: >-
            A standard OpenAI Responses object. `output[]` interleaves
            web_search_call items and the cited answer message; the number of
            web_search_call items is the billed search count.
          headers:
            X-AISA-Web-Search-Count:
              description: Number of web searches billed for this request.
              schema:
                type: integer
            X-AISA-Price-USD:
              description: Amount charged to your account for this request, in USD.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  object:
                    type: string
                    example: response
                  status:
                    type: string
                    example: completed
                  output:
                    type: array
                    description: >-
                      Ordered items: web_search_call (searches performed) and
                      message (the cited answer).
                    items:
                      type: object
                  usage:
                    type: object
                    properties:
                      input_tokens:
                        type: integer
                      output_tokens:
                        type: integer
                      input_tokens_details:
                        type: object
                        properties:
                          cached_tokens:
                            type: integer
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````