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

# Question answering on context



## OpenAPI

````yaml /api-reference/openapi.json post /v1/question-answering
openapi: 3.1.0
info:
  title: SynapsAI Inference API
  version: 1.0.0
servers:
  - url: https://api.synapsai.cloud
    description: Production server
security: []
paths:
  /v1/question-answering:
    post:
      summary: Question answering on context
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuestionAnsweringRequest'
      responses:
        '200':
          description: Answering results
          content:
            application/json:
              schema:
                type: object
                properties:
                  score:
                    type: number
                  start:
                    type: integer
                  end:
                    type: integer
                  answer:
                    type: string
components:
  schemas:
    QuestionAnsweringRequest:
      allOf:
        - type: object
          description: Request to ask questions about provided text context.
          properties:
            question:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
              description: Question string or list of questions. Required.
            context:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
              description: Context text(s) corresponding to the question(s). Required.
            top_k:
              type: integer
              default: 1
              description: Number of top answers to return.
            doc_stride:
              type: integer
              default: 128
              description: Overlap size when splitting long context for the model.
            max_answer_len:
              type: integer
              default: 15
              description: Maximum number of tokens allowed in the returned answer.
            max_seq_len:
              type: integer
              default: 384
              description: Maximum sequence length of context+question in tokens.
            max_question_len:
              type: integer
              default: 64
              description: Maximum question length after tokenization.
            handle_impossible_answer:
              type: boolean
              default: false
              description: >-
                Whether to allow returning a no-answer result when no answer is
                found.
            align_to_words:
              type: boolean
              default: true
              description: >-
                Attempt to align predicted answer boundaries to actual word
                boundaries.
          required:
            - question
            - context

````