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

# Ask a question to a PDF

> Uses embedding model to find section of PDF most relevant for answering a question
:param pdf_url: the url
:param question: the question
:return: the chunk most relevant to answering that question and its source



## OpenAPI

````yaml get /api/question
openapi: 3.1.0
info:
  title: No title
  version: No version
servers:
  - url: https://api.scholarai.io
security:
  - ApiKeyAuth: []
tags:
  - name: Api
paths:
  /api/question:
    get:
      tags:
        - Api
      summary: Ask a question to a PDF
      description: >-
        Uses embedding model to find section of PDF most relevant for answering
        a question

        :param pdf_url: the url

        :param question: the question

        :return: the chunk most relevant to answering that question and its
        source
      operationId: api_question
      parameters:
        - in: query
          name: question
          description: The user question. Must be in English.
          schema:
            type: string
          required: true
        - in: query
          name: pdf_id
          description: >-
            id for PDF. Must begin with be one of `PDF_URL:some.url.com` or
            `PROJ:some_path`
          schema:
            type: string
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaperContentResponse'
          description: OK
components:
  schemas:
    PaperContentResponse:
      type: object
      properties:
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/PaperChunk'
        total_chunk_num:
          type: integer
        hint:
          type: string
    PaperChunk:
      type: object
      properties:
        chunk_num:
          type: integer
        chunk:
          type: string
        img_mds:
          type: array
          items:
            type: string
        pdf_url:
          type: string
          format: url
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: x-scholarai-api-key
      in: header

````