> ## Documentation Index
> Fetch the complete documentation index at: https://assembly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Ask questions using LeMUR

> Question & Answer allows you to ask free-form questions about a single transcript or a group of transcripts.
The questions can be any whose answers you find useful, such as judging whether a caller is likely to become a customer or whether all items on a meeting's agenda were covered.




## OpenAPI

````yaml post /lemur/v3/generate/question-answer
openapi: 3.1.0
info:
  title: AssemblyAI API
  description: AssemblyAI API
  version: 1.3.4
  termsOfService: https://www.assemblyai.com/legal/terms-of-service
  contact:
    name: API Support
    email: support@assemblyai.com
    url: https://www.assemblyai.com/docs/
servers:
  - url: https://api.assemblyai.com
    description: AssemblyAI API
security:
  - ApiKey: []
tags:
  - name: transcript
    description: Transcript related operations
    externalDocs:
      url: https://www.assemblyai.com/docs/guides/transcribing-an-audio-file
  - name: LeMUR
    description: LeMUR related operations
    externalDocs:
      url: >-
        https://www.assemblyai.com/docs/guides/processing-audio-with-llms-using-lemur
  - name: streaming
    description: Streaming Speech-to-Text
    externalDocs:
      url: https://www.assemblyai.com/docs/speech-to-text/streaming
paths:
  /lemur/v3/generate/question-answer:
    post:
      tags:
        - LeMUR
      summary: Ask questions using LeMUR
      description: >
        Question & Answer allows you to ask free-form questions about a single
        transcript or a group of transcripts.

        The questions can be any whose answers you find useful, such as judging
        whether a caller is likely to become a customer or whether all items on
        a meeting's agenda were covered.
      operationId: lemurQuestionAnswer
      requestBody:
        description: Params to ask questions about the transcripts
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LemurQuestionAnswerParams'
      responses:
        '200':
          description: LeMUR question & answer response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LemurQuestionAnswerResponse'
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Maximum number of allowed requests in a 60 second window.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Number of remaining requests in the current time window.
            X-RateLimit-Reset:
              schema:
                type: integer
              description: >-
                Number of seconds until the remaining requests resets to the
                value of X-RateLimit-Limit.
          links:
            PurgeLemurRequestDataById:
              $ref: '#/components/links/PurgeLemurRequestDataById'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
