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
paths:
  /api/v2/collection/update_chunks:
    post:
      operationId: api_v2_collection_update_chunks_create
      description: >-
        This endpoint is used for updating chunks. If the document ID is
        unspecified, a new document will be created.


        The user should have these permissions:

        - Can upload document chunk for benchmarks

        - Can create company collection

        - Can add document chunks to company collection
      summary: Update chunks
      tags:
        - Monitoring
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateChunksRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateChunksRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateChunksRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateChunksResponse'
          description: ''
  /api/v2/companies/{id}:
    get:
      operationId: api_v2_companies_retrieve
      description: >-
        This endpoint allows you to retrieve detailed information about a
        specific company.


        This is useful for accessing company data for administrative purposes,
        reporting, or integration with other systems.
      summary: Retrieve a company
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
      tags:
        - Companies
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyInfoResponse'
          description: ''
  /api/v2/companies/{id}/update/:
    patch:
      operationId: api_v2_companies_update_partial_update
      description: >-
        This endpoint allows you to update the details of an existing company.


        This is useful for maintaining accurate company information within the
        system.


        It is restricted to admin and company admin users.
      summary: Update a company
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
      tags:
        - Companies
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUpdateCompanyRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUpdateCompanyRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUpdateCompanyRequest'
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyInfoResponse'
          description: ''
  /api/v2/companies/{id}/users/:
    post:
      operationId: api_v2_companies_users_create
      description: |-
        This endpoint allows to create a company member.

        It is restricted to admin and company admin users.
      summary: Create a company member
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the company.
          required: true
      tags:
        - Users
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompanyMemberRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateCompanyMemberRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateCompanyMemberRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyMemberResponse'
          description: ''
  /api/v2/companies/{id}/workspaces/:
    get:
      operationId: api_v2_companies_workspaces_list
      description: >-
        This endpoint allows you to create a workspace within a specific
        company.


        This is useful for organizing and managing different projects or groups
        within the company.


        It is restricted to admin and company admin users.
      summary: List workspaces of a company
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the company.
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
      tags:
        - Workspaces
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCompanyWorkspaceResponseList'
          description: ''
  /api/v2/companies/{id}/workspaces/create/:
    post:
      operationId: api_v2_companies_workspaces_create_create
      description: >-
        This endpoint allows you to create a workspace within a specific
        company.


        This is useful for organizing and managing different projects or groups
        within the company.


        It is restricted to admin and company admin users.
      summary: Create a workspace
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the company.
          required: true
      tags:
        - Workspaces
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceV2Request'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceV2Request'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceV2Request'
        required: true
      security:
        - bearerAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceWithRelationsResponse'
          description: ''
  /api/v2/companies/create/:
    post:
      operationId: api_v2_companies_create_create
      description: |-
        This endpoint allows you to create a new company.

        It is restricted to admin users.
      summary: Create a company
      tags:
        - Companies
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompanyRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateCompanyRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateCompanyRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyInfoResponse'
          description: ''
  /api/v2/completions:
    post:
      operationId: api_v2_completions_create
      description: >-
        This endpoint can be used to generate completions from a Large Language
        Model.


        It is a simple proxy forwarding your requests to the desired model.


        Any LightOn model is deployed on a vLLM-based image.


        **Response Types:**

        - When `stream=false` **(default)**: Returns a complete JSON response
        with all completion choices

        - When `stream=true`: Returns Server-Sent Events (SSE) with incremental
        completion chunks


        **Streaming Format:**


        Each SSE event contains a JSON object with incremental text. The stream
        ends with `data: [DONE]`.
      summary: Generate a text completion
      tags:
        - Models
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompletionsRequest'
            examples:
              LightOnModelExample:
                value:
                  model: alfred-4.2
                  prompt: 'Hello, '
                summary: LightOn model example
              StreamingRequestExample:
                value:
                  model: alfred-4.2
                  prompt: 'Hello, '
                  stream: true
                summary: Streaming request example
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CompletionsRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CompletionsRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompletionsResponse'
              examples:
                LightOnModelExample:
                  value:
                    model: alfred-4.2
                    prompt: 'Hello, '
                  summary: LightOn model example
                StreamingRequestExample:
                  value:
                    model: alfred-4.2
                    prompt: 'Hello, '
                    stream: true
                  summary: Streaming request example
          description: ''
  /api/v2/chat/completions:
    post:
      operationId: api_v2_chat_completions_create
      description: >-
        This endpoint can be used to generate chat completions from a Large
        Language Model.


        It is a simple proxy forwarding your requests to the desired model.


        Any LightOn model is deployed on a vLLM-based image.


        **Response Types:**

        - When `stream=false` **(default)**: Returns a complete JSON response
        with all completion choices

        - When `stream=true`: Returns Server-Sent Events (SSE) with incremental
        completion chunks


        **Streaming Format:**


        Each SSE event contains a JSON object with incremental text. The stream
        ends with `data: [DONE]`.
      summary: Generate a chat completion
      tags:
        - Models
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionsRequest'
            examples:
              LightOnModelExample:
                value:
                  model: alfred-4.2
                  messages:
                    - role: system
                      content: You are a helpful assistant.
                    - role: user
                      content: Hello!
                summary: LightOn model example
              StreamingRequestExample:
                value:
                  model: alfred-4.2
                  messages:
                    - role: system
                      content: You are a helpful assistant.
                    - role: user
                      content: Hello!
                  stream: true
                summary: Streaming request example
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ChatCompletionsRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ChatCompletionsRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionsResponse'
              examples:
                LightOnModelExample:
                  value:
                    model: alfred-4.2
                    messages:
                      - role: system
                        content: You are a helpful assistant.
                      - role: user
                        content: Hello!
                  summary: LightOn model example
                StreamingRequestExample:
                  value:
                    model: alfred-4.2
                    messages:
                      - role: system
                        content: You are a helpful assistant.
                      - role: user
                        content: Hello!
                    stream: true
                  summary: Streaming request example
          description: ''
  /api/v2/feedback/feedback-types/:
    get:
      operationId: api_v2_feedback_feedback_types_list
      description: API endpoint for viewing and editing feedback types.
      summary: List feedback types
      parameters:
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - in: query
          name: unique_feedback
          schema:
            type: boolean
        - in: query
          name: value_type
          schema:
            type: string
            enum:
              - boolean
              - comment
              - float
              - tag
          description: |-
            * `boolean` - Boolean flag
            * `float` - Float range
            * `comment` - Free text comment
            * `tag` - String tag
      tags:
        - Feedbacks
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedFeedbackTypeList'
          description: ''
  /api/v2/feedback/feedback-types/{id}/:
    get:
      operationId: api_v2_feedback_feedback_types_retrieve
      description: API endpoint for viewing and editing feedback types.
      summary: List feedback types
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this feedback type.
          required: true
      tags:
        - Feedbacks
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackType'
          description: ''
  /api/v2/files:
    get:
      operationId: api_v2_files_list
      description: >-
        This endpoint can be used to get the list of available documents for
        your user account, with optional filtering by workspace, private, or
        company scope.
      summary: List available documents
      parameters:
        - in: query
          name: company_scope
          schema:
            type: boolean
          description: Include documents from the company collection if True.
        - in: query
          name: include_details
          schema:
            type: boolean
          description: >-
            Include detail fields (e.g., TLSH signature for duplicate
            detection). Default: false.
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - in: query
          name: private_scope
          schema:
            type: boolean
          description: Include documents from the user's private collection if True.
        - in: query
          name: tags
          schema:
            type: string
          description: Comma-separated list of tag IDs to filter by.
        - in: query
          name: workspace_scope
          schema:
            type: integer
          description: Include documents contained in workspace with ID given.
          explode: true
      tags:
        - Files
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedPaginatedFileListResponseSerializerV2List
          description: ''
    post:
      operationId: api_v2_files_create
      description: >-
        Endpoint to upload documents.


        Documents are saved to the persistent storage, parsed, chunked and
        embedded.


        The file is indexed as a document in the SQL database, with its chunks,
        and related to its owner, company and collection for permission
        application.


        To specify a workspace, set `collection_type` to one of the following:

        - `private` for a personal workspace

        - `company` for a company workspace

        - `workspace` for other workspaces


        If `workspace` is specified, `workspace_id` must be provided.


        If `collection_type` is not specified, it defaults to `company`.
      summary: Upload a document
      tags:
        - Files
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileCreateRequestSerializerV2'
        required: true
      security:
        - bearerAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileCreateResponseSerializerV2'
              examples:
                FileUploadedSuccessfully:
                  value:
                    id: 1
                    object: list
                    bytes: 20032
                    created_at: 1631533200
                    filename: document.pdf
                    purpose: documents
                    status: embedded
                  summary: File uploaded successfully
          description: ''
  /api/v2/files/{id}/ask-question:
    post:
      operationId: api_v2_files_ask_question_create
      description: |-
        This endpoint can be used to ask a question about a document.

        The question is required and should be a string .

        The id of the document is a path parameter.
      summary: Generate an answer with a single document
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
      tags:
        - Files
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AskQuestionRequest'
            examples:
              ExampleQuestionString:
                value:
                  question: example question
                summary: example question string
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AskQuestionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AskQuestionRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AskQuestionResponse'
          description: ''
  /api/v2/files/{id}:
    get:
      operationId: api_v2_files_retrieve
      description: >-
        Retrieve a single document by its ID. 


        Only documents that the requesting user is authorized to access will be
        returned.
      summary: Retrieve a document
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The ID of the document to retrieve.
          required: true
        - in: query
          name: include_content
          schema:
            type: boolean
          description: Include the content of the document in the response.
      tags:
        - Files
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileRetrieveResponseSerializerV2'
          description: ''
    delete:
      operationId: api_v2_files_destroy
      description: >-
        Deletes a document and its associated embeddings.


        This endpoint deletes a document from the database and removes its
        associated embeddings.


        The document is identified by its unique ID.


        This operation requires authentication and permission to delete the
        document.
      summary: Delete a document
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Document.
          required: true
      tags:
        - Files
      security:
        - bearerAuth: []
      responses:
        '204':
          description: No response body
  /api/v2/files/{id}/chunks:
    get:
      operationId: api_v2_files_chunks_retrieve
      description: This endpoint returns all chunks for a given document.
      summary: Retrieve chunks from a document
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Document.
          required: true
      tags:
        - Files
      security:
        - bearerAuth: []
      responses:
        '200':
          description: No response body
  /api/v2/filter/chunks:
    post:
      operationId: api_v2_filter_chunks_create
      description: >+
        This endpoint can be used to filter document chunks based on a given
        query.


        The query should be a single string.


        Chunk ids should be a list of strings. Each string should be the UUID of
        an existing document chunk.


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


        An optional integer `n` can be provided, which can be used to return the
        first `n` chunks that pass the filter.

      summary: Filter most relevant chunks
      tags:
        - Files Search
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChunkFilterRequestSerializerV2'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ChunkFilterRequestSerializerV2'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ChunkFilterRequestSerializerV2'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChunkFilterResponseSerializerV2'
          description: ''
  /api/v2/models:
    get:
      operationId: api_v2_models_retrieve
      description: >-
        This endpoint can be used to get the list of available models for your
        API key.
      summary: List available models
      tags:
        - Models
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListMLModelsResponse'
          description: ''
  /api/v2/platform/status:
    get:
      operationId: api_v2_platform_status_retrieve
      description: >-
        Returns the current platform load status including whether any models
        are experiencing high load.
      summary: Get platform load status
      tags:
        - Platform Status
      security:
        - bearerAuth: []
      responses:
        '200':
          description: No response body
        '500':
          content:
            application/json:
              schema:
                description: Internal server error
          description: ''
  /api/v2/query:
    post:
      operationId: api_v2_query_create
      description: >-
        This endpoint can be used to retrieve top n chunks per query.


        The query can be a single string or a list of strings.


        The `collection` field can be used to specify the collection to query,
        which defaults to `base_collection`.


        An optional integer `n` can be provided in order to retrieve top n
        chunks, which defaults to 5 if not specified.


        **Response**: Returns an array of results, one for each input query.
      summary: Extract chunks from knowledge base
      tags:
        - Files Search
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RetrieveRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RetrieveRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RetrieveRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RetrieveResponse'
          description: ''
  /api/v2/query/reformulation:
    post:
      operationId: api_v2_query_reformulation_create
      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.

      summary: Reformulate an extraction query
      tags:
        - Files Search
      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
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/QueryReformulationResponse'
          description: ''
  /api/v2/rate/{feedback_type_id}/{completion_id}:
    post:
      operationId: api_v2_rate_create
      description: Log a feedback of a given type and linked to an existing completion.
      summary: Create a completion feedback
      parameters:
        - in: path
          name: completion_id
          schema:
            type: string
          required: true
        - in: path
          name: feedback_type_id
          schema:
            type: integer
          required: true
      tags:
        - Feedbacks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Feedback'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Feedback'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Feedback'
      security:
        - bearerAuth: []
      responses:
        '200':
          description: No response body
  /api/v2/reporting/chat-sessions/:
    get:
      operationId: api_v2_reporting_chat_sessions_retrieve
      description: |-
        This endpoint allows retrieving company chat sessions report.

        The start date is required, but the end date is by default today.

        It is restricted to admin and company admin users.

        Admin users can optionally filter by company.
      summary: Get company chat sessions report
      parameters:
        - in: query
          name: company_id
          schema:
            type: integer
          description: The unique identifier of the company (for admin users only).
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: The end date for the report (defaults to today).
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: The start date for the report.
          required: true
      tags:
        - Reporting
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionsReportResponse'
          description: ''
  /api/v2/reporting/chats-feedback/:
    get:
      operationId: api_v2_reporting_chats_feedback_retrieve
      description: |-
        This endpoint allows retrieving company chats feedback report.

        The start date is required, but the end date is by default today.

        It is restricted to admin and company admin users.

        Admin users can optionally filter by company.
      summary: Get feedbacks report
      parameters:
        - in: query
          name: company_id
          schema:
            type: integer
          description: The unique identifier of the company (for admin users only).
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: The end date for the report (defaults to today).
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: The start date for the report.
          required: true
      tags:
        - Reporting
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatsFeedbackReportResponse'
          description: ''
  /api/v2/reporting/tools/:
    get:
      operationId: api_v2_reporting_tools_retrieve
      description: >-
        This endpoint allows you to retrieve a company's tools and third-party
        tools report.


        The start date is required, but the end date is by default today.


        It is restricted to admin and company admin users.


        Admin users can optionally filter by company.
      summary: Get company tools report
      parameters:
        - in: query
          name: company_id
          schema:
            type: integer
          description: The unique identifier of the company (for admin users only).
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: The end date for the report (defaults to today).
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: The start date for the report.
          required: true
      tags:
        - Reporting
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolsReportResponse'
          description: ''
  /api/v2/reporting/used-documents/:
    get:
      operationId: api_v2_reporting_used_documents_retrieve
      description: |-
        This endpoint allows retrieving company used documents report.

        The start date is required, but the end date is by default today.

        It is restricted to admin and company admin users.

        Admin users can optionally filter by company.
      summary: Get documents usage report
      parameters:
        - in: query
          name: company_id
          schema:
            type: integer
          description: The unique identifier of the company (for admin users only).
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: The end date for the report (defaults to today).
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: The start date for the report.
          required: true
      tags:
        - Reporting
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsedDocumentsReportResponse'
          description: ''
  /api/v2/reporting/users/:
    get:
      operationId: api_v2_reporting_users_retrieve
      description: |-
        This endpoint allows you to retrieve a company's members report.

        The start date is required, but the end date is by default today.

        It is restricted to admin and company admin users.

        Admin users can optionally filter by company.
      summary: Get company members report
      parameters:
        - in: query
          name: company_id
          schema:
            type: integer
          description: The unique identifier of the company (for admin users only).
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: The end date for the report (defaults to today).
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: The start date for the report.
          required: true
      tags:
        - Reporting
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveUsersReportResponse'
          description: ''
  /api/v2/tokenize:
    post:
      operationId: api_v2_tokenize_create
      description: |-
        This endpoint can be used to convert strings into tokens.

        It is a simple proxy forwarding your requests to the desired model.

        Any LightOn model is deployed on a vLLM-based image.

        **Supported Input:**
        - `prompt`: Simple text string to tokenize
        - `messages`: Array of chat messages to tokenize (alternative to prompt)
      summary: Create text tokens
      tags:
        - Models
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenizeRequest'
            examples:
              TextTokenizationExample:
                value:
                  model: alfred-4.2
                  prompt: Hello, how are you today?
                summary: Text tokenization example
              MessagesTokenizationExample:
                value:
                  model: alfred-4.2
                  messages:
                    - role: system
                      content: You are a helpful assistant.
                    - role: user
                      content: Hello!
                summary: Messages tokenization example
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TokenizeRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TokenizeRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenizeResponse'
          description: ''
  /api/v2/upload-session:
    post:
      operationId: api_v2_upload_session_create
      description: Create a new upload session
      summary: Create an upload session
      tags:
        - Upload Sessions
      security:
        - bearerAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadSessionResponse'
          description: ''
  /api/v2/upload-session/{uuid}:
    get:
      operationId: api_v2_upload_session_retrieve
      description: Retrieve the details of an upload session.
      summary: Retrieve an upload session
      parameters:
        - in: path
          name: uuid
          schema:
            type: string
          description: The UUID of the upload session
          required: true
      tags:
        - Upload Sessions
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadSessionResponse'
          description: ''
        '404':
          description: No response body
    post:
      operationId: api_v2_upload_session_create_2
      description: Upload a new file to an existing upload session
      summary: Add a file to an upload session
      parameters:
        - in: path
          name: uuid
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Upload Sessions
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileCreateRequestSerializerV2'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadSessionFileAdditionResponse'
          description: ''
    delete:
      operationId: api_v2_upload_session_destroy
      description: Delete a session and all its documents
      summary: Delete an upload session
      parameters:
        - in: path
          name: uuid
          schema:
            type: string
            format: uuid
          required: true
      tags:
        - Upload Sessions
      security:
        - bearerAuth: []
      responses:
        '204':
          description: No response body
  /api/v2/upload-session/deactivate:
    post:
      operationId: api_v2_upload_session_deactivate_create
      description: >-
        Interrupt and deactivate ongoing upload sessions of the user sending the
        request.


        The pending documents in the upload sessions are deleted.
      summary: Deactivate upload sessions
      tags:
        - Upload Sessions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeactivateUploadSessionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DeactivateUploadSessionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DeactivateUploadSessionRequest'
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeactivateUploadSessionResponse'
          description: ''
  /api/v2/users/:
    get:
      operationId: api_v2_users_list
      description: >-
        This endpoint allows you to list all members of the requested user's
        company.


        It is restricted to admin and company admin users.


        Admin users can optionally filter members by company.
      summary: List company members
      parameters:
        - in: query
          name: company_id
          schema:
            type: integer
          description: The unique identifier of the company (for admin users only).
        - in: query
          name: is_active
          schema:
            type: boolean
          description: Filter users by their active status.
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
      tags:
        - Users
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCompanyMemberResponseList'
          description: ''
  /api/v2/users/{id}:
    get:
      operationId: api_v2_users_retrieve
      description: |-
        This endpoint allows you to retrieve the details of a company member.

        It is restricted to admin and company admin users.
      summary: Retrieve a company member
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the user.
          required: true
      tags:
        - Users
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyMemberResponse'
          description: ''
  /api/v2/users/{id}/groups/update/:
    put:
      operationId: api_v2_users_groups_update_update
      description: >-
        Warning: This endpoint will be deleted in the future, use the
        /users/<int:id>/roles/update/ instead.This endpoint allows you to update
        the groups of a company member.


        Note that this will update all the groups of the member.


        It is restricted to admin and company admin users.
      summary: Update groups of a company member
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the user.
          required: true
      tags:
        - Users
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCompanyMemberGroupsRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateCompanyMemberGroupsRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateCompanyMemberGroupsRequest'
      security:
        - bearerAuth: []
      deprecated: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeprecatedCompanyMemberResponse'
          description: ''
  /api/v2/users/{id}/roles/update/:
    put:
      operationId: api_v2_users_roles_update_update
      description: |-
        This endpoint allows you to update the roles of a company member.

        Note that this will update all the roles of the member.

        It is restricted to admin and company admin users.
      summary: Update roles of a company member
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the user.
          required: true
      tags:
        - Users
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCompanyMemberRolesRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateCompanyMemberRolesRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateCompanyMemberRolesRequest'
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyMemberResponse'
          description: ''
  /api/v2/users/{id}/update/:
    patch:
      operationId: api_v2_users_update_partial_update
      description: |-
        This endpoint allows you to update the details of a company member.

        It is restricted to admin and company admin users.
      summary: Update a company member
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the user.
          required: true
      tags:
        - Users
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUpdateCompanyMemberRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUpdateCompanyMemberRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUpdateCompanyMemberRequest'
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyMemberResponse'
          description: ''
  /api/v2/users/{id}/workspaces/update/:
    put:
      operationId: api_v2_users_workspaces_update_update
      description: |-
        This endpoint allows you to update the workspaces of a company member.

        Note that this will update all the workspaces of the member.

        It is restricted to admin and company admin users.
      summary: Update workspaces of a company member
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the user.
          required: true
      tags:
        - Users
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCompanyMemberWorkspacesRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateCompanyMemberWorkspacesRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateCompanyMemberWorkspacesRequest'
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyMemberResponse'
          description: ''
  /api/v2/workspaces/{id}:
    get:
      operationId: api_v2_workspaces_retrieve
      description: >-
        This endpoint allows to retrieve a workspace with his relations (members
        and collections).


        It is restricted to admin and company admin users.
      summary: Retrieve a workspace
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the workspace.
          required: true
      tags:
        - Workspaces
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceWithRelationsResponse'
          description: ''
  /api/v2/workspaces/{id}/members/update/:
    put:
      operationId: api_v2_workspaces_members_update_update
      description: |-
        This endpoint allows you to update the members of a workspace.

        Note that this will update all the members of the workspace.

        It is restricted to admin and company admin users.
      summary: Update workspace members
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the workspace.
          required: true
      tags:
        - Workspaces
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWorkspaceMembersRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateWorkspaceMembersRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateWorkspaceMembersRequest'
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceWithRelationsResponse'
          description: ''
  /api/v2/workspaces/{id}/update/:
    patch:
      operationId: api_v2_workspaces_update_partial_update
      description: |-
        This endpoint allows you to update a workspace within a company.

        It is restricted to admin and company admin users.
      summary: Update a workspace
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: The unique identifier of the workspace.
          required: true
      tags:
        - Workspaces
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUpdateWorkspaceRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUpdateWorkspaceRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUpdateWorkspaceRequest'
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceWithRelationsResponse'
          description: ''
  /scim/v2/Groups:
    get:
      operationId: scim_v2_Groups_retrieve
      description: >-
        Automatic filtering on company defined in
        get_extra_model_filter_kwargs_getter()

        We disable PUT as Microsoft does not need it
      summary: List or Retrieve a group
      tags:
        - SCIM
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroupResponse'
          description: Groups list
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
    post:
      operationId: scim_v2_Groups_create
      description: >-
        Automatic filtering on company defined in
        get_extra_model_filter_kwargs_getter()

        We disable PUT as Microsoft does not need it
      summary: Create a group
      tags:
        - SCIM
      security:
        - bearerAuth: []
      responses:
        '201':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroupCreateResponse'
          description: Groups creation
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
    patch:
      operationId: scim_v2_Groups_partial_update
      description: >-
        Automatic filtering on company defined in
        get_extra_model_filter_kwargs_getter()

        We disable PUT as Microsoft does not need it
      summary: Update a group
      tags:
        - SCIM
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMGroupModifyRequest'
            examples:
              RenameTheGroup:
                value:
                  schemas:
                    - urn:ietf:params:scim:api:messages:2.0:PatchOp
                  Operations:
                    - op: replace
                      path: displayName
                      value: 1879db59-3bdf-4490-ad68-ab880a269474updatedDisplayName
                summary: Rename the group
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSCIMGroupModifyRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSCIMGroupModifyRequest'
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroupCreateResponse'
          description: Modified group
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
        '404':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                GroupNotFound:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Resource 123 not found
                    status: 404
                  summary: Group not found
          description: ''
    delete:
      operationId: scim_v2_Groups_destroy
      description: >-
        Automatic filtering on company defined in
        get_extra_model_filter_kwargs_getter()

        We disable PUT as Microsoft does not need it
      summary: Delete a group
      tags:
        - SCIM
      security:
        - bearerAuth: []
      responses:
        '204':
          description: Group successfully deleted
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
        '404':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                GroupNotFound:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Resource 123 not found
                    status: 404
                  summary: Group not found
          description: ''
  /scim/v2/ResourceTypes:
    get:
      operationId: scim_v2_ResourceTypes_retrieve
      summary: List or Retrieve resource types
      tags:
        - SCIM
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMResourceTypesResponse'
          description: Resource Types list
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
  /scim/v2/Schemas:
    get:
      operationId: scim_v2_Schemas_retrieve
      summary: List or Retrieve schemas
      tags:
        - SCIM
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMSchemasResponse'
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
  /scim/v2/ServiceProviderConfig:
    get:
      operationId: scim_v2_ServiceProviderConfig_retrieve
      summary: Retrieve Service Provider Configuration
      tags:
        - SCIM
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMServiceProviderConfigResponse'
          description: Service provider configuration response
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
  /scim/v2/Users:
    get:
      operationId: scim_v2_Users_retrieve
      description: >-
        Automatic filtering on company defined in
        get_extra_model_filter_kwargs_getter()
      summary: List or Retrieve users
      tags:
        - SCIM
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMPaginatedUsers'
          description: Users list
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
    post:
      operationId: scim_v2_Users_create
      description: >-
        Automatic filtering on company defined in
        get_extra_model_filter_kwargs_getter()
      summary: Create a user
      tags:
        - SCIM
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SCIMUserRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SCIMUserRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SCIMUserRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: Created user
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
    put:
      operationId: scim_v2_Users_update
      description: >-
        Automatic filtering on company defined in
        get_extra_model_filter_kwargs_getter()
      summary: Replace a user
      tags:
        - SCIM
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SCIMUserRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SCIMUserRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SCIMUserRequest'
        required: true
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: Replaced user
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
        '404':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                UserNotFound:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Resource 123 not found
                    status: 404
                  summary: User not found
          description: ''
    patch:
      operationId: scim_v2_Users_partial_update
      description: >-
        Automatic filtering on company defined in
        get_extra_model_filter_kwargs_getter()
      summary: Update a user
      tags:
        - SCIM
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMUserModifyRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSCIMUserModifyRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSCIMUserModifyRequest'
      security:
        - bearerAuth: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: Modified user
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
        '404':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                UserNotFound:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Resource 123 not found
                    status: 404
                  summary: User not found
          description: ''
    delete:
      operationId: scim_v2_Users_destroy
      description: >-
        Automatic filtering on company defined in
        get_extra_model_filter_kwargs_getter()
      summary: Delete a user
      tags:
        - SCIM
      security:
        - bearerAuth: []
      responses:
        '204':
          description: User successfully deleted
        '401':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                Unauthorized:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Unauthorized
                    status: 401
          description: Authentication required
        '404':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMErrorResponse'
              examples:
                UserNotFound:
                  value:
                    schemas:
                      - urn:ietf:params:scim:api:messages:2.0:Error
                    detail: Resource 123 not found
                    status: 404
                  summary: User not found
          description: ''
