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

# Reformulate an extraction query

> This endpoint can be used to reformulate a query in order to enhance retrieval.

The query should be a single string or a list of string with up to 10 queries.

The `model` field should be the name of the model to use for query formulation.





## OpenAPI

````yaml /api-reference/openapi-v2.yaml post /api/v2/query/reformulation
openapi: 3.0.3
info:
  title: Paradigm API
  version: xenial-xerus (v2)
  description: >-
    A versatile and adaptable tool designed to integrate Generative AI into your
    applications
servers:
  - url: https://paradigm.lighton.ai
security: []
tags:
  - name: Models
    description: Operations about AI models
  - name: Files Search
    description: Operations about files search
  - name: Files
    description: Operations about files
  - name: Upload Sessions
    description: Operations about upload sessions
  - name: Workspaces
    description: Operations about workspaces
  - name: Users
    description: Operations about users
  - name: Companies
    description: Operations about companies
  - name: SCIM
    description: Operations about SCIM
  - name: Feedbacks
    description: Operations about feedbacks
  - name: Reporting
    description: Operations about reporting
  - name: Monitoring
    description: Operations about monitoring
  - name: Platform Status
    description: Operations about platform status
paths:
  /api/v2/query/reformulation:
    post:
      tags:
        - Files Search
      summary: Reformulate an extraction query
      description: >+
        This endpoint can be used to reformulate a query in order to enhance
        retrieval.


        The query should be a single string or a list of string with up to 10
        queries.


        The `model` field should be the name of the model to use for query
        formulation.

      operationId: api_v2_query_reformulation_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryReformulationRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/QueryReformulationRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/QueryReformulationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/QueryReformulationResponse'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    QueryReformulationRequest:
      type: object
      description: Request serializer for reformulating queries to enhance retrieval.
      properties:
        query:
          type: string
          description: >-
            A single string or a list of strings with up to 10 queries to
            reformulate
        model:
          type: string
          description: >-
            Model to use for the reformulation, must exist and be configured. If
            no model is given, will try to use the 'rewriter' finetune.
      required:
        - model
        - query
    QueryReformulationResponse:
      type: object
      description: Response serializer for the result of query reformulation.
      properties:
        query:
          type: string
          description: The original query that was reformulated
        reformulation:
          type: string
          description: The reformulated query optimized for enhanced retrieval
      required:
        - query
        - reformulation
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````