components:
  schemas:
    LemurQuestionAnswerParams:
      x-label: LeMUR question & answer parameters
      x-fern-sdk-group-name: lemur
      type: object
      allOf:
        - $ref: '#/components/schemas/LemurBaseParams'
        - type: object
          additionalProperties: false
          properties:
            questions:
              x-label: Questions
              description: A list of questions to ask
              type: array
              items:
                $ref: '#/components/schemas/LemurQuestion'
                x-label: Question
          required:
            - questions
      example:
        transcript_ids:
          - 64nygnr62k-405c-4ae8-8a6b-d90b40ff3cce
        context: This is an interview about wildfires.
        questions:
          - question: Where are there wildfires?
            answer_format: List of countries in ISO 3166-1 alpha-2 format
            answer_options:
              - US
              - CA
          - question: Is global warming affecting wildfires?
            answer_options:
              - 'yes'
              - 'no'
        final_model: anthropic/claude-3-5-sonnet
        temperature: 0
        max_output_size: 3000
    LemurQuestionAnswerResponse:
      x-label: LeMUR question & answer response
      x-fern-sdk-group-name: lemur
      type: object
      allOf:
        - $ref: '#/components/schemas/LemurBaseResponse'
        - type: object
          additionalProperties: false
          properties:
            response:
              x-label: Question & answers
              description: The answers generated by LeMUR and their questions
              type: array
              items:
                $ref: '#/components/schemas/LemurQuestionAnswer'
                x-label: Question & answer
          required:
            - response
      example:
        request_id: 5e1b27c2-691f-4414-8bc5-f14678442f9e
        response:
          - answer: CA, US
            question: Where are there wildfires?
          - answer: 'yes'
            question: Is global warming affecting wildfires?
        usage:
          input_tokens: 27
          output_tokens: 3
    LemurBaseParams:
      x-label: LeMUR base parameters
      x-fern-sdk-group-name: lemur
      type: object
      additionalProperties: false
      properties:
        transcript_ids:
          x-label: Transcript IDs
          description: >
            A list of completed transcripts with text. Up to a maximum of 100
            files or 100 hours, whichever is lower.

            Use either transcript_ids or input_text as input into LeMUR.
          type: array
          items:
            x-label: Transcript ID
            type: string
            format: uuid
        input_text:
          x-label: Input text
          description: >
            Custom formatted transcript data. Maximum size is the context limit
            of the selected model, which defaults to 100000.

            Use either transcript_ids or input_text as input into LeMUR.
          type: string
        context:
          x-label: Context
          description: >-
            Context to provide the model. This can be a string or a free-form
            JSON value.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
        final_model:
          x-label: Final model
          description: >
            The model that is used for the final prompt after compression is
            performed.
          default: default
          anyOf:
            - $ref: '#/components/schemas/LemurModel'
            - type: string
          x-ts-type: LiteralUnion<LemurModel, string>
          x-go-type: LeMURModel
        max_output_size:
          x-label: Maximum output size
          description: Max output size in tokens, up to 4000
          type: integer
          default: 2000
        temperature:
          x-label: Temperature
          description: >
            The temperature to use for the model.

            Higher values result in answers that are more creative, lower values
            are more conservative.

            Can be any value between 0.0 and 1.0 inclusive.
          type: number
          format: float
          default: 0
          minimum: 0
          maximum: 1
      example:
        transcript_ids:
          - 85f9b381-e90c-46ed-beca-7d76245d375e
          - 7c3acd18-df4d-4432-88f5-1e89f8827eea
        context: This is an interview about wildfires.
        final_model: anthropic/claude-3-5-sonnet
        temperature: 0
        max_output_size: 3000
    LemurQuestion:
      x-label: LeMUR question
      x-fern-sdk-group-name: lemur
      type: object
      additionalProperties: false
      required:
        - question
      properties:
        question:
          x-label: Question
          description: >-
            The question you wish to ask. For more complex questions use default
            model.
          type: string
        context:
          x-label: Context
          description: >-
            Any context about the transcripts you wish to provide. This can be a
            string or any object.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
        answer_format:
          x-label: Answer format
          description: >
            How you want the answer to be returned. This can be any text. Can't
            be used with answer_options. Examples: "short sentence", "bullet
            points"
          type: string
        answer_options:
          x-label: Answer options
          description: >
            What discrete options to return. Useful for precise responses. Can't
            be used with answer_format. Example: ["Yes", "No"]
          type: array
          items:
            x-label: Answer option
            type: string
      example:
        question: Where are there wildfires?
        answer_format: List of countries in ISO 3166-1 alpha-2 format
    LemurBaseResponse:
      x-label: LeMUR base response
      x-fern-sdk-group-name: lemur
      type: object
      additionalProperties: false
      properties:
        request_id:
          x-label: LeMUR request ID
          description: The ID of the LeMUR request
          type: string
          format: uuid
        usage:
          $ref: '#/components/schemas/LemurUsage'
          x-label: Usage
          description: The usage numbers for the LeMUR request
      required:
        - request_id
        - usage
      example:
        request_id: 5e1b27c2-691f-4414-8bc5-f14678442f9e
        usage:
          input_tokens: 27
          output_tokens: 3
    LemurQuestionAnswer:
      x-label: Question & answer
      x-fern-sdk-group-name: lemur
      type: object
      description: An answer generated by LeMUR and its question
      additionalProperties: false
      properties:
        question:
          x-label: Question
          description: The question for LeMUR to answer
          type: string
        answer:
          x-label: Answer
          description: The answer generated by LeMUR
          type: string
      required:
        - question
        - answer
      example:
        answer: CA, US
        question: Where are there wildfires?
    Error:
      x-label: Error
      type: object
      additionalProperties: true
      required:
        - error
      properties:
        error:
          x-label: Error message
          description: Error message
          type: string
        status:
          x-label: Status
          type: string
          const: error
      example:
        error: format_text must be a Boolean
    LemurModel:
      x-label: LeMUR model
      x-fern-sdk-group-name: lemur
      type: string
      description: >
        The model that is used for the final prompt after compression is
        performed.
      enum:
        - anthropic/claude-3-5-sonnet
        - anthropic/claude-3-opus
        - anthropic/claude-3-haiku
        - anthropic/claude-3-sonnet
        - anthropic/claude-2-1
        - anthropic/claude-2
        - default
        - anthropic/claude-instant-1-2
        - basic
        - assemblyai/mistral-7b
      x-fern-enum:
        anthropic/claude-3-5-sonnet:
          description: >
            Claude 3.5 Sonnet is Anthropic's most intelligent model to date,
            outperforming Claude 3 Opus on a wide range of evaluations, with the
            speed and cost of Claude 3 Sonnet.
          casing:
            camel: anthropicClaude3_5_Sonnet
            snake: anthropic_claude3_5_sonnet
            pascal: AnthropicClaude3_5_Sonnet
            screamingSnake: ANTHROPIC_CLAUDE3_5_SONNET
        anthropic/claude-3-opus:
          description: >
            Claude 3 Opus is good at handling complex analysis, longer tasks
            with many steps, and higher-order math and coding tasks.
          casing:
            camel: anthropicClaude3_Opus
            snake: anthropic_claude3_opus
            pascal: AnthropicClaude3_Opus
            screamingSnake: ANTHROPIC_CLAUDE3_OPUS
        anthropic/claude-3-haiku:
          description: >
            Claude 3 Haiku is the fastest model that can execute lightweight
            actions.
          casing:
            camel: anthropicClaude3_Haiku
            snake: anthropic_claude3_haiku
            pascal: AnthropicClaude3_Haiku
            screamingSnake: ANTHROPIC_CLAUDE3_HAIKU
        anthropic/claude-3-sonnet:
          description: >
            Claude 3 Sonnet is a legacy model with a balanced combination of
            performance and speed for efficient, high-throughput tasks.
          casing:
            camel: anthropicClaude3_Sonnet
            snake: anthropic_claude3_sonnet
            pascal: AnthropicClaude3_Sonnet
            screamingSnake: ANTHROPIC_CLAUDE3_SONNET
        anthropic/claude-2-1:
          description: >
            Legacy - deprecating on 02/06/25. Claude 2.1 is a legacy model
            similar to Claude 2.0. The key difference is that it minimizes model
            hallucination and system prompts, has a larger context window, and
            performs better in citations.
          casing:
            camel: anthropicClaude2_1
            snake: anthropic_claude2_1
            pascal: AnthropicClaude2_1
            screamingSnake: ANTHROPIC_CLAUDE2_1
        anthropic/claude-2:
          description: >
            Legacy - deprecating on 02/06/25. Claude 2.0 is a legacy model that
            has good complex reasoning. It offers more nuanced responses and
            improved contextual comprehension.
          casing:
            camel: anthropicClaude2_0
            snake: anthropic_claude2_0
            pascal: AnthropicClaude2_0
            screamingSnake: ANTHROPIC_CLAUDE2_0
        default:
          description: Legacy - deprecating on 02/06/25. The same as Claude 2.0.
        anthropic/claude-instant-1-2:
          description: >
            Legacy - deprecating on 10/28/24. Claude Instant is a legacy model
            that is optimized for speed and cost. Claude Instant can complete
            requests up to 20% faster than Claude 2.0.
          casing:
            camel: anthropicClaudeInstant1_2
            snake: anthropic_claude_instant1_2
            pascal: AnthropicClaudeInstant1_2
            screamingSnake: ANTHROPIC_CLAUDE_INSTANT1_2
        basic:
          description: Legacy - deprecating on 10/28/24. The same as Claude Instant.
        assemblyai/mistral-7b:
          description: >
            LeMUR Mistral 7B is an LLM self-hosted by AssemblyAI. It's the
            fastest and cheapest of the LLM options. We recommend it for use
            cases like basic summaries and factual Q&A.
          casing:
            camel: assemblyaiMistral7b
            snake: assemblyai_mistral7b
            pascal: AssemblyaiMistral7b
            screamingSnake: ASSEMBLYAI_MISTRAL7B
      x-aai-enum:
        anthropic/claude-3-5-sonnet:
          label: Claude 3.5 Sonnet (on Anthropic)
        anthropic/claude-3-opus:
          label: Claude 3 Opus (on Anthropic)
        anthropic/claude-3-haiku:
          label: Claude 3 Haiku (on Anthropic)
        anthropic/claude-3-sonnet:
          label: Claude 3 Sonnet (on Anthropic)
        anthropic/claude-2-1:
          label: Claude 2.1 (on Anthropic)(Legacy - deprecating on 02/06/25)
        anthropic/claude-2:
          label: Claude 2 (on Anthropic)(Legacy - deprecating on 02/06/25)
        default:
          label: Default (Legacy - deprecating on 02/06/25)
        anthropic/claude-instant-1-2:
          label: Claude Instant 1.2 (on Anthropic)(Legacy - deprecating on 10/28/24)
        basic:
          label: Basic (Legacy - deprecating on 10/28/24)
        assemblyai/mistral-7b:
          label: Mistral 7B (hosted by AssemblyAI)
    LemurUsage:
      x-label: Usage
      description: The usage numbers for the LeMUR request
      x-fern-sdk-group-name: lemur
      type: object
      additionalProperties: false
      required:
        - input_tokens
        - output_tokens
      properties:
        input_tokens:
          x-label: Input tokens
          description: The number of input tokens used by the model
          type: integer
          minimum: 0
        output_tokens:
          x-label: Output tokens
          description: The number of output tokens generated by the model
          type: integer
          minimum: 0
  responses:
    BadRequest:
      x-label: Bad request
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: This is a sample error message
    Unauthorized:
      x-label: Unauthorized
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Authentication error, API token missing/invalid
    NotFound:
      x-label: Not found
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Not found
    TooManyRequests:
      x-label: Too many requests
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too Many Requests
      headers:
        Retry-After:
          description: The number of seconds to wait before retrying the request
          schema:
            type: integer
    InternalServerError:
      x-label: Internal server error
      description: An error occurred while processing the request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal Server Error
    ServiceUnavailable:
      x-label: Service unavailable
      description: Service unavailable
    GatewayTimeout:
      x-label: Gateway timeout
      description: Gateway timeout
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

````