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

# Search

> Run ranked retrieval over canonical documents and passages.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/search
openapi: 3.1.0
info:
  description: >-
    Local implementation of the v1 search, document, feedback, and internal
    operational APIs.
  title: Agent Search API (Public)
  version: 0.1.0
servers:
  - description: Staging
    url: https://alpha.api.trycaesar.com
  - description: Local development
    url: http://localhost:8080
security: []
tags:
  - description: Public search APIs.
    name: Search
  - description: Public document inspection APIs.
    name: Documents
  - description: Public feedback ingestion APIs.
    name: Feedback
  - description: Asynchronous deep-research APIs.
    name: Research
  - description: Internal health, readiness, and metrics APIs.
    name: Operations
paths:
  /v1/search:
    post:
      tags:
        - Search
      summary: Search
      description: Run ranked retrieval over canonical documents and passages.
      operationId: search
      parameters:
        - description: Optional client session identifier.
          in: header
          name: X-Session-ID
          schema:
            description: Optional client session identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
          description: Search results.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Validation error.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Missing or invalid API key.
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Insufficient prepaid balance.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: API key does not have the required scope.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Rate limited.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Internal error.
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Search infrastructure unreachable.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Search infrastructure unavailable.
      security:
        - bearerApiKey: []
components:
  schemas:
    SearchRequest:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://alpha.api.trycaesar.com/SearchRequest.json
          format: uri
          readOnly: true
          type: string
        client_model:
          description: Calling model identifier, recorded for analytics and ranking tuning.
          type: string
        filters:
          additionalProperties: {}
          description: >-
            Structured filters. Keys: country (two-letter code such as 'us' or
            'de', scoping results to a market), language (two-letter code such
            as 'en'), exact_match (boolean; quotes the query so the index
            matches it verbatim).
          type: object
        freshness_policy:
          additionalProperties: {}
          description: >-
            Recency requirements. Keys: published_after (RFC 3339 timestamp or
            YYYY-MM-DD date; only content published after it) and freshness
            (coarse window code pd, pw, pm, or py for past day, week, month, or
            year; ignored when published_after is set).
          type: object
        max_results:
          default: 10
          description: >-
            Maximum number of ranked results to return. The response carries
            fewer when the index has fewer matches.
          format: int64
          maximum: 50
          minimum: 1
          type: integer
        query:
          description: >-
            The search query, phrased as the user or agent would ask it. Drives
            ranking and passage selection even when search_queries supplies a
            rewrite.
          examples:
            - linux kernel amd gpu suspend
          minLength: 1
          type: string
        response:
          $ref: '#/components/schemas/ResponseShape'
          description: >-
            Optional response shaping: verbosity preset and serialized-size
            budget.
        scope:
          $ref: '#/components/schemas/SearchScope'
          description: >-
            Which indexes to search. Omit it for the web index. Additive:
            existing clients are unaffected.
        search_queries:
          description: >-
            Caller-provided query rewrites. The first entry replaces query as
            the text sent to the search index; query still drives reranking and
            passage selection. All entries are visible to the server-side query
            rewriter.
          items:
            type: string
          type:
            - array
            - 'null'
        session_id:
          description: >-
            Client session identifier (UUID). Groups related search, document,
            and feedback calls; equivalent to the X-Session-ID header. When
            omitted, the server generates one and echoes it back as session_id.
          format: uuid
          type: string
        source_policy:
          additionalProperties: {}
          description: >-
            Domain allow/deny policy. Keys: include_domains (array of domains;
            with require_domain_match true, results outside them are dropped,
            and a single entry is also sent to the index as a site: operator),
            exclude_domains (array of domains whose results are always dropped),
            require_domain_match (boolean). Domains match their subdomains; a
            leading www. is ignored.
          type: object
      required:
        - query
      type: object
    SearchResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://alpha.api.trycaesar.com/SearchResponse.json
          format: uri
          readOnly: true
          type: string
        access:
          $ref: '#/components/schemas/Access'
        integration_results:
          $ref: '#/components/schemas/IntegrationResultsSummary'
        ranking:
          $ref: '#/components/schemas/Ranking'
        request_id:
          type: string
        results:
          items:
            $ref: '#/components/schemas/SearchResult'
          type:
            - array
            - 'null'
        search_id:
          type: string
        session_id:
          type: string
        truncated:
          type: boolean
        usage:
          $ref: '#/components/schemas/Usage'
        warnings:
          items:
            $ref: '#/components/schemas/Warning'
          type:
            - array
            - 'null'
      required:
        - request_id
        - search_id
        - session_id
        - results
      type: object
    ErrorEnvelope:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://alpha.api.trycaesar.com/ErrorEnvelope.json
          format: uri
          readOnly: true
          type: string
        error:
          $ref: '#/components/schemas/ErrorBody'
          description: Error details.
        request_id:
          description: Server request identifier.
          type: string
        type:
          description: Envelope discriminator.
          enum:
            - error
          type: string
      required:
        - type
        - request_id
        - error
      type: object
    ResponseShape:
      additionalProperties: false
      properties:
        budget:
          $ref: '#/components/schemas/ResponseBudget'
          description: >-
            Total serialized response budget in characters with deterministic
            shedding.
        verbosity:
          default: standard
          description: >-
            Field preset: ids_only (rank, doc_id, url, title), compact (adds
            snippet, score, key dates), standard (today's default), full (adds
            provenance).
          enum:
            - ids_only
            - compact
            - standard
            - full
          type: string
      type: object
    SearchScope:
      additionalProperties: false
      properties:
        indexes:
          description: >-
            Indexes to search: web (the shared web corpus) and/or workspace
            (your organization's ingested documents). Default: ["web"].
          items:
            type: string
          type:
            - array
            - 'null'
        workspace_id:
          description: Workspace to search; required when indexes includes workspace.
          format: uuid
          type: string
      type: object
    Access:
      additionalProperties: false
      properties:
        rate_limit:
          $ref: '#/components/schemas/RateLimit'
      required:
        - rate_limit
      type: object
    IntegrationResultsSummary:
      additionalProperties: false
      properties:
        href:
          type: string
        selected:
          format: int64
          type: integer
        total:
          format: int64
          type: integer
      required:
        - total
        - selected
        - href
      type: object
    Ranking:
      additionalProperties: false
      properties:
        ranker_version:
          type: string
        score_scope:
          type: string
      required:
        - ranker_version
        - score_scope
      type: object
    SearchResult:
      additionalProperties: false
      properties:
        canonical_url:
          type: string
        description:
          type: string
        doc_id:
          type: string
        index:
          type: string
        labels:
          items:
            type: string
          type:
            - array
            - 'null'
        metadata:
          $ref: '#/components/schemas/SearchResultMetadata'
        mime:
          type: string
        passages:
          items:
            $ref: '#/components/schemas/Passage'
          type:
            - array
            - 'null'
        provenance:
          $ref: '#/components/schemas/DocumentProvenance'
        rank:
          format: int64
          type: integer
        score:
          $ref: '#/components/schemas/SearchScore'
        snippet:
          type: string
        source_uri:
          type: string
        source_url:
          type: string
        title:
          type: string
      required:
        - rank
        - doc_id
        - canonical_url
      type: object
    Usage:
      additionalProperties: false
      properties:
        bytes_returned:
          format: int64
          type: integer
        requests:
          format: int64
          type: integer
      required:
        - requests
        - bytes_returned
      type: object
    Warning:
      additionalProperties: false
      properties:
        code:
          type: string
        details:
          additionalProperties: {}
          type: object
        message:
          type: string
      required:
        - code
        - message
      type: object
    ErrorBody:
      additionalProperties: false
      properties:
        code:
          description: Stable machine-readable error code.
          type: string
        details:
          additionalProperties: {}
          description: Optional structured error details.
          type: object
        message:
          description: Human-readable error message.
          type: string
      required:
        - code
        - message
      type: object
    ResponseBudget:
      additionalProperties: false
      properties:
        max_chars_total:
          description: >-
            Maximum serialized response size in characters (roughly 4 characters
            per token, so 2000 is about 500 tokens).
          format: int64
          minimum: 1
          type: integer
        on_exceed:
          default: shed
          description: >-
            What to do when the budget binds: shed (default) trims in a fixed
            order - passages, snippet tails, preset extras, then tail results,
            never below one result - and sets truncated plus a
            response_truncated warning; error fails with response_too_large
            instead.
          enum:
            - shed
            - error
          type: string
      type: object
    RateLimit:
      additionalProperties: false
      properties:
        limit_rps:
          format: int64
          type: integer
        remaining:
          format: int64
          type: integer
        reset_at:
          type: string
      required:
        - limit_rps
        - remaining
        - reset_at
      type: object
    SearchResultMetadata:
      additionalProperties: false
      properties:
        content_digest:
          type: string
        extracted_at:
          type: string
        first_seen_at:
          type: string
        last_crawled_at:
          type: string
        last_seen_at:
          type: string
        published_at:
          type: string
      type: object
    Passage:
      additionalProperties: false
      properties:
        char_end:
          format: int64
          type: integer
        char_start:
          format: int64
          type: integer
        doc_id:
          type: string
        ordinal:
          format: int64
          type: integer
        passage_id:
          type: string
        section_heading:
          type: string
        section_path:
          items:
            type: string
          type:
            - array
            - 'null'
        text:
          type: string
      required:
        - passage_id
        - doc_id
        - ordinal
        - text
      type: object
    DocumentProvenance:
      additionalProperties: false
      properties:
        capture_id:
          type: string
        capture_time:
          type: string
      required:
        - capture_id
        - capture_time
      type: object
    SearchScore:
      additionalProperties: false
      properties:
        value:
          format: double
          type: number
      required:
        - value
      type: object
  securitySchemes:
    bearerApiKey:
      bearerFormat: API key
      scheme: bearer
      type: http

````