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

# Search / Ask

> The ask endpoint is how you can preform quick look up, or generation of an answer to a user-submitted question (prompt).



## OpenAPI

````yaml GET /ask
openapi: 3.1.0
info:
  title: HeyPal API
  version: '1.0'
  description: >-
    The HeyPal API makes it easy to add A.I. powered semantic-search & other
    A.I. functionality to your product & content.
servers:
  - url: https://api.pal.ai/v1
security:
  - API Key: []
paths:
  /ask:
    get:
      tags: []
      summary: Search / Ask
      description: >-
        The ask endpoint is how you can preform quick look up, or generation of
        an answer to a user-submitted question (prompt).
      operationId: get-ask
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                applicationId:
                  type: string
                prompt:
                  type: string
                  description: >-
                    The question you want an answer for, or the action you want
                    the assistant to take given the additonal context of
                    relevant documents.
                shouldGenerateResponse:
                  type: boolean
                  description: >-
                    Defaults to `true`. Determines whether the application just
                    generates matches of similar documents or also tries to
                    generate a longer-form synthesized response.
                filter:
                  type: object
                  description: >-
                    A set of metadata keys and corresponding values, to only
                    have documents that match those criteria return.
                '':
                  type: string
              required:
                - applicationId
                - prompt
        description: >
          `shouldGenerateResponse: false`

          Fast semantic search, just returns relevant sections and the
          corresponding Documents from the index of the application


          `shouldGenerateResponse: true`

          Generates a response using the model provider (defaults to OpenAI),
          given the additional context of documents found.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  searchResults:
                    type: object
                    required:
                      - documents
                    properties:
                      documents:
                        $ref: '#/components/schemas/Document'
                  answer:
                    type: string
                required:
                  - searchResults
components:
  schemas:
    Document:
      type: object
      x-examples:
        Example 1:
          id: 28e9ea9c-b290-47f5-9e1f-59bf785b1642
          title: Manage indexes
          url: https://docs.pinecone.io/docs/manage-indexes
          content: This is the sample text
          contentType: text
          fields:
            field1: field1Value
      title: Document
      x-stoplight:
        id: 1f15bd385fdbb
      properties:
        id:
          type: string
        title:
          type: string
        url:
          type: string
        content:
          type: string
        contentType:
          type: string
        metadata:
          type: object
          description: Metadata you want to store about this object.
          properties:
            '{{metadataKey}}':
              type: string
      required:
        - content

````