components:
  schemas:
    ActiveUsersReportMetadataResponse:
      type: object
      properties:
        total_historical_members:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        current_active_members:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
      required:
        - current_active_members
        - total_historical_members
    ActiveUsersReportResponse:
      type: object
      properties:
        reporting:
          type: array
          items:
            $ref: '#/components/schemas/CompanyActiveUserReport'
        metadata:
          $ref: '#/components/schemas/ActiveUsersReportMetadataResponse'
      required:
        - metadata
        - reporting
    Agent:
      type: object
      properties:
        user_queries_count:
          type: integer
        model_responses_with_docs_count:
          type: integer
        model_responses_count:
          type: integer
        last_model_response_date:
          type: string
          format: date-time
      required:
        - last_model_response_date
        - model_responses_count
        - model_responses_with_docs_count
        - user_queries_count
    AgentMetadata:
      type: object
      properties:
        description:
          type: string
        unit:
          type: string
      required:
        - description
        - unit
    AgentThreadReportPerDate:
      type: object
      properties:
        date:
          type: string
          format: date
        threads:
          $ref: '#/components/schemas/Threads'
        agents:
          $ref: '#/components/schemas/Agent'
      required:
        - agents
        - date
        - threads
    AskQuestionRequest:
      type: object
      description: Request serializer for asking a question about a document.
      properties:
        question:
          type: string
          description: The question to ask about the document
          maxLength: 2048
      required:
        - question
    AskQuestionResponse:
      type: object
      description: >-
        Response serializer for the result of asking a question about a
        document.
      properties:
        response:
          type: string
          description: The generated response to the question
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/DocumentChunkResponse'
          description: Relevant document chunks used to generate the response
      required:
        - chunks
        - response
    BlankEnum:
      enum:
        - ''
    Chat:
      type: object
      properties:
        user_queries_count:
          type: integer
        model_responses_with_docs_count:
          type: integer
        model_responses_count:
          type: integer
        last_model_response_date:
          type: string
          format: date-time
      required:
        - last_model_response_date
        - model_responses_count
        - model_responses_with_docs_count
        - user_queries_count
    ChatCompletionChoice:
      type: object
      description: Serializer for individual chat completion choices.
      properties:
        index:
          type: integer
          description: The index of this choice in the list of choices
        message:
          allOf:
            - $ref: '#/components/schemas/ChatMessageResponse'
          description: The chat message generated by the model
        finish_reason:
          type: string
          nullable: true
          description: The reason the model stopped generating tokens
      required:
        - index
        - message
    ChatCompletionsRequest:
      type: object
      description: Request serializer for chat completions endpoint (OpenAI-compatible).
      properties:
        model:
          type: string
          description: >-
            Model to use for generating chat completions, must exist and be
            configured from the admin
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessage'
          description: List of messages comprising the conversation so far
        max_tokens:
          type: integer
          description: Maximum number of tokens to generate
        temperature:
          type: number
          format: double
          description: Sampling temperature between 0 and 2
        top_p:
          type: number
          format: double
          description: Nucleus sampling parameter
        'n':
          type: integer
          description: Number of chat completion choices to generate
        stream:
          type: boolean
          description: Whether to stream back partial progress
        stop:
          type: array
          items:
            type: string
          description: Up to 4 sequences where the API will stop generating further tokens
        presence_penalty:
          type: number
          format: double
          description: >-
            Penalty for new tokens based on whether they appear in the text so
            far
        frequency_penalty:
          type: number
          format: double
          description: Penalty for new tokens based on their existing frequency in the text
        logit_bias:
          type: object
          additionalProperties: {}
          description: >-
            Modify the likelihood of specified tokens appearing in the
            completion
        user:
          type: string
          description: A unique identifier representing your end-user
        functions:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of functions the model may call
        function_call:
          type: string
          description: Controls how the model responds to function calls
      required:
        - messages
        - model
    ChatCompletionsResponse:
      type: object
      description: Response serializer for chat completions endpoint results.
      properties:
        id:
          type: string
          description: Unique identifier for the chat completion
        object:
          type: string
          description: Object type, always 'chat.completion'
        created:
          type: integer
          description: Unix timestamp of when the chat completion was created
        model:
          type: string
          description: The model used for generating the chat completion
        choices:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionChoice'
          description: List of chat completion choices generated by the model
        usage:
          allOf:
            - $ref: '#/components/schemas/CompletionUsage'
          description: Usage statistics for the chat completion request
      required:
        - choices
        - created
        - id
        - model
        - object
    ChatMessage:
      type: object
      description: Serializer for individual chat messages.
      properties:
        role:
          allOf:
            - $ref: '#/components/schemas/RoleEnum'
          description: |-
            The role of the message author

            * `system` - system
            * `user` - user
            * `assistant` - assistant
            * `function` - function
            * `tool` - tool
        content:
          oneOf:
            - type: string
              description: Plain text content
            - type: array
              items:
                type: object
              description: Structured content as a list of objects
          nullable: true
          description: The content of the message
        name:
          type: string
          description: Name of the message author (for function calls)
        function_call:
          type: object
          additionalProperties: {}
          description: Function call details (for assistant messages)
      required:
        - role
    ChatMessageResponse:
      type: object
      description: Serializer for chat message in responses.
      properties:
        role:
          type: string
          description: The role of the message author
        content:
          type: string
          nullable: true
          description: The content of the message
        function_call:
          type: object
          additionalProperties: {}
          description: Function call details (if applicable)
      required:
        - role
    ChatSessionsReportPerDate:
      type: object
      properties:
        date:
          type: string
          format: date
        sessions:
          $ref: '#/components/schemas/Session'
        chats:
          $ref: '#/components/schemas/Chat'
      required:
        - chats
        - date
        - sessions
    ChatSessionsReportResponse:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/RetrieveChatSessionsReportMetadata'
        reporting:
          type: array
          items:
            $ref: '#/components/schemas/CompanyChatSessionReport'
        metadata_agent:
          $ref: '#/components/schemas/RetrieveAgentThreadReportMetadata'
        reporting_agents:
          type: array
          items:
            $ref: '#/components/schemas/CompanyAgentThreadReport'
      required:
        - metadata
        - metadata_agent
        - reporting
        - reporting_agents
    ChatsFeedback:
      type: object
      properties:
        likes_count:
          type: integer
        dislikes_count:
          type: integer
        copies_count:
          type: integer
      required:
        - copies_count
        - dislikes_count
        - likes_count
    ChatsFeedbackReportPerDate:
      type: object
      properties:
        date:
          type: string
          format: date
        model_responses_count:
          type: integer
        feedbacks:
          $ref: '#/components/schemas/ChatsFeedback'
      required:
        - date
        - feedbacks
        - model_responses_count
    ChatsFeedbackReportResponse:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/RetrieveChatsFeedbackReportMetadata'
        reporting:
          type: array
          items:
            $ref: '#/components/schemas/CompanyChatsFeedBackReport'
      required:
        - metadata
        - reporting
    ChunkFilterRequestSerializerV2:
      type: object
      description: Request serializer for filtering document chunks based on a query.
      properties:
        query:
          type: string
          description: The query string to filter document chunks against
        chunk_ids:
          type: array
          items:
            type: string
          description: List of document chunk UUIDs to filter
        'n':
          type: integer
          nullable: true
          description: Maximum number of chunks to return (optional)
        model:
          type: string
          description: >-
            Model to use for the filtering, must exist and be configured. If no
            model is given, will try to use the 'reranker' finetune.
      required:
        - chunk_ids
        - model
        - query
    ChunkFilterResponseSerializerV2:
      type: object
      description: Response serializer for document chunk filtering results.
      properties:
        query:
          type: string
          description: The original query used for filtering
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/ChunkSerializerV2'
          description: List of filtered document chunks with their relevance scores
      required:
        - chunks
        - query
    ChunkItem:
      type: object
      description: Serializer for individual chunk items in upload requests.
      properties:
        benchmark_id:
          type: string
          description: Optional benchmark identifier for the chunk
        text:
          type: string
          description: Text content of the chunk to be uploaded
      required:
        - text
    ChunkSerializerV2:
      type: object
      description: Serializer for individual document chunks in filter responses.
      properties:
        uuid:
          type: string
          format: uuid
          description: Unique identifier for the document chunk
        text:
          type: string
          description: Text content of the document chunk
        metadata:
          type: object
          additionalProperties: {}
          description: Metadata associated with the document chunk
        filter_score:
          type: number
          format: double
          description: Relevance score assigned by the filtering model
      required:
        - filter_score
        - metadata
        - text
        - uuid
    ChunkTypeEnum:
      enum:
        - text
        - table
      type: string
      description: |-
        * `text` - text
        * `table` - table
    CollectionTypeEnum:
      enum:
        - private
        - company
        - workspace
      type: string
      description: |-
        * `private` - private
        * `company` - company
        * `workspace` - workspace
    CompanyActiveUserReport:
      type: object
      properties:
        company:
          $ref: '#/components/schemas/CompanyActiveUserReportCompany'
        total_historical_members:
          type: integer
        current_active_members:
          type: integer
      required:
        - company
        - current_active_members
        - total_historical_members
    CompanyActiveUserReportCompany:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    CompanyAgentThreadReport:
      type: object
      properties:
        company:
          $ref: '#/components/schemas/CompanyAgentThreadReportCompany'
        dates:
          type: array
          items:
            $ref: '#/components/schemas/AgentThreadReportPerDate'
      required:
        - company
        - dates
    CompanyAgentThreadReportCompany:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    CompanyChatSessionReport:
      type: object
      properties:
        company:
          $ref: '#/components/schemas/CompanyChatSessionReportCompanyInfo'
        dates:
          type: array
          items:
            $ref: '#/components/schemas/ChatSessionsReportPerDate'
      required:
        - company
        - dates
    CompanyChatSessionReportCompanyInfo:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    CompanyChatsFeedBackReport:
      type: object
      properties:
        company:
          $ref: '#/components/schemas/CompanyChatsFeedBackReportCompany'
        dates:
          type: array
          items:
            $ref: '#/components/schemas/ChatsFeedbackReportPerDate'
      required:
        - company
        - dates
    CompanyChatsFeedBackReportCompany:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    CompanyInfoResponse:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        created_at:
          type: string
          format: date-time
        max_users:
          type: integer
        dpo_email:
          type: string
          format: email
        allow_company_admins_to_manage_sso:
          type: boolean
        storage_limit_company_ws:
          type: number
          format: double
        storage_limit_personal_ws:
          type: number
          format: double
        storage_limit_custom_ws:
          type: number
          format: double
        active_members_count:
          type: integer
      required:
        - active_members_count
        - allow_company_admins_to_manage_sso
        - created_at
        - dpo_email
        - id
        - max_users
        - name
        - storage_limit_company_ws
        - storage_limit_custom_ws
        - storage_limit_personal_ws
    CompanyMemberCompany:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    CompanyMemberGroups:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type: string
        role:
          type: string
        category:
          type: string
        created_at:
          type: string
          format: date-time
      required:
        - category
        - created_at
        - description
        - id
        - name
        - role
    CompanyMemberResponse:
      type: object
      properties:
        id:
          type: integer
        username:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        is_active:
          type: boolean
        date_joined:
          type: string
          format: date-time
        account_expiration_date:
          type: string
          format: date-time
        last_login:
          type: string
          format: date-time
        invitation_status:
          type: string
        language:
          type: string
        company:
          $ref: '#/components/schemas/CompanyMemberCompany'
        roles:
          type: array
          items:
            $ref: '#/components/schemas/TenantUserRole'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/CompanyMemberGroups'
      required:
        - account_expiration_date
        - company
        - date_joined
        - email
        - first_name
        - groups
        - id
        - invitation_status
        - is_active
        - language
        - last_login
        - last_name
        - roles
        - username
    CompanyToolReport:
      type: object
      properties:
        company:
          $ref: '#/components/schemas/CompanyToolReportCompany'
        dates:
          type: array
          items:
            $ref: '#/components/schemas/ToolReportPerDate'
      required:
        - company
        - dates
    CompanyToolReportCompany:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    CompanyUsedDocumentsReport:
      type: object
      properties:
        company:
          $ref: '#/components/schemas/CompanyUsedDocumentsReportCompany'
        dates:
          type: array
          items:
            $ref: '#/components/schemas/UsedDocumentReportPerDate'
      required:
        - company
        - dates
    CompanyUsedDocumentsReportCompany:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    CompanyWorkspaceResponse:
      type: object
      description: Mixin providing get_membership_role method for workspace serializers.
      properties:
        id:
          type: integer
        name:
          type: string
        workspace_type:
          type: string
        document_upload_method:
          type: string
        description:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        summaries:
          type: array
          items:
            $ref: '#/components/schemas/WorkspaceSummaryResponse'
        user_role:
          type: string
          readOnly: true
      required:
        - created_at
        - description
        - document_upload_method
        - id
        - name
        - summaries
        - updated_at
        - user_role
        - workspace_type
    CompletionChoice:
      type: object
      description: Serializer for individual completion choices.
      properties:
        text:
          type: string
          description: The generated text completion
        index:
          type: integer
          description: The index of this choice in the list of choices
        logprobs:
          nullable: true
          description: Log probability information for the choice
        finish_reason:
          type: string
          nullable: true
          description: The reason the model stopped generating tokens
      required:
        - index
        - text
    CompletionUsage:
      type: object
      description: Serializer for token usage information.
      properties:
        prompt_tokens:
          type: integer
          description: Number of tokens in the prompt
        completion_tokens:
          type: integer
          description: Number of tokens in the completion
        total_tokens:
          type: integer
          description: Total number of tokens used in the request
      required:
        - completion_tokens
        - prompt_tokens
        - total_tokens
    CompletionsRequest:
      type: object
      description: Request serializer for completions endpoint (OpenAI-compatible).
      properties:
        model:
          type: string
          description: >-
            Model to use for generating completions, must exist and be
            configured from the admin
        prompt:
          type: string
          description: The prompt to generate completions for
        max_tokens:
          type: integer
          description: Maximum number of tokens to generate
        temperature:
          type: number
          format: double
          description: Sampling temperature between 0 and 2
        top_p:
          type: number
          format: double
          description: Nucleus sampling parameter
        'n':
          type: integer
          description: Number of completions to generate
        stream:
          type: boolean
          description: Whether to stream back partial progress
        logprobs:
          type: integer
          nullable: true
          description: Include the log probabilities on the logprobs most likely tokens
        echo:
          type: boolean
          description: Echo back the prompt in addition to the completion
        stop:
          type: array
          items:
            type: string
          description: Up to 4 sequences where the API will stop generating further tokens
        presence_penalty:
          type: number
          format: double
          description: >-
            Penalty for new tokens based on whether they appear in the text so
            far
        frequency_penalty:
          type: number
          format: double
          description: Penalty for new tokens based on their existing frequency in the text
        best_of:
          type: integer
          description: Generates multiple completions server-side and returns the best
        logit_bias:
          type: object
          additionalProperties: {}
          description: >-
            Modify the likelihood of specified tokens appearing in the
            completion
        user:
          type: string
          description: A unique identifier representing your end-user
        suffix:
          type: string
          description: The suffix that comes after a completion of inserted text
      required:
        - model
    CompletionsResponse:
      type: object
      description: Response serializer for completions endpoint results.
      properties:
        id:
          type: string
          description: Unique identifier for the completion
        object:
          type: string
          description: Object type, always 'text_completion'
        created:
          type: integer
          description: Unix timestamp of when the completion was created
        model:
          type: string
          description: The model used for generating the completion
        choices:
          type: array
          items:
            $ref: '#/components/schemas/CompletionChoice'
          description: List of completion choices generated by the model
        usage:
          allOf:
            - $ref: '#/components/schemas/CompletionUsage'
          description: Usage statistics for the completion request
      required:
        - choices
        - created
        - id
        - model
        - object
    CreateCompanyMemberRequest:
      type: object
      properties:
        first_name:
          type: string
        last_name:
          type: string
        account_expiration_date:
          type: string
          format: date-time
        language:
          $ref: '#/components/schemas/LanguageEnum'
        username:
          type: string
          pattern: ^[\w.@+-]+$
        email:
          type: string
          format: email
        groups:
          type: array
          items:
            type: integer
        roles:
          type: array
          items:
            type: integer
        is_active:
          type: boolean
          default: false
      required:
        - email
        - username
    CreateCompanyRequest:
      type: object
      properties:
        name:
          type: string
        dpo_email:
          type: string
          format: email
        max_users:
          type: integer
        allow_company_admins_to_manage_sso:
          type: boolean
          default: false
        storage_limit_company_ws:
          type: number
          format: double
          nullable: true
        storage_limit_personal_ws:
          type: number
          format: double
          nullable: true
        storage_limit_custom_ws:
          type: number
          format: double
          nullable: true
      required:
        - name
    CreateWorkspaceV2Request:
      type: object
      description: 'V2 API: Uses flat structure with separate members and groups fields'
      properties:
        name:
          type: string
        description:
          type: string
        members:
          type: array
          items:
            type: integer
        groups:
          type: array
          items:
            type: integer
        document_upload_method:
          allOf:
            - $ref: '#/components/schemas/DocumentUploadMethodEnum'
          default: manual
          description: |-
            Method for adding documents to this workspace

            * `manual` - manual
            * `synced` - synced
      required:
        - description
        - name
    DeactivateUploadSessionRequest:
      type: object
      description: Request serializer for deactivating upload sessions.
      properties:
        delete_pending_documents:
          type: boolean
          default: false
          description: Whether to delete pending documents when deactivating sessions
    DeactivateUploadSessionResponse:
      type: object
      description: Response serializer for upload session deactivation.
      properties:
        message:
          type: string
          description: Confirmation message about the session deactivation
      required:
        - message
    DeploymentTypeEnum:
      enum:
        - Self-Hosted
        - External
      type: string
      description: |-
        * `Self-Hosted` - Self Hosted
        * `External` - External
    DeprecatedCompanyMemberCompany:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    DeprecatedCompanyMemberGroups:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type: string
        role:
          type: string
        category:
          type: string
        created_at:
          type: string
          format: date-time
      required:
        - category
        - created_at
        - description
        - id
        - name
        - role
    DeprecatedCompanyMemberResponse:
      type: object
      properties:
        id:
          type: integer
        username:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        is_active:
          type: boolean
        date_joined:
          type: string
          format: date-time
        account_expiration_date:
          type: string
          format: date-time
        last_login:
          type: string
          format: date-time
        invitation_status:
          type: string
        language:
          type: string
        company:
          $ref: '#/components/schemas/DeprecatedCompanyMemberCompany'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/TenantUserGroup'
        teams:
          type: array
          items:
            $ref: '#/components/schemas/DeprecatedCompanyMemberGroups'
      required:
        - account_expiration_date
        - company
        - date_joined
        - email
        - first_name
        - groups
        - id
        - invitation_status
        - is_active
        - language
        - last_login
        - last_name
        - teams
        - username
    DocumentChunkResponse:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        uuid:
          type: string
          format: uuid
          readOnly: true
        content_id:
          type: string
          readOnly: true
          nullable: true
        text:
          type: string
          readOnly: true
        metadata:
          readOnly: true
        document:
          type: integer
          readOnly: true
          nullable: true
        document_attributes:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
        chunk_type:
          allOf:
            - $ref: '#/components/schemas/ChunkTypeEnum'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - chunk_type
        - content_id
        - created_at
        - document
        - document_attributes
        - id
        - metadata
        - text
        - updated_at
        - uuid
    DocumentUploadMethodEnum:
      enum:
        - manual
        - synced
      type: string
      description: |-
        * `manual` - manual
        * `synced` - synced
    ExternalMetadata:
      type: object
      properties:
        doc_id:
          type: string
          description: External document ID
        doc_type:
          type: string
          description: External document type
        name:
          type: string
          description: External document name
        version:
          type: string
          description: External document version
        mime_type:
          type: string
          description: External document MIME type
        created_at:
          type: string
          format: date-time
          description: Creation time of the external document
        modified_at:
          type: string
          format: date-time
          description: Last modification time of the external document
        last_synced_at:
          type: string
          format: date-time
          description: Last synced time of the external document
        external_url:
          type: string
          format: uri
          description: External document URL
        external_full_path:
          type: string
          description: Full path of the external document
      required:
        - doc_id
    Feedback:
      type: object
      properties:
        value:
          type: number
          format: double
          nullable: true
        flag:
          type: boolean
          nullable: true
          description: Field used in case of boolean type
        comment:
          type: string
          nullable: true
        tag:
          type: string
          nullable: true
          maxLength: 120
        display_value:
          oneOf:
            - type: boolean
            - type: string
            - type: number
              format: double
            - type: integer
          readOnly: true
      required:
        - display_value
    FeedbackType:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          nullable: true
          maxLength: 250
        value_type:
          $ref: '#/components/schemas/ValueTypeEnum'
        value_range_start:
          type: number
          format: double
          nullable: true
        value_range_end:
          type: number
          format: double
          nullable: true
        unique_feedback:
          type: boolean
          description: >-
            Defines if related feedback can have only one instance per
            completion or many
      required:
        - id
        - value_type
    FileCreateRequestSerializerV2:
      type: object
      description: Request serializer for file upload.
      properties:
        title:
          type: string
          nullable: true
          maxLength: 255
        filename:
          type: string
          nullable: true
          maxLength: 512
        file:
          type: string
          format: uri
        collection:
          type: integer
          nullable: true
        owner:
          type: integer
          writeOnly: true
          description: Owner of the file (optional)
        company:
          type: integer
          writeOnly: true
          description: Company to associate the file with (optional)
        content:
          type: string
          nullable: true
        file_type:
          type: string
          nullable: true
          maxLength: 30
        collection_type:
          allOf:
            - $ref: '#/components/schemas/CollectionTypeEnum'
          writeOnly: true
          description: >-
            Type of collection to store the file in (private, company, or
            workspace)


            * `private` - private

            * `company` - company

            * `workspace` - workspace
        workspace_id:
          type: integer
          writeOnly: true
          description: Workspace ID when collection_type is 'workspace'
        chunk_size:
          type: integer
          description: Size of chunks for document processing (optional)
        chunk_overlap:
          type: number
          format: double
          description: Overlap between chunks (optional)
        external_metadata:
          allOf:
            - $ref: '#/components/schemas/ExternalMetadata'
          nullable: true
          description: Additional external metadata for the document (optional)
        OCR_AGENT:
          type: string
          description: OCR agent to use for processing (optional)
        OCR_COMPLETE_DOC_TABLE_EXTRACTION:
          type: boolean
          nullable: true
          description: Enable complete document table extraction (optional)
        OCR_HI_RES_MODEL_NAME:
          type: string
          description: High resolution OCR model name (optional)
        OCR_STRATEGY:
          type: string
          description: OCR processing strategy (optional)
        OCR_TIMEOUT:
          type: integer
          description: OCR processing timeout in seconds (optional)
        OCR_URL:
          type: string
          description: OCR service URL (optional)
        IS_VISUAL_INGESTION_ON:
          type: boolean
          nullable: true
          description: Enable visual ingestion processing (optional)
        DEFAULT_PIPELINE:
          type: string
          description: Default processing pipeline to use (optional)
      required:
        - file
    FileCreateResponseSerializerV2:
      type: object
      description: Response serializer for file upload results.
      properties:
        id:
          type: integer
          description: Unique identifier for the uploaded file
        object:
          type: string
          readOnly: true
          description: Object type, always 'file'
        bytes:
          type: integer
          readOnly: true
          description: Size of the file in bytes
        created_at:
          type: integer
          readOnly: true
          description: Unix timestamp of when the file was created
        filename:
          type: string
          readOnly: true
          description: Original filename of the uploaded file
        purpose:
          type: string
          readOnly: true
          description: Purpose of the file, always 'documents'
        status:
          type: string
          readOnly: true
          description: Processing status of the file
      required:
        - bytes
        - created_at
        - filename
        - id
        - object
        - purpose
        - status
    FileListResponseSerializerV2:
      type: object
      description: Response serializer for file list results.
      properties:
        id:
          type: integer
          description: Unique identifier for the file
        object:
          type: string
          readOnly: true
          description: Object type, always 'file'
        created_at:
          type: integer
          readOnly: true
          description: Unix timestamp of when the file was created
        filename:
          type: string
          readOnly: true
          description: Original filename of the file
        purpose:
          type: string
          readOnly: true
          description: Purpose of the file, always 'documents'
        status:
          type: string
          readOnly: true
          description: Processing status of the file
        signature:
          type: string
          nullable: true
          description: >-
            TLSH hash for duplicate detection. Only included when
            include_details=true (detail field).
          readOnly: true
      required:
        - created_at
        - filename
        - id
        - object
        - purpose
        - signature
        - status
    FileRetrieveResponseSerializerV2:
      type: object
      description: Response serializer for file retrieve results.
      properties:
        id:
          type: integer
          description: Unique identifier for the file
        object:
          type: string
          readOnly: true
          description: Object type, always 'file'
        created_at:
          type: integer
          readOnly: true
          description: Unix timestamp of when the file was created
        filename:
          type: string
          readOnly: true
          description: Original filename of the file
        purpose:
          type: string
          readOnly: true
          description: Purpose of the file, always 'documents'
        status:
          type: string
          readOnly: true
          description: Processing status of the file
        signature:
          type: string
          nullable: true
          description: TLSH hash for duplicate detection.
          readOnly: true
        content:
          type: string
          description: Content of the file (included only when include_content=true)
      required:
        - created_at
        - filename
        - id
        - object
        - purpose
        - signature
        - status
    LanguageEnum:
      enum:
        - ar
        - en
        - fr
        - de
      type: string
      description: |-
        * `ar` - Arabic
        * `en` - English
        * `fr` - French
        * `de` - German
    ListMLModelsResponse:
      type: object
      description: Response serializer for listing available ML models.
      properties:
        object:
          type: string
          readOnly: true
          default: list
          description: Object type, always 'list' for model listings
        data:
          type: array
          items:
            $ref: '#/components/schemas/MLModelResponse'
          readOnly: true
          description: Array of available ML models and their finetunes
      required:
        - data
        - object
    MLModelResponse:
      type: object
      description: Serializer for individual ML model objects.
      properties:
        object:
          type: string
          readOnly: true
          default: model
          description: Object type, always 'model'
        name:
          type: string
          maxLength: 120
        model_type:
          $ref: '#/components/schemas/ModelTypeEnum'
        deployment_type:
          $ref: '#/components/schemas/DeploymentTypeEnum'
        enabled:
          type: boolean
        technical_name:
          type: string
          maxLength: 120
        start_messages_template:
          type: string
          description: >-
            List of dictionary of messages to be used to start the conversation.
            Authorized labels in the template: ['date', 'company_instructions',
            'user_first_name', 'user_last_name', 'user_instructions']
          maxLength: 5000
        is_default_for_company:
          type: boolean
          readOnly: true
      required:
        - is_default_for_company
        - name
        - object
    ModelTypeEnum:
      enum:
        - Large Language Model
        - Embedding Model
        - Vision Language Model
        - Multi-Vector Model
      type: string
      description: |-
        * `Large Language Model` - Large Language Model
        * `Embedding Model` - Embedding Model
        * `Vision Language Model` - Vision Language Model
        * `Multi-Vector Model` - Multi Vector Model
    OpEnum:
      enum:
        - add
        - remove
        - replace
      type: string
      description: |-
        * `add` - add
        * `remove` - remove
        * `replace` - replace
    PaginatedCompanyMemberResponseList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/CompanyMemberResponse'
    PaginatedCompanyWorkspaceResponseList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/CompanyWorkspaceResponse'
    PaginatedFeedbackTypeList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/FeedbackType'
    PaginatedFileListResponseSerializerV2:
      type: object
      description: Paginated response serializer for file list endpoint.
      properties:
        object:
          type: string
          default: list
          description: Object type, always 'list' for paginated responses
        count:
          type: integer
          description: Total number of files across all pages
        next:
          type: string
          format: uri
          nullable: true
          description: URL for the next page of results (null if this is the last page)
        previous:
          type: string
          format: uri
          nullable: true
          description: >-
            URL for the previous page of results (null if this is the first
            page)
        data:
          type: array
          items:
            $ref: '#/components/schemas/FileListResponseSerializerV2'
          description: Array of file objects for the current page
      required:
        - count
        - data
    PaginatedPaginatedFileListResponseSerializerV2List:
      type: object
      properties:
        object:
          type: string
          example: list
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: https://paradigm.lighton.ai/api/v2/files/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: https://paradigm.lighton.ai/api/v2/files/?page=2
        data:
          type: array
          items:
            $ref: '#/components/schemas/PaginatedFileListResponseSerializerV2'
    PatchedSCIMGroupModifyRequest:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:api:messages:2.0:PatchOp
        Operations:
          type: array
          items:
            $ref: '#/components/schemas/SCIMGroupModifyOperationRequest'
    PatchedSCIMUserModifyRequest:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:api:messages:2.0:PatchOp
        Operations:
          type: array
          items:
            $ref: '#/components/schemas/SCIMUserModifyOperationRequest'
    PatchedUpdateCompanyMemberRequest:
      type: object
      properties:
        first_name:
          type: string
        last_name:
          type: string
        account_expiration_date:
          type: string
          format: date-time
        language:
          $ref: '#/components/schemas/LanguageEnum'
    PatchedUpdateCompanyRequest:
      type: object
      properties:
        name:
          type: string
        dpo_email:
          type: string
          format: email
        max_users:
          type: integer
        allow_company_admins_to_manage_sso:
          type: boolean
          default: false
        storage_limit_company_ws:
          type: number
          format: double
          nullable: true
        storage_limit_personal_ws:
          type: number
          format: double
          nullable: true
        storage_limit_custom_ws:
          type: number
          format: double
          nullable: true
    PatchedUpdateWorkspaceRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
    PreferredLanguageEnum:
      enum:
        - ar
        - en
        - fr
        - de
      type: string
      description: |-
        * `ar` - Arabic
        * `en` - English
        * `fr` - French
        * `de` - German
    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
    ReportsMetadataItemResponse:
      type: object
      properties:
        description:
          type: string
        unit:
          type: string
      required:
        - description
        - unit
    RetrieveAgentThreadReportMetadata:
      type: object
      properties:
        threads_count:
          $ref: '#/components/schemas/AgentMetadata'
        unique_models_count:
          $ref: '#/components/schemas/AgentMetadata'
        average_thread_length:
          $ref: '#/components/schemas/AgentMetadata'
        user_queries_count:
          $ref: '#/components/schemas/AgentMetadata'
        model_responses_with_docs_count:
          $ref: '#/components/schemas/AgentMetadata'
        model_responses_count:
          $ref: '#/components/schemas/AgentMetadata'
        last_model_response_date:
          $ref: '#/components/schemas/AgentMetadata'
      required:
        - average_thread_length
        - last_model_response_date
        - model_responses_count
        - model_responses_with_docs_count
        - threads_count
        - unique_models_count
        - user_queries_count
    RetrieveChatSessionsReportMetadata:
      type: object
      properties:
        sessions_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        model_responses_with_docs_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        unique_models_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        average_session_length:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        user_queries_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        model_responses_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        last_model_response_date:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
      required:
        - average_session_length
        - last_model_response_date
        - model_responses_count
        - model_responses_with_docs_count
        - sessions_count
        - unique_models_count
        - user_queries_count
    RetrieveChatsFeedbackReportMetadata:
      type: object
      properties:
        likes_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        dislikes_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        copies_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
        model_responses_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
      required:
        - copies_count
        - dislikes_count
        - likes_count
        - model_responses_count
    RetrieveRequest:
      type: object
      description: Request serializer for retrieving top n chunks per query.
      properties:
        query:
          type: string
          description: A single string or a list of strings representing the search queries
        collection:
          type: string
          nullable: true
          description: >-
            The collection to query, defaults to 'base_collection' if not
            specified
        'n':
          type: integer
          nullable: true
          description: >-
            Number of top chunks to retrieve per query, defaults to 5 if not
            specified
      required:
        - query
    RetrieveResponse:
      type: object
      description: Response serializer for document chunk retrieval results.
      properties:
        query:
          type: string
          description: The original query used for retrieval
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/RetrieveResultChunk'
          description: List of retrieved document chunks with their relevance scores
      required:
        - chunks
    RetrieveResultChunk:
      type: object
      description: Serializer for individual document chunks in retrieve results.
      properties:
        uuid:
          type: string
          format: uuid
          description: Unique identifier for the document chunk
        text:
          type: string
          description: Text content of the document chunk
        metadata:
          type: object
          additionalProperties: {}
          description: Metadata associated with the document chunk
        score:
          type: number
          format: double
          description: Relevance score for this chunk relative to the query
      required:
        - metadata
        - score
        - text
        - uuid
    RetrieveUsedDocumentsReportMetadata:
      type: object
      properties:
        usage_count:
          $ref: '#/components/schemas/ReportsMetadataItemResponse'
      required:
        - usage_count
    RoleEnum:
      enum:
        - system
        - user
        - assistant
        - function
        - tool
      type: string
      description: |-
        * `system` - system
        * `user` - user
        * `assistant` - assistant
        * `function` - function
        * `tool` - tool
    SCIMAuthenticationScheme:
      type: object
      properties:
        type:
          type: string
          description: Authentication scheme type (e.g., 'oauth2', 'httpbasic')
        name:
          type: string
          description: The common authentication scheme name
        description:
          type: string
          description: A description of the authentication scheme
        specUri:
          type: string
          format: uri
          description: HTTP addressable URL pointing to the specification
        documentationUri:
          type: string
          format: uri
          description: HTTP addressable URL pointing to the documentation
        primary:
          type: boolean
          default: false
          description: Whether this is a primary authentication scheme
      required:
        - description
        - name
        - type
    SCIMErrorResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:api:messages:2.0:Error
        detail:
          type: string
        status:
          type: integer
      required:
        - detail
        - status
    SCIMGroupCreateMetaResponse:
      type: object
      properties:
        resourceType:
          type: string
          default: Group
        created:
          type: string
          format: date-time
        lastModified:
          type: string
          format: date-time
      required:
        - created
        - lastModified
    SCIMGroupCreateResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:schemas:core:2.0:Group
        id:
          type: string
          readOnly: true
        externalId:
          type: string
          readOnly: true
        meta:
          allOf:
            - $ref: '#/components/schemas/SCIMGroupCreateMetaResponse'
          readOnly: true
        displayName:
          type: string
        members:
          type: array
          items:
            $ref: '#/components/schemas/SCIMGroupMemberResponse'
      required:
        - displayName
        - externalId
        - id
        - members
        - meta
    SCIMGroupMemberResponse:
      type: object
      properties:
        value:
          type: string
        display:
          type: string
      required:
        - display
        - value
    SCIMGroupMetaResponse:
      type: object
      properties:
        resourceType:
          type: string
          default: Group
        location:
          type: string
      required:
        - location
    SCIMGroupModifyOperationRequest:
      type: object
      properties:
        op:
          $ref: '#/components/schemas/OpEnum'
        path:
          type: string
        value:
          type: string
      required:
        - op
        - path
        - value
    SCIMGroupResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:schemas:core:2.0:Group
        displayName:
          type: string
        members:
          type: array
          items:
            $ref: '#/components/schemas/SCIMGroupMemberResponse'
        meta:
          allOf:
            - $ref: '#/components/schemas/SCIMGroupMetaResponse'
          readOnly: true
      required:
        - displayName
        - members
        - meta
    SCIMPaginatedUsers:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:api:messages:2.0:ListResponse
        totalResults:
          type: integer
          default: 0
        itemsPerPage:
          type: integer
          default: 50
        startIndex:
          type: integer
          default: 0
        Resources:
          type: array
          items:
            $ref: '#/components/schemas/SCIMUserResponse'
      required:
        - Resources
    SCIMResourceTypesMetaResponse:
      type: object
      properties:
        resourceType:
          type: string
          default: ResourceType
        location:
          type: string
      required:
        - location
    SCIMResourceTypesResourceResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:schemas:core:2.0:ResourceType
        id:
          type: string
        name:
          type: string
        endpoint:
          type: string
        description:
          type: string
        schema:
          type: string
        meta:
          $ref: '#/components/schemas/SCIMResourceTypesMetaResponse'
      required:
        - description
        - endpoint
        - id
        - meta
        - name
        - schema
    SCIMResourceTypesResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:api:messages:2.0:ListResponse
        Resources:
          type: array
          items:
            $ref: '#/components/schemas/SCIMResourceTypesResourceResponse'
      required:
        - Resources
    SCIMSchemasAttributesResponse:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        multiValued:
          type: boolean
        description:
          type: string
        required:
          type: boolean
        caseExact:
          type: boolean
        mutability:
          type: string
        returned:
          type: string
        uniqueness:
          type: string
      required:
        - caseExact
        - description
        - multiValued
        - mutability
        - name
        - required
        - returned
        - type
        - uniqueness
    SCIMSchemasMetaResponse:
      type: object
      properties:
        resourceType:
          type: string
          default: Schema
        location:
          type: string
      required:
        - location
    SCIMSchemasResourceResponse:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
          readOnly: true
        description:
          type: string
          readOnly: true
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/SCIMSchemasAttributesResponse'
          readOnly: true
        meta:
          allOf:
            - $ref: '#/components/schemas/SCIMSchemasMetaResponse'
          readOnly: true
          nullable: true
      required:
        - attributes
        - description
        - id
        - meta
        - name
    SCIMSchemasResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:api:messages:2.0:ListResponse
        Resources:
          type: array
          items:
            $ref: '#/components/schemas/SCIMSchemasResourceResponse'
      required:
        - Resources
    SCIMServiceProviderBulk:
      type: object
      properties:
        supported:
          type: boolean
          default: false
        maxOperations:
          type: integer
        maxPayloadSize:
          type: integer
      required:
        - maxOperations
        - maxPayloadSize
    SCIMServiceProviderConfigResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig
        documentationUri:
          type: string
        patch:
          $ref: '#/components/schemas/SCIMServiceProviderSupported'
        bulk:
          $ref: '#/components/schemas/SCIMServiceProviderBulk'
        filter:
          $ref: '#/components/schemas/SCIMServiceProviderFilter'
        changePassword:
          $ref: '#/components/schemas/SCIMServiceProviderSupported'
        sort:
          $ref: '#/components/schemas/SCIMServiceProviderSupported'
        etag:
          $ref: '#/components/schemas/SCIMServiceProviderSupported'
        authenticationSchemes:
          $ref: '#/components/schemas/SCIMAuthenticationScheme'
        meta:
          $ref: '#/components/schemas/SCIMServiceProviderMeta'
      required:
        - authenticationSchemes
        - bulk
        - changePassword
        - documentationUri
        - etag
        - filter
        - meta
        - patch
        - sort
    SCIMServiceProviderFilter:
      type: object
      properties:
        supported:
          type: boolean
          default: false
        maxResults:
          type: integer
      required:
        - maxResults
    SCIMServiceProviderMeta:
      type: object
      properties:
        location:
          type: string
        resourceType:
          type: string
          default: ServiceProviderConfig
      required:
        - location
    SCIMServiceProviderSupported:
      type: object
      properties:
        supported:
          type: boolean
          default: false
    SCIMUserEmailRequest:
      type: object
      properties:
        value:
          type: string
      required:
        - value
    SCIMUserEmailResponse:
      type: object
      properties:
        value:
          type: string
        primary:
          type: boolean
      required:
        - primary
        - value
    SCIMUserGroupResponse:
      type: object
      properties:
        value:
          type: string
        display:
          type: string
      required:
        - display
        - value
    SCIMUserMetaResponse:
      type: object
      properties:
        resourceType:
          type: string
          default: User
        created:
          type: string
          format: date-time
        lastModified:
          type: string
          format: date-time
        location:
          type: string
      required:
        - created
        - lastModified
        - location
    SCIMUserModifyOperationRequest:
      type: object
      properties:
        op:
          $ref: '#/components/schemas/OpEnum'
        path:
          type: string
        value:
          type: string
      required:
        - op
        - path
        - value
    SCIMUserNameRequest:
      type: object
      properties:
        givenName:
          type: string
        familyName:
          type: string
      required:
        - familyName
        - givenName
    SCIMUserNameResponse:
      type: object
      properties:
        givenName:
          type: string
        familyName:
          type: string
        formatted:
          type: string
      required:
        - familyName
        - formatted
        - givenName
    SCIMUserRequest:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:schemas:core:2.0:User
        externalId:
          type: string
        userName:
          type: string
        name:
          $ref: '#/components/schemas/SCIMUserNameRequest'
        displayName:
          type: string
        emails:
          $ref: '#/components/schemas/SCIMUserEmailRequest'
        title:
          type: string
        preferredLanguage:
          oneOf:
            - $ref: '#/components/schemas/PreferredLanguageEnum'
            - $ref: '#/components/schemas/BlankEnum'
        active:
          type: boolean
        password:
          type: string
      required:
        - active
        - displayName
        - emails
        - externalId
        - name
        - password
        - preferredLanguage
        - title
        - userName
    SCIMUserResponse:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          readOnly: true
          default:
            - urn:ietf:params:scim:schemas:core:2.0:User
        id:
          type: string
          readOnly: true
        externalId:
          type: string
          readOnly: true
        userName:
          type: string
          readOnly: true
        name:
          allOf:
            - $ref: '#/components/schemas/SCIMUserNameResponse'
          readOnly: true
        displayName:
          type: string
          readOnly: true
        emails:
          type: array
          items:
            $ref: '#/components/schemas/SCIMUserEmailResponse'
          readOnly: true
        title:
          type: string
          readOnly: true
        preferredLanguage:
          allOf:
            - $ref: '#/components/schemas/PreferredLanguageEnum'
          readOnly: true
        active:
          type: boolean
          readOnly: true
        groups:
          type: array
          items:
            $ref: '#/components/schemas/SCIMUserGroupResponse'
          readOnly: true
        meta:
          allOf:
            - $ref: '#/components/schemas/SCIMUserMetaResponse'
          readOnly: true
      required:
        - active
        - displayName
        - emails
        - externalId
        - groups
        - id
        - meta
        - name
        - preferredLanguage
        - schemas
        - title
        - userName
    Session:
      type: object
      properties:
        sessions_count:
          type: integer
        unique_models_count:
          type: integer
        average_session_length:
          type: number
          format: double
      required:
        - average_session_length
        - sessions_count
        - unique_models_count
    StatusEnum:
      enum:
        - pending
        - parsing
        - parsing_failed
        - embedding
        - embedding_failed
        - embedded
        - fail
        - updating
      type: string
      description: |-
        * `pending` - Pending
        * `parsing` - Parsing
        * `parsing_failed` - Parsing Failed
        * `embedding` - Embedding
        * `embedding_failed` - Embedding Failed
        * `embedded` - Embedded
        * `fail` - Fail
        * `updating` - Updating
    TenantUserGroup:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    TenantUserRole:
      type: object
      properties:
        name:
          type: string
        id:
          type: integer
      required:
        - id
        - name
    Threads:
      type: object
      properties:
        threads_count:
          type: integer
        unique_models_count:
          type: integer
        average_thread_length:
          type: number
          format: double
      required:
        - average_thread_length
        - threads_count
        - unique_models_count
    TokenizeRequest:
      type: object
      description: Request serializer for tokenize endpoint.
      properties:
        model:
          type: string
          description: >-
            Model to use for tokenization, must exist and be configured from the
            admin
        prompt:
          type: string
          description: The text to tokenize
        messages:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of messages to tokenize (alternative to prompt)
      required:
        - model
    TokenizeResponse:
      type: object
      description: Response serializer for tokenize endpoint results.
      properties:
        total_tokens:
          type: integer
          description: Total number of tokens in the input text
        request_model:
          type: string
          description: The requested model for tokenization
        model_used:
          type: string
          description: The model used for tokenization
        tokenizer_type:
          type: string
          description: The type of tokenizer used
        id:
          type: string
          description: The id of the response
        model:
          type: string
          description: The model used for tokenization
      required:
        - id
        - model
        - model_used
        - request_model
        - tokenizer_type
        - total_tokens
    ToolReport:
      type: object
      properties:
        name:
          type: string
        count:
          type: integer
      required:
        - count
        - name
    ToolReportPerDate:
      type: object
      properties:
        date:
          type: string
          format: date
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ToolReport'
        third_party_tools:
          type: array
          items:
            $ref: '#/components/schemas/ToolReport'
        agent_tools:
          type: array
          items:
            $ref: '#/components/schemas/ToolReport'
      required:
        - agent_tools
        - date
        - third_party_tools
        - tools
    ToolsReportResponse:
      type: object
      properties:
        reporting:
          type: array
          items:
            $ref: '#/components/schemas/CompanyToolReport'
      required:
        - reporting
    UpdateChunksRequest:
      type: object
      description: Request serializer for updating document chunks.
      properties:
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/ChunkItem'
          description: List of chunks to update or add to the document
        document_id:
          type: integer
          description: >-
            ID of existing document to update (optional, creates new document if
            not provided)
        document_name:
          type: string
          description: Name for new document (required when creating new document)
        collection:
          type: string
          description: Collection name (required when creating new document)
      required:
        - chunks
    UpdateChunksResponse:
      type: object
      description: Response serializer for chunk update results.
      properties:
        success:
          type: integer
          description: Number of chunks successfully processed
        document_id:
          type: integer
          description: ID of the document that was created or updated
      required:
        - document_id
        - success
    UpdateCompanyMemberGroupsRequest:
      type: object
      properties:
        groups:
          type: array
          items:
            type: integer
    UpdateCompanyMemberRolesRequest:
      type: object
      properties:
        roles:
          type: array
          items:
            type: integer
    UpdateCompanyMemberWorkspacesRequest:
      type: object
      properties:
        workspaces:
          type: array
          items:
            type: integer
    UpdateWorkspaceMembersRequest:
      type: object
      properties:
        members:
          type: array
          items:
            type: integer
        groups:
          type: array
          items:
            type: integer
    UploadSessionDocument:
      type: object
      description: Serializer for documents within upload session responses.
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          nullable: true
          maxLength: 255
        collection:
          type: integer
          nullable: true
        status:
          $ref: '#/components/schemas/StatusEnum'
        updated_at:
          type: string
          format: date-time
          readOnly: true
        workspace:
          type: string
          nullable: true
          readOnly: true
          description: Workspace information associated with the document
      required:
        - id
        - updated_at
        - workspace
    UploadSessionFileAdditionResponse:
      type: object
      description: Response serializer for upload session file addition.
      properties:
        message:
          type: string
        id:
          type: integer
          description: Unique identifier of the added file
      required:
        - id
        - message
    UploadSessionResponse:
      type: object
      description: Response serializer for upload session details.
      properties:
        uuid:
          type: string
          format: uuid
          description: Unique identifier for the upload session
        is_valid:
          type: boolean
          description: Whether the upload session is currently valid and active
        created_at:
          type: string
          format: date-time
          description: Timestamp when the upload session was created
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the upload session was last updated
        documents:
          type: array
          items:
            $ref: '#/components/schemas/UploadSessionDocument'
          description: List of documents associated with this upload session
      required:
        - created_at
        - documents
        - is_valid
        - updated_at
        - uuid
    UsedDocument:
      type: object
      properties:
        document_filename:
          type: string
        document_title:
          type: string
        document_id:
          type: integer
        usage_count:
          type: integer
      required:
        - document_filename
        - document_id
        - document_title
        - usage_count
    UsedDocumentReportPerDate:
      type: object
      properties:
        date:
          type: string
          format: date
        documents:
          type: array
          items:
            $ref: '#/components/schemas/UsedDocument'
      required:
        - date
        - documents
    UsedDocumentsReportResponse:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/RetrieveUsedDocumentsReportMetadata'
        reporting:
          type: array
          items:
            $ref: '#/components/schemas/CompanyUsedDocumentsReport'
      required:
        - metadata
        - reporting
    ValueTypeEnum:
      enum:
        - boolean
        - float
        - comment
        - tag
      type: string
      description: |-
        * `boolean` - Boolean flag
        * `float` - Float range
        * `comment` - Free text comment
        * `tag` - String tag
    WorkspaceCollection:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
    WorkspaceSummaryResponse:
      type: object
      properties:
        language:
          type: string
        summary:
          type: string
      required:
        - language
        - summary
    WorkspaceWithRelationsResponse:
      type: object
      description: Mixin providing get_membership_role method for workspace serializers.
      properties:
        id:
          type: integer
        name:
          type: string
        workspace_type:
          type: string
        document_upload_method:
          type: string
        description:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        summaries:
          type: array
          items:
            $ref: '#/components/schemas/WorkspaceSummaryResponse'
        user_role:
          type: string
          readOnly: true
        collection:
          $ref: '#/components/schemas/WorkspaceCollection'
      required:
        - collection
        - created_at
        - description
        - document_upload_method
        - id
        - name
        - summaries
        - updated_at
        - user_role
        - workspace_type
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.
servers:
  - url: https://paradigm.lighton.ai
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
