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

# Ask Endpoint

> Plan tool calls over the governed read surface, execute them under the as-of/trust gate,
and synthesize a cited answer through the shared Corpus API runtime.



## OpenAPI

````yaml /openapi.json post /ask
openapi: 3.1.0
info:
  title: Corpus API
  description: >-
    Point-in-time financial and governed-document data for the US, India, and
    China.
  version: '2026-07-20'
servers:
  - url: https://corpus-api.onera.app
    description: Production
security: []
paths:
  /ask:
    post:
      tags:
        - Search
      summary: Ask Endpoint
      description: >-
        Plan tool calls over the governed read surface, execute them under the
        as-of/trust gate,

        and synthesize a cited answer through the shared Corpus API runtime.
      operationId: ask_endpoint_ask_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AskResponse'
        '400':
          description: Invalid parameter combination
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Insufficient jurisdiction or scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Unknown resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Request schema validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Source content is unavailable or still processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - X-API-KEY: []
components:
  schemas:
    AskRequest:
      properties:
        q:
          type: string
          minLength: 1
          title: Q
          description: Natural-language question.
        as_of:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: As Of
          description: 'As-of knowledge cutoff (UTC). Default: now (latest known).'
        market:
          anyOf:
            - type: string
              enum:
                - IN
                - US
            - type: 'null'
          title: Market
          description: >-
            Jurisdiction to query. Omit only for an explicitly
            cross-jurisdiction request; the credential must then carry both
            us:read and india:read.
      type: object
      required:
        - q
      title: AskRequest
    AskResponse:
      properties:
        answer:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer
        planner:
          type: string
          enum:
            - llm
            - fallback
          title: Planner
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        as_of:
          type: string
          format: date-time
          title: As Of
        steps:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Steps
        data:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Data
        citations:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Citations
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
      type: object
      required:
        - answer
        - planner
        - as_of
        - steps
        - data
        - citations
      title: AskResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
      type: object
      required:
        - error
        - message
      title: ErrorResponse
  securitySchemes:
    X-API-KEY:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Provisioned Corpus API key with the required jurisdiction and operation
        scopes.

````