openapi: 3.0.3
info:
  title: Fiddler API - 2.0
  description: APIs to interact with Fiddler
  termsOfService: https://fiddler.ai/about/terms
  contact:
    email: support@fiddler.ai
  license:
    name: Proprietary
    url: '2.0'
  version: '2.0'
externalDocs:
  url: https://docs.fiddler.ai
  description: Find out more about Fiddler
servers: []
security:
  - BearerAuth: []
paths:
  /v3/alert-rules/{alert_id}/records:
    x-fiddler-api-version: v3
    get:
      tags:
        - alert-rules-v3
      summary: >-
        List of all alert records during specified time_bucket_start and
        time_bucket_end for the given alert rule
      description: >-
        List of all alert records during specified time_bucket_start and
        time_bucket_end for the given alert rule
      operationId: getAlertRuleRecords
      parameters:
        - $ref: '#/components/parameters/alert_id'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/feature_name'
      responses:
        '200':
          description: >-
            List of all alert records in the given time_bucket_start and
            time_bucket_end for the given alert rule
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/AlertRecord'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/alert-rules/{alert_id}/record-history:
    x-fiddler-api-version: v3
    get:
      tags:
        - alert-rules-v3
      summary: >-
        List latest alert record for each time bucket during specified
        time_bucket_start and time_bucket_end for the given alert rule
      description: >-
        List latest alert record for each time bucket during specified
        time_bucket_start and time_bucket_end for the given alert rule
      operationId: getAlertRecordHistory
      parameters:
        - $ref: '#/components/parameters/alert_id'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
        - $ref: '#/components/parameters/feature_name'
      responses:
        '200':
          description: >-
            List of latest alert record for each time bucket during specified
            time_bucket_start and time_bucket_end for the given alert rule
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/AlertRecordHistory'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/alert-rules/{alert_id}/get-thresholds:
    x-fiddler-api-version: v3
    get:
      tags:
        - alert-rules-v3
      summary: >-
        Get thresholds that were used to evaluate the given time bin using the
        given alert rule.
      description: >-
        Get thresholds that were used to evaluate the given time bin using the
        given alert rule.
      operationId: getAlertThresholdsForTimeBin
      parameters:
        - $ref: '#/components/parameters/alert_id'
        - $ref: '#/components/parameters/alert_time_bucket'
        - $ref: '#/components/parameters/feature_name'
      responses:
        '200':
          description: >-
            Thresholds that were used to evaluate the given time bin using the
            given alert rule.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/AlertThresholdsForBinResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/alert-rules/summary:
    x-fiddler-api-version: v3
    get:
      tags:
        - alert-rules-v3
      summary: >-
        List of all alert rule summary in the given time_bucket_start and
        time_bucket_end
      description: >-
        List of all alert rule summary in the given time_bucket_start and
        time_bucket_end
      operationId: getAlertRulesSummary
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/start_time'
        - $ref: '#/components/parameters/end_time'
      responses:
        '200':
          description: >-
            Summary of all alert rules in the given time_bucket_start and
            time_bucket_end
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/AlertRuleSummary'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/alert-rules:
    x-fiddler-api-version: v3
    get:
      tags:
        - alert-rules-v3
      summary: Lists all alert rules configured for a model.
      description: Lists all alert rules configured for a model.
      operationId: getAlertRules
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/search'
      responses:
        '200':
          description: Get list of Alert Rules in detail
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/AlertRule'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - alert-rules-v3
      summary: Creates Alert Rules
      description: Creates Alert Rules
      operationId: createAlert
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AlertRulePostPayload'
      responses:
        '200':
          description: successful completion
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/AlertRule'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
      x-fiddler-is-internal: false
  /v3/alert-rules/{alert_id}/notification:
    x-fiddler-api-version: v3
    get:
      tags:
        - alert-rules-v3
      summary: Returns notification for the given Alert Rule id
      description: Returns notification for the given Alert Rule id
      operationId: getNotificationForAlertRule
      parameters:
        - $ref: '#/components/parameters/alert_id'
      responses:
        '200':
          description: Notification Details
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Notification'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - alert-rules-v3
      description: Create Notification for an Alert Rule
      operationId: createNotificationForAlertRule
      parameters:
        - $ref: '#/components/parameters/alert_id'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/NotificationPayload'
      responses:
        '200':
          description: successful completion
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Notification'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
      x-fiddler-is-internal: false
    patch:
      tags:
        - alert-rules-v3
      summary: Update by id
      description: Update Notification by Alert Rule id
      operationId: updateNotificationForAlertRule
      parameters:
        - $ref: '#/components/parameters/alert_id'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/NotificationPayload'
      responses:
        '200':
          description: Get detail info
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        allOf:
                          - $ref: '#/components/schemas/Notification'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
      x-fiddler-is-internal: false
  /v3/alert-rules/{alert_id}/test-notification:
    x-fiddler-api-version: v3
    post:
      tags:
        - alert-rules-v3
      summary: Send a test notification for the given Alert Rule
      description: >-
        Send a test notification for the given Alert Rule to verify notification
        configuration
      operationId: testNotificationForAlertRule
      parameters:
        - $ref: '#/components/parameters/alert_id'
      responses:
        '200':
          description: Test notification results per channel
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/TestNotificationResponse'
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/alert-rules/{alert_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - alert-rules-v3
      summary: Returns Alert Rule for the given id
      description: Returns Alert Rule for the given id
      operationId: getAlertRule
      parameters:
        - $ref: '#/components/parameters/alert_id'
      responses:
        '200':
          description: Alert Rule details
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/AlertRule'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - alert-rules-v3
      summary: Deletes an Alert Rule
      description: Deletes an Alert Rule
      operationId: deleteAlertRule
      parameters:
        - $ref: '#/components/parameters/alert_id'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    patch:
      tags:
        - alert-rules-v3
      summary: Update by id
      description: Update Alert Rule by id
      operationId: updateAlertRule
      parameters:
        - $ref: '#/components/parameters/alert_id'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AlertRuleUpdatableFields'
      responses:
        '200':
          description: Get detail info
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        allOf:
                          - $ref: '#/components/schemas/AlertRule'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/applications:
    x-fiddler-api-version: v3
    get:
      tags:
        - application-v3
      summary: List applications
      description: Get list of applications in a project for provided query and filters
      operationId: getApplicationsV3
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of applications for provided query and filters
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/ListApplicationResponse'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - application-v3
      summary: Create New Application
      description: Create New Application
      operationId: createApplicationV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplicationRequest'
      responses:
        '200':
          description: Details of the created application
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Application'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/applications/{application_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - application-v3
      summary: Get Application
      description: Get application by ID
      operationId: getApplicationV3
      parameters:
        - $ref: '#/components/parameters/application_id'
      responses:
        '200':
          description: Details of the application
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Application'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - application-v3
      summary: Delete Application
      description: Delete application and all associated resources asynchronously
      operationId: deleteApplicationV3
      parameters:
        - $ref: '#/components/parameters/application_id'
      responses:
        '202':
          description: Application deletion job accepted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ApplicationDeletionJob'
              examples:
                ApplicationDeletionJobResponse:
                  $ref: '#/components/examples/ApplicationDeletionJobResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/applications/{application_id}/metrics:
    x-fiddler-api-version: v3
    get:
      tags:
        - application-v3
      summary: Get Application Metrics Metadata
      description: Retrieves available metrics and aggregations for a GenAI application
      operationId: getApplicationMetrics
      parameters:
        - $ref: '#/components/parameters/application_id'
        - name: source
          in: query
          description: >
            Source context for metric requests. Determines which metrics are
            returned:

            - GENAI_CHARTS (default): Full superset of metrics (Traffic, Token
            Count, Attribute, Latency, Evaluator)

            - GENAI_ALERTS: Metrics supported by the alerting engine (Traffic,
            Token Count, Attribute, Latency)
          required: false
          schema:
            type: string
            default: GENAI_CHARTS
            enum:
              - GENAI_CHARTS
              - GENAI_ALERTS
      responses:
        '200':
          description: Metrics metadata retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/MetricsMetadata'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/attributes:
    x-fiddler-api-version: v3
    get:
      tags:
        - attribute-v3
      summary: List attributes
      description: Get list of attributes
      operationId: getAttributesV3
      parameters:
        - name: filter
          in: query
          required: false
          schema:
            type: string
          style: form
          explode: false
          examples:
            byApplication:
              value: >-
                {"condition":"AND","rules":[{"field":"application_id","operator":"equal","value":"<application_id>"}]}
              summary: Filter by application id; uuid
            byDataType:
              value: >-
                {"condition":"AND","rules":[{"field":"data_type","operator":"equal","value":"float"}]}
              summary: Filter by data type; float or string
            byScope:
              value: >-
                {"condition":"AND","rules":[{"field":"scope","operator":"equal","value":"span"}]}
              summary: Filter by scope; span or session
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of attributes for provided query and filters
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/ListAttributesCompactResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/baselines:
    x-fiddler-api-version: v3
    get:
      tags:
        - baseline-v3
      summary: List of baselines based on user permissions and filters
      description: List of baselines based on user permissions and filters
      operationId: getBaselinesV3
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of baselines
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/Baselines'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - baseline-v3
      summary: add baseline to a model
      description: Adds a baseline to a model
      operationId: addBaselineV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddBaselineRequestBody'
      responses:
        '200':
          description: successful baseline creation
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Baseline'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/baselines/{baseline_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - baseline-v3
      summary: Get baseline details
      description: Get baseline details
      operationId: getBaselineV3
      parameters:
        - $ref: '#/components/parameters/baseline_id'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Baseline'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - baseline-v3
      summary: Delete baseline from a model
      description: Delete baseline from a model
      operationId: deleteBaselineV3
      parameters:
        - $ref: '#/components/parameters/baseline_id'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models/{model_id}/baselines:
    x-fiddler-api-version: v3
    get:
      tags:
        - baseline-v3
      summary: List of baselines of a model
      description: List of baselines of a model
      operationId: getModelBaselinesV3
      parameters:
        - $ref: '#/components/parameters/model_id'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of baselines of a model
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/Baselines'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/applications/{application_id}/catalog:
    x-fiddler-api-version: v3
    get:
      tags:
        - catalog-v3
      summary: List catalog entries
      description: >-
        Paginated, searchable list of entity names for an application. Returns
        entity names with semantic concept mappings, data types, first/last seen
        timestamps, and observation counts.


        Use query parameters to filter by entity type, data type, or semantic
        concept name. The `search` parameter performs a case-insensitive
        substring match on entity names.
      operationId: listCatalogV3
      parameters:
        - $ref: '#/components/parameters/application_id_path_required'
        - name: entity_type
          in: query
          description: Filter by entity type.
          required: false
          schema:
            $ref: '#/components/schemas/EntityType'
        - name: data_type
          in: query
          description: Data types to filter by (e.g. `?data_type=numeric,string`).
          required: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/EntityDataType'
          style: form
          explode: false
          example:
            - numeric
            - string
        - name: semantic_name
          in: query
          description: >-
            Semantic concept names to filter by (e.g.
            `?semantic_name=input_tokens,output_tokens`). Use `UNKNOWN` for
            unmapped attributes.
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
          example:
            - input_tokens
            - output_tokens
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Paginated list of catalog entries
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/CatalogItem'
              example:
                data:
                  items:
                    - name: gen_ai.usage.input_tokens
                      semantic_name: input_tokens
                      data_type: numeric
                      first_seen: '2026-01-15T10:30:00Z'
                      last_seen: '2026-05-30T14:22:00Z'
                      row_count: 125000
                    - name: gen_ai.response.model
                      semantic_name: model_name
                      data_type: string
                      first_seen: '2026-01-15T10:30:00Z'
                      last_seen: '2026-05-30T14:22:00Z'
                      row_count: 125000
                    - name: custom.priority
                      semantic_name: UNKNOWN
                      data_type: string
                      first_seen: '2026-03-01T08:00:00Z'
                      last_seen: '2026-05-30T14:22:00Z'
                      row_count: 42000
                  item_count: 3
                  total: 3
                  offset: 0
                  page_size: 100
                  page_count: 1
                  page_index: 1
                api_version: '3.0'
                kind: PAGINATED
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/applications/{application_id}/catalog/values:
    x-fiddler-api-version: v3
    get:
      tags:
        - catalog-v3
      summary: List distinct values for a catalog entity
      description: >-
        Paginated, searchable list of distinct values for a specific entity
        within an application. Useful for populating filter dropdowns in the
        Trace Explorer UI.


        Both `entity_type` and `name` are required — values are always scoped to
        a specific entity.
      operationId: listCatalogValuesV3
      parameters:
        - $ref: '#/components/parameters/application_id_path_required'
        - name: entity_type
          in: query
          description: Type of entity to list values for.
          required: true
          schema:
            $ref: '#/components/schemas/EntityType'
        - name: name
          in: query
          description: Name of the entity to list values for.
          required: true
          schema:
            type: string
          example: gen_ai.response.model
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Paginated list of distinct values
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/CatalogValueItem'
              example:
                data:
                  items:
                    - value: gpt-4o
                      first_seen: '2026-01-15T10:30:00Z'
                      last_seen: '2026-05-30T14:22:00Z'
                      row_count: 80000
                    - value: claude-3.5-sonnet
                      first_seen: '2026-02-01T12:00:00Z'
                      last_seen: '2026-05-30T14:22:00Z'
                      row_count: 45000
                  item_count: 2
                  total: 2
                  offset: 0
                  page_size: 100
                  page_count: 1
                  page_index: 1
                api_version: '3.0'
                kind: PAGINATED
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/queries:
    x-fiddler-api-version: v3
    post:
      tags:
        - queries-v3
      summary: API to fetch metrics used to plot monitoring charts
      description: API to fetch metrics used to plot monitoring charts
      operationId: getQueriesV3
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/MonitoringQueryRequest'
                - $ref: '#/components/schemas/LLMQueryRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        oneOf:
                          - $ref: '#/components/schemas/MonitoringQueryResponse'
                          - $ref: '#/components/schemas/LLMMonitoringQueryResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/custom-metrics:
    x-fiddler-api-version: v3
    get:
      tags:
        - custom-metrics-v3
      summary: List all custom metrics
      description: List all custom metrics
      operationId: getCustomMetricsV3
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of all custom metrics
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/CustomMetric'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - custom-metrics-v3
      summary: Create new custom metric
      description: Create new custom metric
      operationId: createCustomMetricV3
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CreateCustomMetricRequest'
      responses:
        '200':
          description: Custom metric successfully created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        allOf:
                          - $ref: '#/components/schemas/CustomMetric'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/custom-metrics/{uuid}:
    x-fiddler-api-version: v3
    get:
      tags:
        - custom-metrics-v3
      summary: Detail info of a custom metric
      description: Detail info of a custom metric
      operationId: getCustomMetricV3
      parameters:
        - $ref: '#/components/parameters/uuid_path'
      responses:
        '200':
          description: Get detail info
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        allOf:
                          - $ref: '#/components/schemas/CustomMetric'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - custom-metrics-v3
      summary: Delete custom metric by uuid
      description: Delete custom metric by uuid
      operationId: deleteCustomMetricV3
      parameters:
        - $ref: '#/components/parameters/uuid_path'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models/{model_id}/custom-metrics:
    x-fiddler-api-version: v3
    get:
      tags:
        - custom-metrics-v3
      summary: List all custom metrics for a model
      description: List all custom metrics for a model
      operationId: getModelCustomMetricsV3
      parameters:
        - $ref: '#/components/parameters/model_id'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of all custom metrics for a model
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/CustomMetric'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/environments:
    x-fiddler-api-version: v3
    get:
      tags:
        - environment-v3
      summary: List Environments
      description: Retrieve a list of environments from authorized projects.
      operationId: getEnvironments
      parameters:
        - $ref: '#/components/parameters/type'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of environments from authorized projects
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/Environments'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/environments/{env_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - environment-v3
      summary: Get environment of a model
      description: Retrieve details of a specific environment associated with a model.
      operationId: getEnvironment
      parameters:
        - $ref: '#/components/parameters/env_id'
      responses:
        '200':
          description: Details of the environment associated with the specified ID
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Environment'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models/{model_id}/environments:
    x-fiddler-api-version: v3
    get:
      tags:
        - environment-v3
      summary: List of environments of a model
      description: Retrieve a list of environments associated with a specific model.
      operationId: getModelEnvironments
      parameters:
        - $ref: '#/components/parameters/model_id'
        - $ref: '#/components/parameters/type'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of environments associated with the specified model
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/Environments'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evals/datasets:
    x-fiddler-api-version: v3
    get:
      tags:
        - evals
        - datasets
      summary: List Evals datasets
      description: Retrieve datasets with pagination, search, ordering, and filters.
      operationId: listEvalsDatasetsV3
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Paginated list of datasets
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/EvalDataset'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - evals
        - datasets
      summary: Create an Evals dataset
      operationId: createEvalsDatasetV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEvalDataset'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/EvalDataset'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evals/datasets/{dataset_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - evals
        - datasets
      summary: Get a dataset by id
      operationId: getEvalsDatasetByIdV3
      responses:
        '200':
          description: Dataset
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/EvalDataset'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - evals
        - datasets
      summary: Delete a dataset
      operationId: deleteEvalsDatasetV3
      responses:
        '204':
          description: Deleted
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    patch:
      tags:
        - evals
        - datasets
      summary: Update a dataset
      operationId: updateEvalsDatasetV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEvalDataset'
      responses:
        '200':
          description: Updated dataset
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/EvalDataset'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    parameters:
      - name: dataset_id
        in: path
        description: Dataset UUID
        required: true
        schema:
          type: string
          format: uuid
  /v3/evals/datasets/{dataset_id}/items:
    x-fiddler-api-version: v3
    get:
      tags:
        - evals
        - datasets
      summary: List dataset items
      description: Get list of items for a dataset
      operationId: getEvalsDatasetItemsV3
      parameters:
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of dataset items
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListDatasetItemsResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - evals
        - datasets
      summary: Add new Evals dataset items
      operationId: addEvalsDatasetItemsV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEvalDatasetItemsRequest'
      responses:
        '201':
          description: Evals dataset items added successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                description: Item Ids
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    parameters:
      - name: dataset_id
        in: path
        description: Dataset UUID
        required: true
        schema:
          type: string
          format: uuid
  /v3/evals/datasets/{dataset_id}/schema:
    x-fiddler-api-version: v3
    get:
      tags:
        - evals
        - datasets
      summary: Get dataset schema
      description: >-
        Discover what field keys exist in each JSON bucket (inputs,
        expected_outputs, metadata, extras) across this dataset's items, along
        with a coverage count and inferred data type for each key. Useful for
        pre-populating a field mapper UI or for an MCP agent to understand what
        data is available before constructing a mapping. Returns empty objects
        for all buckets if the dataset has no items.
      operationId: getEvalsDatasetSchemaV3
      responses:
        '200':
          description: Dataset schema per bucket
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/DatasetSchema'
              example:
                data:
                  total_items: 500
                  sampled: false
                  inputs:
                    question:
                      count: 500
                      data_type: STRING
                    context:
                      count: 423
                      data_type: STRING
                  expected_outputs:
                    answer:
                      count: 500
                      data_type: STRING
                  metadata:
                    trace_id:
                      count: 500
                      data_type: STRING
                    model:
                      count: 500
                      data_type: STRING
                  extras:
                    cost_usd:
                      count: 120
                      data_type: FLOAT
                api_version: '3.0'
                kind: NORMAL
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    parameters:
      - name: dataset_id
        in: path
        description: Dataset UUID
        required: true
        schema:
          type: string
          format: uuid
  /v3/evals/datasets/{dataset_id}/items/from-spans:
    x-fiddler-api-version: v3
    post:
      tags:
        - evals
        - datasets
      summary: Bulk add spans to dataset
      description: >-
        Accept a list of explicit span references and a field mapping, fetch
        span attributes from ClickHouse, apply the mapping server-side, and
        write one dataset item per span. All-or-nothing — if any span cannot be
        resolved, no items are written and a 422 is returned with the list of
        unresolvable spans.


        `start_time` and `end_time` are required to bound the ClickHouse lookup
        to the relevant monthly partitions. Without them, the query would scan
        every partition for the application. The FE should pass the datagrid's
        current time range; MCP agents should pass the time range of the spans
        being exported.


        Mapping values are span attribute keys as returned by `POST
        /v3/spans/fields` (e.g. `"system.gen_ai.usage.input_tokens"`,
        `"user.cost_usd"`). Each key maps to the corresponding value from the
        span's `span_attributes` dict.
      operationId: bulkAddSpansToDatasetV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkAddSpansRequest'
      responses:
        '201':
          description: Dataset items created from spans
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/BulkAddSpansResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          description: >-
            One or more spans could not be resolved. No items were written. The
            errors array identifies which span references failed and why.
          content:
            application/json:
              schema:
                $ref: '#/components/responses/422'
              example:
                error:
                  code: 422
                  message: >-
                    One or more spans could not be resolved. No items were
                    written.
                  errors:
                    - reason: SpanNotFound
                      message: >-
                        Span span-002-b (trace 4f9fa507) not found within the
                        specified time range
                api_version: '3.0'
                kind: ERROR
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    parameters:
      - name: dataset_id
        in: path
        description: Dataset UUID
        required: true
        schema:
          type: string
          format: uuid
  /v3/evals/score:
    x-fiddler-api-version: v3
    post:
      tags:
        - evaluation-v3
      summary: Score inputs using an evaluator
      description: Score inputs using an evaluator
      operationId: scoreInputs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScoreInputsRequest'
      responses:
        '200':
          description: Scores returned successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          scores:
                            type: array
                            items:
                              $ref: '#/components/schemas/Score'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evaluators:
    x-fiddler-api-version: v3
    get:
      tags:
        - evaluator-v3
      summary: List evaluators
      description: Get list of evaluators for provided query and filters
      operationId: getEvaluatorsV3
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of evaluators for provided query and filters
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/Evaluator'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - evaluator-v3
      summary: Create New Evaluator
      description: Create a new Evaluator
      operationId: createEvaluatorV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluatorRequest'
      responses:
        '200':
          description: Details of the created evaluator
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Evaluator'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evaluators/{evaluator_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - evaluator-v3
      summary: Get Evaluator by ID
      description: Get details of a specific evaluator by its ID
      operationId: getEvaluatorV3
      parameters:
        - name: evaluator_id
          in: path
          description: Unique identifier of the evaluator
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Details of the evaluator
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Evaluator'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    patch:
      tags:
        - evaluator-v3
      summary: Update Evaluator
      description: >
        Update an evaluator's name and/or configuration. Creates a new version
        of the evaluator and archives the previous version. At least one field
        (name or enrichment_config) must be provided.
      operationId: updateEvaluatorV3
      parameters:
        - name: evaluator_id
          in: path
          description: Unique identifier of the evaluator to update
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEvaluatorRequest'
      responses:
        '200':
          description: Details of the updated evaluator (new version)
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Evaluator'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evaluators/{evaluator_id}/archive:
    x-fiddler-api-version: v3
    post:
      tags:
        - evaluator-v3
      summary: Archive Evaluator
      description: >
        Archive an evaluator. Sets the evaluator's status to ARCHIVED. Archived
        evaluators are excluded from active queries and cannot be used in new
        evaluator rules.
      operationId: archiveEvaluatorV3
      parameters:
        - name: evaluator_id
          in: path
          description: Unique identifier of the evaluator to archive
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Details of the archived evaluator
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Evaluator'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evaluators/get-config-options:
    x-fiddler-api-version: v3
    get:
      tags:
        - evaluator-v3
      summary: List evaluator config schemas
      description: >-
        Get list of evaluator config schema for each enrichment type with data
        type
      operationId: getEvaluatorConfigSchemasV3
      responses:
        '200':
          description: List of evaluator config schema for each enrichment type
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ListEvaluatorConfigSchema'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evaluator-rules:
    x-fiddler-api-version: v3
    get:
      tags:
        - evaluator-rules-v3
      summary: List Rule evaluators
      description: Get list of Rule evaluators setup for provided query and filters
      operationId: getRuleEvaluatorsV3
      parameters:
        - name: filter
          in: query
          required: false
          schema:
            type: string
          style: form
          explode: false
          examples:
            byApplication:
              value: >-
                {"condition":"AND","rules":[{"field":"application_id","operator":"equal","value":"<application_id>"}]}
              summary: Filter by application id; uuid
            byApplicationName:
              value: >-
                {"condition":"AND","rules":[{"field":"application_name","operator":"equal","value":"my_app"}]}
              summary: Filter by application name; string
            byEvaluatorType:
              value: >-
                {"condition":"AND","rules":[{"field":"evaluator_type","operator":"equal","value":"sentiment_analysis"}]}
              summary: >-
                Filter by evaluator type; e.g., sentiment_analysis, token_count,
                answer_relevance
            byProject:
              value: >-
                {"condition":"AND","rules":[{"field":"project_id","operator":"equal","value":"<project_id>"}]}
              summary: Filter by project id; uuid
            byOrganization:
              value: >-
                {"condition":"AND","rules":[{"field":"organization_id","operator":"equal","value":"<organization_id>"}]}
              summary: Filter by organization id; uuid
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of Rule evaluators for provided query and filters
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/ListRuleEvaluatorsResponse'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - evaluator-rules-v3
      summary: Create New Evaluator Rule
      description: Create a new Evaluator Rule
      operationId: createEvaluatorRuleV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleEvaluatorRequest'
      responses:
        '200':
          description: Details of the created evaluator rule
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/RuleEvaluator'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evaluator-rules/{evaluator_rule_id}:
    x-fiddler-api-version: v3
    delete:
      tags:
        - evaluator-rules-v3
      summary: Delete Rule Evaluator for an application
      description: Delete Rule Evaluator
      operationId: deleteRuleEvaluatorV3
      parameters:
        - $ref: '#/components/parameters/evaluator_rule_id'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    patch:
      tags:
        - evaluator-rules-v3
      summary: Update Rule Evaluator
      description: Update the Rule evaluator
      operationId: updateRuleEvaluatorV3
      parameters:
        - $ref: '#/components/parameters/evaluator_rule_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRuleEvaluatorRequest'
      responses:
        '200':
          description: Update Rule evaluator
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/RuleEvaluator'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evaluator-rules/map-input-keys:
    x-fiddler-api-version: v3
    post:
      tags:
        - evaluator-rules-v3
      summary: Get attribute names and input fields
      description: >-
        Get the possible attribute names detected in the application and the
        input fields with data type to fill out for the evaluator name
      operationId: mapInputKeysRuleEvaluatorV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MapInputKeysRequest'
      responses:
        '200':
          description: Possible attribute names and keys to map
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/MapInputKeys'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/genai-enrichment-backfills:
    x-fiddler-api-version: v3
    get:
      tags:
        - evaluator-rules-v3
      summary: List evaluator backfills
      description: Get list of evaluator backfill jobs for provided query and filters
      operationId: getEvaluatorBackfills
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of evaluator backfills for provided query and filters
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: >-
                              #/components/schemas/ListEnrichmentBackfillResponse
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evals/experiments:
    x-fiddler-api-version: v3
    get:
      tags:
        - experiment-v3
      summary: List experiments
      description: Get list of experiments for provided query and filters
      operationId: getExperiments
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of experiments for provided query and filters
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/ListExperimentsResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - experiment-v3
      summary: Create New Experiment
      description: Create a new experiment
      operationId: createExperiment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExperimentRequest'
      responses:
        '200':
          description: Details of the created experiment
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Experiment'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evals/experiments/{experiment_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - experiment-v3
      summary: Get Experiment
      description: Get experiment by ID
      operationId: getExperiment
      parameters:
        - $ref: '#/components/parameters/experiment_id'
      responses:
        '200':
          description: Details of the experiment
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Experiment'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - experiment-v3
      summary: Delete Experiment
      description: Delete an experiment
      operationId: deleteExperiment
      parameters:
        - $ref: '#/components/parameters/experiment_id'
      responses:
        '204':
          description: Experiment deleted successfully
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    patch:
      tags:
        - experiment-v3
      summary: Update Experiment
      description: Update an experiment
      operationId: updateExperiment
      parameters:
        - $ref: '#/components/parameters/experiment_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateExperimentRequest'
      responses:
        '200':
          description: Updated experiment details
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Experiment'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evals/experiments/{experiment_id}/items:
    x-fiddler-api-version: v3
    post:
      tags:
        - experiment-v3
      summary: Upload new experiment items
      description: Upload new experiment items
      operationId: uploadExperimentItems
      parameters:
        - $ref: '#/components/parameters/experiment_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateExperimentItemRequest'
      responses:
        '200':
          description: Experiment items uploaded successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/ExperimentItem'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evals/experiments/{experiment_id}/scores:
    x-fiddler-api-version: v3
    get:
      tags:
        - experiment-v3
      description: Get list of evaluation scores for an experiment
      operationId: getEvalScores
      parameters:
        - $ref: '#/components/parameters/experiment_id'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of evaluation scores for an experiment
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/ListEvalScoresResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evals/experiments/{experiment_id}/results:
    x-fiddler-api-version: v3
    get:
      tags:
        - experiment-v3
      summary: List experiment results
      description: >-
        Get a paginated list of results for an experiment. Each result contains
        the experiment item outputs, dataset inputs and expected outputs, and
        all associated evaluation scores (including the evaluator name).

        **Filtering** (`filter` parameter — JSON-encoded QueryCondition DSL): -
        `experiment_item_id` — filter by one or more item IDs
          (operators: `equal`, `not_equal`, `in`, `not_in`)

        **Ordering** (`ordering` parameter): - `timestamp` / `-timestamp` — sort
        by item timestamp (default: `-timestamp`) - `created_at` / `-created_at`
        — sort by backend creation time - `scores.score_value` /
        `-scores.score_value` — sort by first score value -
        `scores.{score_name}` / `-scores.{score_name}` — sort by named score
        value
          (e.g. `scores.accuracy`, `-scores.toxicity`)
      operationId: getExperimentResults
      parameters:
        - $ref: '#/components/parameters/experiment_id'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of results for an experiment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListExperimentResultsResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - experiment-v3
      summary: Upload experiment results
      description: >-
        Upload new experiment results, each with an item and its associated
        scores.
      operationId: uploadExperimentResults
      parameters:
        - $ref: '#/components/parameters/experiment_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExperimentResultsRequest'
      responses:
        '200':
          description: Experiment results uploaded successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evals/experiments/{experiment_id}/metrics:
    x-fiddler-api-version: v3
    get:
      tags:
        - experiment-v3
      summary: Get Experiment Metrics
      description: >-
        Get per-evaluator aggregate metrics for an experiment. Auto-detects each
        evaluator's chart type based on score cardinality: numeric_range (>10
        distinct numeric values, histogram), numeric_categorical (<=10 distinct
        numeric values, distribution bars), or categorical (label-only scores,
        distribution with ratios).
      operationId: getExperimentMetrics
      parameters:
        - $ref: '#/components/parameters/experiment_id'
      responses:
        '200':
          description: Aggregate metrics per evaluator for the experiment
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ExperimentMetricsResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/evals/experiments/{experiment_id}/metrics/rows:
    x-fiddler-api-version: v3
    get:
      tags:
        - experiment-v3
      summary: Get Experiment Row Metrics
      description: >-
        Get top and bottom performing rows via percentile-based outlier
        detection. Numeric evaluators use P10/P90 thresholds; categorical
        evaluators flag labels that differ from the mode. Rows are ranked by how
        many evaluators flagged them as outliers.
      operationId: getExperimentMetricsRows
      parameters:
        - $ref: '#/components/parameters/experiment_id'
      responses:
        '200':
          description: Top and bottom performing rows with evaluator flags
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ExperimentRowMetricsResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/slice-query/parse:
    x-fiddler-api-version: v3
    post:
      tags:
        - explainability-v3
      summary: Fetch slice query
      description: Parse slice query data
      operationId: parseSliceQueryV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParseSliceQueryRequestBody'
      responses:
        '200':
          description: Successfully parsed slice query
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ParseSliceQueryResponseBody'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
  /v3/slice-query/fetch:
    x-fiddler-api-version: v3
    post:
      tags:
        - explainability-v3
      summary: Fetch slice query
      description: Fetch slice query data
      operationId: fetchSliceQueryV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FetchSliceQueryRequestBody'
      responses:
        '200':
          description: Slice query data fetch successful
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/FetchSliceQueryResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/analytics/feature-impact:
    x-fiddler-api-version: v3
    post:
      tags:
        - explainability-v3
      summary: Get feature impact
      description: Get feature impact for the given environment or a slice query
      operationId: featureImpactV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeatureImpactRequestBody'
      responses:
        '200':
          description: Feature Impact ran successfully on the given data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/FeatureImpactResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
  /v3/analytics/feature-importance:
    x-fiddler-api-version: v3
    post:
      tags:
        - explainability-v3
      summary: Get feature importance
      description: Get feature importance for the given environment or a slice query
      operationId: featureImportanceV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeatureImportanceRequestBody'
      responses:
        '200':
          description: Feature Importance ran successfully on the given data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/FeatureImportanceResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
  /v3/analytics/scores:
    x-fiddler-api-version: v3
    post:
      tags:
        - explainability-v3
      summary: Get model scores
      description: Get model scores for the given environment or a slice query
      operationId: scoresV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScoreRequestBody'
      responses:
        '200':
          description: Scoring ran successfully on the given data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ScoresResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
  /v3/analytics/precompute-feature-impact:
    x-fiddler-api-version: v3
    put:
      tags:
        - explainability-v3
      summary: Update precomputed feature impact
      description: Compute and update cached feature impact on an environment
      operationId: updatePrecomputeFeatureImpactV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrecomputeFeatureImpactRequestBody'
      responses:
        '200':
          description: >-
            Feature impact pre-computation update ran successfully on the given
            data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          job:
                            $ref: '#/components/schemas/JobCompact'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
    post:
      tags:
        - explainability-v3
      summary: Precompute feature impact
      description: Compute and cache feature impact on an environment
      operationId: precomputeFeatureImpactV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrecomputeFeatureImpactRequestBody'
      responses:
        '200':
          description: Feature impact pre-computation ran successfully on the given data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          job:
                            $ref: '#/components/schemas/JobCompact'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
  /v3/analytics/feature-impact/precomputed:
    x-fiddler-api-version: v3
    post:
      tags:
        - explainability-v3
      summary: Get precomputed feature impact
      description: Get precomputed feature impact for a model
      operationId: getPrecomputedFeatureImpactV3
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model_id:
                  type: string
                  format: uuid
                  description: Unique identifier for the model.
              required:
                - model_id
      responses:
        '200':
          description: >-
            Precomputed Feature impact retrieval ran successfully on the given
            data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/FeatureImpactResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
  /v3/analytics/precompute-feature-importance:
    x-fiddler-api-version: v3
    put:
      tags:
        - explainability-v3
      summary: Update precomputed feature importance
      description: Compute and update cached feature importance on an environment
      operationId: updatePrecomputeFeatureImportanceV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrecomputeFeatureImportanceRequestBody'
      responses:
        '200':
          description: >-
            Feature importance pre-computation update ran successfully on the
            given data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          job:
                            $ref: '#/components/schemas/JobCompact'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
    post:
      tags:
        - explainability-v3
      summary: Precompute feature importance
      description: Compute and cache feature importance on an environment
      operationId: precomputeFeatureImportanceV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrecomputeFeatureImportanceRequestBody'
      responses:
        '200':
          description: >-
            Feature importance pre-computation ran successfully on the given
            data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          job:
                            $ref: '#/components/schemas/JobCompact'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
  /v3/analytics/feature-importance/precomputed:
    x-fiddler-api-version: v3
    post:
      tags:
        - explainability-v3
      summary: Get precomputed feature importance
      description: Get precomputed feature importance for a model
      operationId: getPrecomputedFeatureImportanceV3
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model_id:
                  type: string
                  format: uuid
                  description: Unique identifier for model.
              required:
                - model_id
      responses:
        '200':
          description: >-
            Precomputed Feature importance retrieval ran successfully on the
            given data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/FeatureImportanceResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
      x-fiddler-is-internal: false
  /v3/predict:
    x-fiddler-api-version: v3
    post:
      tags:
        - explainability-v3
      description: Get predictions from a model
      operationId: predictV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PredictRequestBody'
      responses:
        '200':
          description: Predictions ran successfully on the given data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PredictResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/files/upload:
    x-fiddler-api-version: v3
    post:
      tags:
        - file-upload
      summary: Upload file in a single part
      description: Uploads a file in a single part to Fiddler.
      operationId: fileUpload
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadRequest'
      responses:
        '200':
          description: File uploaded successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/FileUploadResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/files/multipart-init:
    x-fiddler-api-version: v3
    post:
      tags:
        - file-upload
      summary: Initiate multi-part upload
      description: Initiates a multi-part upload process for a large file to Fiddler.
      operationId: initiateMultiPartUpload
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MultiPartInitRequest'
      responses:
        '200':
          description: Multi-part upload request initiated successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/MultiPartInitResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/files/multipart-upload:
    x-fiddler-api-version: v3
    post:
      tags:
        - file-upload
      summary: Upload file a part of the file
      description: >-
        Uploads a part of a large file to Fiddler as part of a multi-part upload
        process.
      operationId: uploadPart
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PartUploadRequest'
      responses:
        '200':
          description: File part uploaded successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/MultiPartUploadResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/files/multipart-complete:
    x-fiddler-api-version: v3
    post:
      tags:
        - file-upload
      summary: Complete multi-part upload
      description: Completes the multi-part upload process for a large file in Fiddler.
      operationId: completeMultiPartUpload
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MultiPartCompleteRequest'
      responses:
        '200':
          description: Multi-part upload request completed successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/MultiPartCompleteResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/fql-expressions:
    x-fiddler-api-version: v3
    get:
      tags:
        - fql-expressions-v3
      summary: List available FQL functions
      description: >
        Returns the list of FQL functions available for GenAI custom metrics,
        including function metadata, parameter definitions, and return types.
        The response is used by the frontend for autocomplete suggestions,
        signature hints, and documentation in the FQL editor.


        Currently returns GenAI functions only (from the GenAI function registry
        plus the `attribute` construct). Extensible to ML context in the future
        via a query parameter.
      operationId: listFqlExpressionsV3
      responses:
        '200':
          description: List of available FQL functions retrieved successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/FqlExpressionsResponse'
              examples:
                genai_functions:
                  summary: GenAI FQL functions
                  value:
                    api_version: '3.0'
                    kind: NORMAL
                    data:
                      functions:
                        - name: count
                          category: aggregate
                          grouping: aggregation
                          description: >-
                            Returns the number of non-null rows of a column or
                            row expression
                          parameters:
                            - name: expr
                              type: any
                              is_required: true
                              kind: positional
                          return_type: number
                        - name: if
                          category: row
                          grouping: logical
                          description: Evaluates condition and returns one of two values
                          parameters:
                            - name: expr1
                              type: boolean
                              is_required: true
                              kind: positional
                            - name: expr2
                              type: any
                              is_required: true
                              kind: positional
                            - name: expr3
                              type: any
                              is_required: true
                              kind: positional
                          return_type: any
                        - name: quantile
                          category: aggregate
                          grouping: aggregation
                          description: Returns the value at a given quantile level
                          parameters:
                            - name: expr
                              type: number
                              is_required: true
                              kind: positional
                            - name: level
                              type: number
                              is_required: false
                              default: 0.5
                              kind: keyword
                          return_type: number
                        - name: attribute
                          category: row
                          grouping: attribute
                          description: >-
                            References a Gen AI span or session attribute by
                            name
                          parameters:
                            - name: scope
                              type: string
                              is_required: true
                              allowed_values:
                                - span
                              kind: keyword
                            - name: name
                              type: string
                              is_required: true
                              kind: keyword
                            - name: value
                              type: string
                              is_required: false
                              kind: keyword
                          return_type: any
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/genai-alert-rules:
    x-fiddler-api-version: v3
    get:
      tags:
        - genai-alert-rules-v3
      summary: List GenAI Alert Rules
      description: Lists all GenAI Alert Rules with pagination
      operationId: listGenAIAlertRules
      parameters:
        - name: filter
          in: query
          required: false
          schema:
            type: string
          style: form
          explode: false
          examples:
            byName:
              value: >-
                {"condition":"AND","rules":[{"field":"name","operator":"equal","value":"My
                Alert Rule"}]}
              summary: Filter by alert rule name
            byProject:
              value: >-
                {"condition":"AND","rules":[{"field":"project_name","operator":"equal","value":"My
                Project"}]}
              summary: Filter by project name
            byApplication:
              value: >-
                {"condition":"AND","rules":[{"field":"application_name","operator":"equal","value":"My
                Application"}]}
              summary: Filter by application name
            byInterval:
              value: >-
                {"condition":"AND","rules":[{"field":"interval","operator":"equal","value":"3600"}]}
              summary: Filter by interval; 3600 (1 hour) or 86400 (1 day)
            byMetricDisplayName:
              value: >-
                {"condition":"AND","rules":[{"field":"metric_display_name","operator":"equal","value":"Traffic"}]}
              summary: >-
                Filter by metric display name; "Traffic", "Token Count",
                "Attribute", "Latency", or an evaluator display name
            byCreatedAt:
              value: >-
                {"condition":"AND","rules":[{"field":"created_at","operator":"gte","value":"2024-01-01T00:00:00Z"}]}
              summary: Filter by created date; supports gte, lte, gt, lt operators
            byTokenTypeDisplayName:
              value: >-
                {"condition":"AND","rules":[{"field":"token_type_display_name","operator":"equal","value":"genai_usage.input_tokens"}]}
              summary: Filter by token type display name (for token_count metrics)
            byAttributeDisplayName:
              value: >-
                {"condition":"AND","rules":[{"field":"attribute_display_name","operator":"equal","value":"llm.name"}]}
              summary: Filter by attribute display name (for attribute metrics)
            byAttributeValue:
              value: >-
                {"condition":"AND","rules":[{"field":"attribute_value","operator":"equal","value":"gpt-4"}]}
              summary: Filter by attribute value (for attribute metrics)
            byAggregationDisplayName:
              value: >-
                {"condition":"AND","rules":[{"field":"aggregation_display_name","operator":"equal","value":"Count"}]}
              summary: >-
                Filter by aggregation display name; "Sum", "Average", "P50
                (Median)", "P75", "P90", "P95", "P99", or "Count"
            byEvaluatorRuleName:
              value: >-
                {"condition":"AND","rules":[{"field":"evaluator_rule_name","operator":"equal","value":"my_sentiment_rule"}]}
              summary: Filter by evaluator rule name (for evaluator metrics)
            byEvaluatorOutputName:
              value: >-
                {"condition":"AND","rules":[{"field":"evaluator_output_name","operator":"equal","value":"sentiment"}]}
              summary: Filter by evaluator output name (for evaluator metrics)
            byEvaluatorOutputValue:
              value: >-
                {"condition":"AND","rules":[{"field":"evaluator_output_value","operator":"equal","value":"negative"}]}
              summary: >-
                Filter by evaluator output value (for evaluator metrics with
                count aggregation)
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/search'
      responses:
        '200':
          description: Paginated list of GenAI Alert Rules
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/GenAIAlertRuleListItem'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - genai-alert-rules-v3
      summary: Create GenAI Alert Rule
      description: Creates a new GenAI Alert Rule
      operationId: createGenAIAlertRule
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGenAIAlertRuleRequest'
      responses:
        '200':
          description: GenAI Alert Rule created successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/GenAIAlertRule'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/genai-alert-rules/{alert_rule_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - genai-alert-rules-v3
      summary: Get GenAI Alert Rule
      description: Retrieves a specific GenAI Alert Rule by its ID
      operationId: getGenAIAlertRule
      parameters:
        - $ref: '#/components/parameters/alert_rule_id'
      responses:
        '200':
          description: GenAI Alert Rule retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/GenAIAlertRule'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - genai-alert-rules-v3
      summary: Deletes a GenAI Alert Rule
      description: Deletes a GenAI Alert Rule
      operationId: deleteGenAIAlertRule
      parameters:
        - $ref: '#/components/parameters/alert_rule_id'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/genai-alert-rules/{alert_rule_id}/test-notification:
    x-fiddler-api-version: v3
    post:
      tags:
        - genai-alert-rules-v3
      summary: Send Test Notification
      description: >-
        Sends a test notification for a GenAI Alert Rule using the configured
        notification settings. The notification uses the actual alert email
        template with placeholder breach values so recipients can preview what a
        real alert notification will look like.
      operationId: testGenAIAlertRuleNotification
      parameters:
        - $ref: '#/components/parameters/alert_rule_id'
      responses:
        '200':
          description: Test notification processed successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/TestNotificationResult'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/events:
    x-fiddler-api-version: v3
    post:
      tags:
        - ingestion-v3
      summary: Publish events to Fiddler Platform
      description: Publish events to Fiddler Platform
      operationId: publishEvents
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishEventsRequest'
      responses:
        '200':
          description: Events uploaded
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PublishEventsResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - ingestion-v3
      summary: Delete events in Fiddler Platform
      description: Delete events in Fiddler Platform
      operationId: deleteEventsV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteEventsRequest'
      responses:
        '202':
          description: Events Deletion request received
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/DeleteEventsResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    patch:
      tags:
        - ingestion-v3
      summary: Publish update events to Fiddler Platform
      description: Publish update events to Fiddler Platform
      operationId: publishEventsUpdate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishEventsRequest'
      responses:
        '200':
          description: Events uploaded
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PublishEventsResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/jobs/{job_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - jobs-v3
      summary: Get async job details for a job id
      description: Get async job details for a job id
      operationId: getJobV3
      parameters:
        - $ref: '#/components/parameters/job_id'
        - $ref: '#/components/parameters/verbose'
      responses:
        '200':
          description: Success, Details of a job
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Job'
              examples:
                Example 1:
                  $ref: '#/components/examples/JobGet_Ex_1'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/jobs:
    x-fiddler-api-version: v3
    get:
      tags:
        - jobs-v3
      summary: Get details of all background/async jobs
      description: Get details of all background/async jobs
      operationId: getJobsV3
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Success, Details of all background/async jobs
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/Jobs'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/llm-gateway/providers:
    x-fiddler-api-version: v3
    get:
      tags:
        - llm-gateway-v3
      summary: List LLM providers
      description: Get list of LLM providers with pagination support
      operationId: getLLMProvidersV3
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of LLM providers
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/LLMProviders'
              examples:
                success:
                  summary: Successful response with providers
                  value:
                    api: v3
                    data:
                      items:
                        - id: 1
                          uuid: 550e8400-e29b-41d4-a716-446655440000
                          provider: OpenAI
                          credentials:
                            - name: Production Key
                              uuid: 550e8400-e29b-41d4-a716-446655440001
                              credential_type: api_key
                          models:
                            - name: gpt-4o-mini
                              uuid: 550e8400-e29b-41d4-a716-446655440006
                            - name: gpt-5-nano
                              uuid: 550e8400-e29b-41d4-a716-446655440007
                          created_at: '2025-01-08T00:00:00Z'
                          updated_at: '2025-01-08T00:00:00Z'
                          created_by:
                            id: 550e8400-e29b-41d4-a716-446655440002
                            full_name: Joe Schmoe
                            email: joe_schmoe@email.com
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - llm-gateway-v3
      summary: Create new LLM provider
      description: Create a new LLM provider with credentials and models
      operationId: createLLMProviderV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LLMProviderRequest'
            examples:
              openai_provider:
                summary: Create OpenAI provider with API key
                value:
                  provider: OpenAI
                  credentials:
                    - name: Production Key
                      credential_config:
                        credential_type: api_key
                        api_key: sk-...
                  models:
                    - name: gpt-4
                    - name: gpt-3.5-turbo
              anthropic_provider:
                summary: Create Anthropic provider with AWS role
                value:
                  provider: Anthropic
                  credentials:
                    - name: AWS Bedrock Access
                      credential_config:
                        credential_type: iam
                        cross_account_role_arn: arn:aws:iam::CUSTOMER-ACCOUNT:role/BedrockAccessRole
                        external_id: unique-external-id-for-customer-123
                        region: us-east-1
                  models:
                    - name: sonnet-3.7
                    - name: haiku-3
              vertex_ai_provider:
                summary: Create Vertex AI provider with GCP service account
                value:
                  provider: vertex_ai
                  credentials:
                    - name: GCP Service Account
                      credential_config:
                        credential_type: gcp_service_account
                        service_account_json: '{"type":"service_account","project_id":"my-project"}'
                        vertex_project: my-project-123
                        vertex_location: us-central1
                  models:
                    - name: gemini-2.5-pro
                    - name: gemini-2.5-flash
              databricks_provider:
                summary: Create Databricks provider with PAT and workspace URL
                value:
                  provider: Databricks
                  api_base: https://adb-xxx.azuredatabricks.net/serving-endpoints
                  credentials:
                    - name: Databricks PAT
                      credential_config:
                        credential_type: api_key
                        api_key: dapi...
                  models:
                    - name: databricks-meta-llama-3-1-405b-instruct
                    - name: my-custom-serving-endpoint
              databricks_oauth2_provider:
                summary: Create Databricks provider with OAuth2 client credentials
                value:
                  provider: Databricks
                  api_base: https://adb-xxx.azuredatabricks.net/serving-endpoints
                  credentials:
                    - name: Databricks Service Principal
                      credential_config:
                        credential_type: oauth2_client_credentials
                        token_url: https://adb-xxx.azuredatabricks.net/oidc/v1/token
                        client_id: 00000000-0000-0000-0000-000000000000
                        client_secret: dose...
                        scope: all-apis
                  models:
                    - name: databricks-meta-llama-3-1-405b-instruct
                    - name: my-custom-serving-endpoint
      responses:
        '200':
          description: LLM provider created successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/LLMProvider'
              examples:
                success:
                  summary: Provider created successfully
                  value:
                    api: v3
                    data:
                      id: 2
                      uuid: 550e8400-e29b-41d4-a716-446655440003
                      provider: OpenAI
                      credentials:
                        - name: Production Key
                          uuid: 550e8400-e29b-41d4-a716-446655440004
                          credential_type: api_key
                      models:
                        - name: gpt-4
                          uuid: 550e8400-e29b-41d4-a716-446655440008
                        - name: gpt-3.5-turbo
                          uuid: 550e8400-e29b-41d4-a716-446655440009
                      created_at: '2025-01-08T12:00:00Z'
                      updated_at: '2025-01-08T12:00:00Z'
                      created_by:
                        id: 550e8400-e29b-41d4-a716-446655440002
                        full_name: Joe Schmoe
                        email: joe_schmoe@email.com
                success_oauth2:
                  summary: Provider created successfully with OAuth2 client credentials
                  value:
                    api: v3
                    data:
                      id: 3
                      uuid: 550e8400-e29b-41d4-a716-446655440020
                      provider: Databricks
                      api_base: https://adb-xxx.azuredatabricks.net/serving-endpoints
                      credentials:
                        - name: Databricks Service Principal
                          uuid: 550e8400-e29b-41d4-a716-446655440021
                          credential_type: oauth2_client_credentials
                      models:
                        - name: databricks-meta-llama-3-1-405b-instruct
                          uuid: 550e8400-e29b-41d4-a716-446655440022
                      created_at: '2025-01-08T12:00:00Z'
                      updated_at: '2025-01-08T12:00:00Z'
                      created_by:
                        id: 550e8400-e29b-41d4-a716-446655440002
                        full_name: Joe Schmoe
                        email: joe_schmoe@email.com
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/llm-gateway/providers/{provider}:
    x-fiddler-api-version: v3
    put:
      tags:
        - llm-gateway-v3
      summary: Update LLM provider
      description: >
        Update an existing LLM provider's models and credentials. This is a
        replace operation - pass the complete desired state. For credentials:
        include existing ones (name/uuid) to keep them, add new ones
        (name/credential_config) to create them, omit any to remove them. For
        models: pass the complete list of desired models. Any fields not
        included will be removed.
      operationId: updateLLMProviderV3
      parameters:
        - $ref: '#/components/parameters/provider'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLLMProviderRequest'
            examples:
              update_models_only:
                summary: Update provider models only (replace all models)
                value:
                  provider: openai
                  models:
                    - name: gpt-4
                    - name: gpt-3.5-turbo
                    - name: gpt-4o-mini
              update_credentials_only:
                summary: >-
                  Update provider credentials only (keep existing, add new,
                  remove omitted)
                value:
                  provider: openai
                  credentials:
                    - name: Production Key
                      uuid: 550e8400-e29b-41d4-a716-446655440004
                    - name: Development Key
                      credential_config:
                        credential_type: api_key
                        api_key: sk-dev-...
              update_both:
                summary: Update both models and credentials (complete replace)
                value:
                  provider: openai
                  models:
                    - name: gpt-4
                    - name: gpt-3.5-turbo
                    - name: gpt-4o-mini
                  credentials:
                    - name: Production Key
                      uuid: 550e8400-e29b-41d4-a716-446655440004
                    - name: Development Key
                      credential_config:
                        credential_type: api_key
                        api_key: sk-dev-...
              update_credentials_oauth2:
                summary: Update credentials only with OAuth2 client credentials
                value:
                  provider: databricks
                  credentials:
                    - name: Databricks Service Principal
                      uuid: 550e8400-e29b-41d4-a716-446655440021
                    - name: Databricks SP (rotated)
                      credential_config:
                        credential_type: oauth2_client_credentials
                        token_url: https://adb-xxx.azuredatabricks.net/oidc/v1/token
                        client_id: 00000000-0000-0000-0000-000000000000
                        client_secret: dose...
                        scope: all-apis
              update_both_oauth2:
                summary: >-
                  Update both models and credentials with OAuth2 client
                  credentials
                value:
                  provider: databricks
                  api_base: https://adb-xxx.azuredatabricks.net/serving-endpoints
                  models:
                    - name: databricks-meta-llama-3-1-405b-instruct
                  credentials:
                    - name: Databricks Service Principal
                      credential_config:
                        credential_type: oauth2_client_credentials
                        token_url: https://adb-xxx.azuredatabricks.net/oidc/v1/token
                        client_id: 00000000-0000-0000-0000-000000000000
                        client_secret: dose...
                        scope: all-apis
      responses:
        '200':
          description: LLM provider updated successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/LLMProvider'
              examples:
                success:
                  summary: Provider updated successfully
                  value:
                    api: v3
                    data:
                      id: 1
                      uuid: 550e8400-e29b-41d4-a716-446655440000
                      provider: OpenAI
                      credentials:
                        - name: Production Key
                          uuid: 550e8400-e29b-41d4-a716-446655440004
                          credential_type: api_key
                        - name: Development Key
                          uuid: 550e8400-e29b-41d4-a716-446655440005
                          credential_type: api_key
                      models:
                        - name: gpt-4
                          uuid: 550e8400-e29b-41d4-a716-446655440008
                        - name: gpt-3.5-turbo
                          uuid: 550e8400-e29b-41d4-a716-446655440009
                        - name: gpt-4o-mini
                          uuid: 550e8400-e29b-41d4-a716-446655440010
                      created_at: '2025-01-08T00:00:00Z'
                      updated_at: '2025-01-08T13:00:00Z'
                      created_by:
                        id: 550e8400-e29b-41d4-a716-446655440002
                        full_name: Joe Schmoe
                        email: joe_schmoe@email.com
                success_oauth2:
                  summary: Provider updated successfully with OAuth2 client credentials
                  value:
                    api: v3
                    data:
                      id: 3
                      uuid: 550e8400-e29b-41d4-a716-446655440020
                      provider: Databricks
                      api_base: https://adb-xxx.azuredatabricks.net/serving-endpoints
                      credentials:
                        - name: Databricks Service Principal
                          uuid: 550e8400-e29b-41d4-a716-446655440021
                          credential_type: oauth2_client_credentials
                      models:
                        - name: databricks-meta-llama-3-1-405b-instruct
                          uuid: 550e8400-e29b-41d4-a716-446655440022
                      created_at: '2025-01-08T00:00:00Z'
                      updated_at: '2025-01-08T13:00:00Z'
                      created_by:
                        id: 550e8400-e29b-41d4-a716-446655440002
                        full_name: Joe Schmoe
                        email: joe_schmoe@email.com
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - llm-gateway-v3
      summary: Delete LLM provider
      description: Delete an LLM provider by name
      operationId: deleteLLMProviderV3
      parameters:
        - $ref: '#/components/parameters/provider'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/llm-gateway/test-connection:
    x-fiddler-api-version: v3
    post:
      tags:
        - llm-gateway-v3
      summary: Test LLM connection
      description: |
        Test that a registered model + credential combination works by sending
        a minimal LLM completion call. Returns HTTP `200` with success/failure
        for LLM-level results. Returns `4xx` for invalid inputs (unknown model,
        unknown credential, malformed request) before any LLM call is made.
      operationId: testLLMConnectionV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LLMGatewayTestRequest'
            examples:
              test_openai:
                summary: Test an OpenAI model connection
                value:
                  model_id: openai/gpt-4o
                  credential_uuid: 550e8400-e29b-41d4-a716-446655440001
      responses:
        '200':
          description: LLM call was attempted — check `success` field for result
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/LLMGatewayTestResponse'
              examples:
                success:
                  summary: Connection successful
                  value:
                    api_version: '3.0'
                    kind: NORMAL
                    data:
                      success: true
                      model: openai/gpt-4o
                      message: Connection successful
                      response_time_ms: 842
                llm_failure:
                  summary: LLM call failed (auth rejected by provider)
                  value:
                    api_version: '3.0'
                    kind: NORMAL
                    data:
                      success: false
                      model: openai/gpt-4o
                      message: 'AuthenticationError: Invalid API key'
                      response_time_ms: 1523
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/llm-gateway/providers/options:
    x-fiddler-api-version: v3
    get:
      tags:
        - llm-gateway-v3
      summary: Get available provider options
      description: Get available models for each supported LLM provider
      operationId: getLLMProviderOptionsV3
      responses:
        '200':
          description: Available provider options
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ProviderOptions'
              examples:
                success:
                  summary: Available provider options
                  value:
                    api: v3
                    data:
                      - provider: openai
                        display_name: OpenAI
                        credential_types:
                          - api_key
                        models:
                          - gpt-5
                          - gpt-4
                          - gpt-4o-mini
                          - gpt-3.5-turbo
                      - provider: anthropic
                        display_name: Anthropic
                        credential_types:
                          - api_key
                        models:
                          - sonnet-3.7
                          - haiku-3
                          - opus-3
                      - provider: vertex_ai
                        display_name: Vertex AI
                        credential_types:
                          - gcp_service_account
                        models:
                          - gemini-2.5-pro
                          - gemini-2.5-flash
                      - provider: databricks
                        display_name: Databricks
                        credential_types:
                          - api_key
                          - oauth2_client_credentials
                        models:
                          - databricks-meta-llama-3-1-405b-instruct
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models:
    x-fiddler-api-version: v3
    get:
      tags:
        - model-v3
      summary: List models
      description: Get list of model for provided query and filters
      operationId: getModelsV3
      parameters:
        - $ref: '#/components/parameters/latest_only'
        - $ref: '#/components/parameters/project_id_query'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of models for provided query and filters
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/ListModelResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - model-v3
      summary: Add a new model under a project
      description: Add a new model under a project
      operationId: addModelV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddModelRequestBody'
      responses:
        '200':
          description: Created model JSON response
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ModelDetailResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models/{model_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - model-v3
      summary: Get details of a model
      description: Details of a model for given model id
      operationId: getModelV3
      parameters:
        - $ref: '#/components/parameters/model_id'
      responses:
        '200':
          description: Model JSON response for provided model id
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ModelDetailResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - model-v3
      summary: Delete a model
      description: Delete a model
      operationId: deleteModelV3
      parameters:
        - $ref: '#/components/parameters/model_id'
      responses:
        '202':
          description: Details of a model delete job
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/DeleteModelResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    patch:
      tags:
        - model-v3
      summary: Update the fields of a model
      description: |
        Update the fields of a model.

        **Schema and spec consistency.** This endpoint does not enforce
        consistency between the model `schema` (the list of columns) and
        the model `spec` (which assigns each column a role such as
        `inputs`, `outputs`, `targets`, `decisions`, `metadata`, or
        `custom_features`). If you add a column to `schema` without also
        adding it to the appropriate `spec` array, the column will be
        ingested into the raw events table but will not appear anywhere
        else in the Fiddler UI.

        **PATCH replaces nested objects wholesale.** When you PATCH the
        `spec` (or `schema`) field, the request body replaces the entire
        nested object — any role array you omit (`inputs`, `outputs`,
        `targets`, `decisions`, `metadata`, `custom_features`) is reset
        to empty on the server. Always read the current model first and
        merge your additions into the existing arrays before sending the
        PATCH.

        To add columns safely, follow the multi-step sequence shown in the
        code samples on the right:

        1. `GET /v3/models/{model_id}` — retrieve the current `schema` and
           `spec`.
        2. `PATCH /v3/models/{model_id}` with an updated `schema`
           containing the existing columns plus the new columns.
        3. `PATCH /v3/models/{model_id}` with an updated `spec` that
           preserves every existing role array and adds the new columns
           to the appropriate one.

        The Fiddler Python SDK and the Fiddler UI enforce this consistency
        automatically; this note applies to direct REST API integrations.
      operationId: updateModelV3
      parameters:
        - $ref: '#/components/parameters/model_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateModelRequest'
      responses:
        '200':
          description: Updated model JSON response
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ModelDetailResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
      x-codeSamples:
        - lang: shell
          label: curl — schema + spec update
          source: |
            # Requires `jq`. PATCH replaces nested objects wholesale, so each
            # step reads the current value first and merges before sending.

            # 1. Retrieve the current model.
            current=$(curl -sS "$FIDDLER_URL/v3/models/$MODEL_ID" \
              -H "Authorization: Bearer $FIDDLER_TOKEN")

            # 2. PATCH the schema with existing columns + new column.
            new_schema=$(echo "$current" | jq '.data.schema
              | .columns += [{"name": "new_feature", "data_type": "float"}]')
            curl -sS -X PATCH "$FIDDLER_URL/v3/models/$MODEL_ID" \
              -H "Authorization: Bearer $FIDDLER_TOKEN" \
              -H "Content-Type: application/json" \
              -d "$(jq -n --argjson s "$new_schema" '{schema: $s}')"

            # 3. PATCH the spec with the existing roles preserved and the
            #    new column appended to `inputs`. Without this step the new
            #    column will not appear in the UI beyond the raw events
            #    table; without preserving the other arrays, existing
            #    outputs / targets / decisions / metadata / custom_features
            #    would be wiped.
            new_spec=$(echo "$current" | jq '.data.spec
              | .inputs += ["new_feature"]')
            curl -sS -X PATCH "$FIDDLER_URL/v3/models/$MODEL_ID" \
              -H "Authorization: Bearer $FIDDLER_TOKEN" \
              -H "Content-Type: application/json" \
              -d "$(jq -n --argjson s "$new_spec" '{spec: $s}')"
        - lang: python
          label: Python (requests) — schema + spec update
          source: >
            import os

            import requests


            base_url = os.environ["FIDDLER_URL"].rstrip("/")

            model_id = os.environ["MODEL_ID"]

            headers = {
                "Authorization": f"Bearer {os.environ['FIDDLER_TOKEN']}",
                "Content-Type": "application/json",
            }

            url = f"{base_url}/v3/models/{model_id}"


            # 1. Retrieve the current model so you have the existing schema and
            spec.

            resp = requests.get(url, headers=headers)

            resp.raise_for_status()

            current = resp.json()["data"]


            # 2. PATCH the schema with the existing columns preserved and

            #    the new column appended. Read-then-merge mirrors the spec

            #    PATCH below: any top-level schema field you omit (e.g.

            #    schema_version) is reset to its server-side default.

            new_schema = dict(current.get("schema") or {})

            new_schema["columns"] = list(new_schema.get("columns") or []) + [
                {"name": "new_feature", "data_type": "float"},
            ]

            requests.patch(
                url,
                headers=headers,
                json={"schema": new_schema},
            ).raise_for_status()


            # 3. PATCH the spec with the existing roles preserved and the

            #    new column appended to `inputs`. Without this step the new

            #    column will not appear in the UI beyond the raw events

            #    table; without preserving the other arrays, existing

            #    outputs / targets / decisions / metadata / custom_features

            #    would be wiped.

            new_spec = dict(current.get("spec") or {})

            new_spec["inputs"] = list(new_spec.get("inputs") or []) +
            ["new_feature"]

            requests.patch(
                url,
                headers=headers,
                json={"spec": new_spec},
            ).raise_for_status()
  /v3/model-factory:
    x-fiddler-api-version: v3
    post:
      tags:
        - model-v3
      summary: Generate model from the given data sample
      description: Generate model from the given data sample
      operationId: modelFactory
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelFactoryRequest'
      responses:
        '200':
          description: Generated model
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ModelFactoryResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models/{model_id}/deploy-artifact:
    x-fiddler-api-version: v3
    put:
      tags:
        - model-v3
      summary: Update artifacts associated with the model
      description: Update artifacts associated with the model
      operationId: deployModelArtifactUpdateV3
      parameters:
        - $ref: '#/components/parameters/model_id'
        - $ref: '#/components/parameters/deployment_params'
      responses:
        '200':
          description: Updated Model Artifacts
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          job:
                            $ref: '#/components/schemas/JobCompact'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - model-v3
      summary: Upload artifacts associated with the model
      description: Upload artifacts associated with the model
      operationId: deployModelArtifactV3
      parameters:
        - $ref: '#/components/parameters/model_id'
        - $ref: '#/components/parameters/deployment_params'
      responses:
        '200':
          description: Deployed Model Artifacts
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          job:
                            $ref: '#/components/schemas/JobCompact'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models/{model_id}/deploy-surrogate:
    x-fiddler-api-version: v3
    put:
      tags:
        - model-v3
      summary: Update a surrogate model
      description: Update a surrogate model
      operationId: deploySurrogateUpdateV3
      parameters:
        - $ref: '#/components/parameters/model_id'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/DeploySurrogateRequest'
      responses:
        '202':
          description: Surrogate model updating task with job id
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          job:
                            $ref: '#/components/schemas/JobCompact'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - model-v3
      summary: Deploy a surrogate model
      description: Deploy a surrogate model
      operationId: deploySurrogateV3
      parameters:
        - $ref: '#/components/parameters/model_id'
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/DeploySurrogateRequest'
      responses:
        '202':
          description: Surrogate model generation task with job id
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          job:
                            $ref: '#/components/schemas/JobCompact'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models/{model_id}/columns:
    x-fiddler-api-version: v3
    get:
      tags:
        - model-v3
      summary: Details of all columns
      description: Details of all columns for a model
      operationId: getModelAllColumnsV3
      parameters:
        - $ref: '#/components/parameters/model_id'
      responses:
        '200':
          description: Details of all columns for a model
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/ModelColumns'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models/{model_id}/columns/{column_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - model-v3
      description: Details of a specific column for a model
      operationId: getModelColumnV3
      parameters:
        - $ref: '#/components/parameters/model_id'
        - $ref: '#/components/parameters/column_id'
      responses:
        '200':
          description: Details of a specific column for a model
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ModelSchemaColumnObject'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/projects:
    x-fiddler-api-version: v3
    get:
      tags:
        - project-v3
      summary: List of projects
      description: List of projects
      operationId: getProjectsV3
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/with_asset_count'
      responses:
        '200':
          description: List of projects
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/Projects'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - project-v3
      summary: Create new project
      description: Create new project
      operationId: createProjectV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectRequest'
      responses:
        '200':
          description: Details of the created project
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Project'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/projects/{project_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - project-v3
      summary: Detail info of a project for the specified project id
      description: Detail info of a project
      operationId: getProjectV3
      parameters:
        - $ref: '#/components/parameters/project_id'
        - $ref: '#/components/parameters/with_asset_count'
      responses:
        '200':
          description: Detail info of the project
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Project'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - project-v3
      summary: Delete project by id
      description: Delete project by id
      operationId: deleteProjectV3
      parameters:
        - $ref: '#/components/parameters/project_id'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/scores:
    x-fiddler-api-version: v3
    get:
      tags:
        - scores-v3
      summary: List scores
      description: >
        List scores with optional filters. Supports filtering by target (span,
        trace, session), score name, source, level, type, annotator, config
        name, and time range. All filter parameters accept comma-separated
        values for multi-value matching.


        Ordering: use the `ordering` query param to sort results. Prefix a field
        name with `-` for descending. Default is `-created_at`. Valid fields:
        created_at, name, score_type, source, score_level, annotator_id,
        config_name, timestamp. The `timestamp` field sorts by the underlying
        target's timestamp (span/trace/session ingest time), which is not
        exposed as a separate field in the response.
      operationId: listScores
      parameters:
        - name: application_id
          in: query
          description: Application UUID (required for auth scoping and partition pruning)
          required: true
          schema:
            type: string
            format: uuid
        - name: span_id
          in: query
          description: Filter by span ID(s). Comma-separated for multiple values.
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
        - name: trace_id
          in: query
          description: Filter by trace ID(s). Comma-separated for multiple values.
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
        - name: session_id
          in: query
          description: Filter by session ID(s). Comma-separated for multiple values.
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
        - name: name
          in: query
          description: Filter by score name(s). Comma-separated for multiple values.
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
        - name: source
          in: query
          description: >
            Filter by score source(s). Comma-separated for multiple values.
            Accepts evaluator for reading (POST restricts to non-evaluator
            sources).
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - evaluator
                - human
                - llm
                - code
          style: form
          explode: false
        - name: score_level
          in: query
          description: Filter by score level(s). Comma-separated for multiple values.
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - span
                - trace
                - session
          style: form
          explode: false
        - name: score_type
          in: query
          description: Filter by score type(s). Comma-separated for multiple values.
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - numeric
                - boolean
                - categorical
                - text
                - vector
          style: form
          explode: false
        - name: annotator_id
          in: query
          description: Filter by annotator ID(s). Comma-separated for multiple values.
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
        - name: config_name
          in: query
          description: Filter by config name(s). Comma-separated for multiple values.
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
        - name: score_ids
          in: query
          description: Filter by score UUID(s). Comma-separated for multiple values.
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
          style: form
          explode: false
        - name: start_time
          in: query
          description: >
            Scores with target timestamp >= start_time (ISO 8601). Filters on
            the underlying event's timestamp (span/trace/session ingest time),
            not the score's created_at.
          required: false
          schema:
            type: string
            format: date-time
        - name: end_time
          in: query
          description: >
            Scores with target timestamp < end_time (ISO 8601). Filters on the
            underlying event's timestamp (span/trace/session ingest time), not
            the score's created_at.
          required: false
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          description: Number of results per page (default 100, max 500)
          required: false
          schema:
            type: integer
            default: 100
            maximum: 500
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/ordering'
      responses:
        '200':
          description: Paginated list of scores
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/ScoreResponse'
              example:
                data:
                  items:
                    - id: 660e8400-e29b-41d4-a716-446655440001
                      application_id: 550e8400-e29b-41d4-a716-446655440000
                      name: correctness
                      score_level: span
                      score_type: numeric
                      source: human
                      value: 0.95
                      created_at: '2026-06-15T10:30:00Z'
                  total: 1
                  page_size: 50
                  page_count: 1
                  page_index: 1
                  item_count: 1
                  offset: 0
                api_version: '3.0'
                kind: PAGINATED
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - scores-v3
      summary: Create a score
      description: >
        Create a new score or annotation. Evaluator scores are read-only through
        this API — only human, LLM, and code sources are accepted. Returns 201
        on success.
      operationId: createScore
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScoreRequest'
            example:
              application_id: 550e8400-e29b-41d4-a716-446655440000
              name: correctness
              span_id: abc123
              score_type: numeric
              value: 0.95
              source: human
              reasoning: Answer was factually accurate
      responses:
        '201':
          description: Score created successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ScoreResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/scores/{score_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - scores-v3
      summary: Get a single score
      description: Retrieve a single score by its ID.
      operationId: getScore
      parameters:
        - name: score_id
          in: path
          description: Score UUID
          required: true
          schema:
            type: string
            format: uuid
        - name: application_id
          in: query
          description: Application UUID (required for auth scoping and partition pruning)
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Score found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ScoreResponse'
              example:
                data:
                  id: 660e8400-e29b-41d4-a716-446655440001
                  application_id: 550e8400-e29b-41d4-a716-446655440000
                  name: correctness
                  score_level: span
                  score_type: numeric
                  span_id: abc123
                  source: human
                  annotator_id: user@example.com
                  value: 0.95
                  reasoning: Answer was factually accurate
                  metadata: {}
                  created_at: '2026-06-15T10:30:00Z'
                api_version: '3.0'
                kind: NORMAL
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - scores-v3
      summary: Delete a score
      description: >
        Delete a score by ID. Returns 204 No Content on success. Idempotent —
        returns 204 even if the score does not exist. Returns 403 if source is
        evaluator.
      operationId: deleteScore
      parameters:
        - name: score_id
          in: path
          description: Score UUID
          required: true
          schema:
            type: string
            format: uuid
        - name: application_id
          in: query
          description: Application UUID (required for auth scoping)
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          $ref: '#/components/responses/204'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    patch:
      tags:
        - scores-v3
      summary: Update a score
      description: >
        Partially update a score. Only value fields (value, label, text,
        reasoning, metadata) can be updated. Identity and structural fields
        (name, score_type, source, targets) cannot be changed — create a new
        score instead. Returns 403 if source is evaluator.
      operationId: updateScore
      parameters:
        - name: score_id
          in: path
          description: Score UUID
          required: true
          schema:
            type: string
            format: uuid
        - name: application_id
          in: query
          description: Application UUID (required for auth scoping and partition pruning)
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateScoreRequest'
            example:
              value: 0.85
              reasoning: Revised assessment after further review
      responses:
        '200':
          description: Score updated successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ScoreResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/scores/bulk:
    x-fiddler-api-version: v3
    post:
      tags:
        - scores-v3
      summary: Bulk create scores
      description: >
        Create up to 100 scores in a single request. Per-item validation errors
        are collected and returned; valid items are committed together in a
        single batch insert. Infrastructure errors bubble as 500.
      operationId: bulkCreateScores
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkCreateScoresRequest'
            example:
              application_id: 550e8400-e29b-41d4-a716-446655440000
              scores:
                - name: correctness
                  span_id: span-001
                  score_type: numeric
                  value: 0.95
                  source: human
                - name: sentiment
                  span_id: span-002
                  score_type: categorical
                  label: positive
                  source: llm
                  annotator_id: gpt-4o
      responses:
        '200':
          description: >
            Bulk operation completed. Always returns 200 regardless of per-item
            outcome — check the errors array for individual item failures. A
            fully-failed batch still returns 200 with created: 0 and a populated
            errors array.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/BulkCreateScoresResponse'
              example:
                data:
                  created: 2
                  errors: []
                api_version: '3.0'
                kind: NORMAL
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/segments:
    x-fiddler-api-version: v3
    get:
      tags:
        - segments-v3
      summary: List all segments
      description: List all segments
      operationId: getSegmentsV3
      parameters:
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of all segments
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/Segment'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - segments-v3
      summary: Create new segment
      description: Create new segment
      operationId: createSegmentV3
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CreateSegmentRequest'
      responses:
        '200':
          description: Segment successfully created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        allOf:
                          - $ref: '#/components/schemas/Segment'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/segments/{uuid}:
    x-fiddler-api-version: v3
    get:
      tags:
        - segments-v3
      summary: Detail info of a segment
      description: Detail info of a segment
      operationId: getSegmentV3
      parameters:
        - $ref: '#/components/parameters/uuid_path'
      responses:
        '200':
          description: Get detail info
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        allOf:
                          - $ref: '#/components/schemas/Segment'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - segments-v3
      summary: Delete segment by uuid
      description: Delete segment by uuid
      operationId: deleteSegmentV3
      parameters:
        - $ref: '#/components/parameters/uuid_path'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/models/{model_id}/segments:
    x-fiddler-api-version: v3
    get:
      tags:
        - segments-v3
      summary: List all segments for a model
      description: List all segments for a model
      operationId: getModelSegmentsV3
      parameters:
        - $ref: '#/components/parameters/model_id'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/search'
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: List of all segments for a model
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/Segment'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/server-info:
    x-fiddler-api-version: v3
    get:
      tags:
        - server-info-v3
      summary: Get server info
      description: Get detailed information about the Fiddler server.
      operationId: getServerInfoV3
      responses:
        '200':
          description: Server information retrieved successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ServerInfoResponse'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/sessions:
    x-fiddler-api-version: v3
    delete:
      tags:
        - sessions-v3
      summary: Delete Sessions
      description: >-
        Delete one or more sessions and all associated data (spans, attributes,
        evaluator scores, and span content) from the application. This operation
        is idempotent — returns 204 even if the sessions do not exist.
      operationId: deleteSessionsV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteSessionsRequest'
      responses:
        '204':
          description: Sessions deleted successfully
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/spans/fields:
    x-fiddler-api-version: v3
    post:
      tags:
        - span-v3
      summary: Get span field coverage
      description: >-
        Given a filter over spans, return the union of span attribute keys and
        evaluator outputs that appear in the matching spans, along with a
        coverage count for each field.


        Useful for schema discovery and data completeness analysis — e.g. before
        adding spans to an evaluation dataset, an agent or UI can call this
        endpoint to understand which attributes are present and how consistently
        they appear across the selected spans, without fetching full span
        payloads.


        The query is bounded internally to the first 10,000 matching spans. When
        this cap is reached, `sampled` is set to `true` and counts are
        approximate.
      operationId: getSpanFieldsV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpanFieldsRequest'
            example:
              application_id: c688de46-2054-49ab-b85f-0f0178cb44d7
              start_time: '2026-05-01T00:00:00Z'
              end_time: '2026-05-18T23:59:59Z'
              filter:
                condition: AND
                rules:
                  - field: Span::span_type
                    operator: eq
                    value: llm
      responses:
        '200':
          description: Span field coverage for the matching spans
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/SpanFieldsResponse'
              example:
                data:
                  total_spans: 10000
                  sampled: true
                  span_attributes:
                    - key: system.gen_ai.usage.input_tokens
                      count: 10000
                    - key: system.gen_ai.usage.output_tokens
                      count: 10000
                    - key: system.gen_ai.context.retrieval
                      count: 5
                  evaluator_outputs:
                    - rule_name: Safety
                      output_name: is_toxic
                      count: 10000
                    - rule_name: Faithfulness
                      output_name: score
                      count: 3200
                api_version: '3.0'
                kind: NORMAL
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/spans/query:
    x-fiddler-api-version: v3
    post:
      tags:
        - span-v3
      summary: Query spans
      description: Search, filter, and paginate through spans with advanced criteria
      operationId: querySpansV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpanQueryRequest'
      responses:
        '200':
          description: A paginated list of spans matching the query
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/SpanQueryResponseItems'
        '400':
          $ref: '#/components/responses/400'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying
            X-RateLimit-Limit:
              schema:
                type: string
              description: Rate limit policy
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining requests in current window
            X-RateLimit-Reset:
              schema:
                type: integer
              description: Unix timestamp when the rate limit resets
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/traces:
    x-fiddler-api-version: v3
    delete:
      tags:
        - traces-v3
      summary: Delete Traces
      description: >-
        Delete one or more traces and all associated data (spans, attributes,
        evaluator scores, and span content) from the application. This operation
        is idempotent — returns 204 even if the traces do not exist.
      operationId: deleteTracesV3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteTracesRequest'
      responses:
        '204':
          description: Traces deleted successfully
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/user-access-keys:
    x-fiddler-api-version: v3
    get:
      tags:
        - user-access-key
      summary: List the caller's API keys.
      description: >
        List the authenticated user's API keys. Returns API key metadata only —
        secrets and hashes are never returned. Results are paginated.
      operationId: listUserAccessKeys
      parameters:
        - $ref: '#/components/parameters/ordering'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: >
            Paginated list of the caller's API keys. Pagination metadata (total,
            offset, page_size) is included in the response envelope.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/UserAccessKeyListResponseBody'
                          max_access_keys_per_user:
                            type: integer
                            description: >
                              Maximum number of API keys the caller can create
                              within the current organization. Compare total
                              against this value to disable API key creation at
                              capacity.
                            example: 5
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    post:
      tags:
        - user-access-key
      summary: Create a new API key.
      description: >
        Create a new API key for the authenticated user. Requires a unique name
        per user per organization. The full composite API key (key_id.secret) is
        returned once in the response and cannot be retrieved again. Enforces
        MAX_ACCESS_KEYS_PER_USER limit (default 5, new table only).
      operationId: createUserAccessKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAccessKeyCreateRequestBody'
      responses:
        '201':
          description: >
            API key created successfully. The token field contains the full
            composite key_id.secret — this is the only time the secret is
            available.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/UserAccessKeyTokenResponseBody'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/user-access-keys/{key_id}:
    x-fiddler-api-version: v3
    get:
      tags:
        - user-access-key
      summary: Get a single API key.
      description: >
        Get metadata for a single API key owned by the authenticated user.
        Returns `404` if the API key is not found or belongs to another user.
      operationId: getUserAccessKey
      parameters:
        - $ref: '#/components/parameters/key_id'
      responses:
        '200':
          description: API key metadata.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/UserAccessKeySingleResponseBody'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    delete:
      tags:
        - user-access-key
      summary: Delete an API key.
      description: >
        Delete an API key. The API key is permanently removed and can no longer
        be used for authentication.
      operationId: deleteUserAccessKey
      parameters:
        - $ref: '#/components/parameters/key_id'
      responses:
        '204':
          $ref: '#/components/responses/204'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
    patch:
      tags:
        - user-access-key
      summary: Update an API key.
      description: >
        Update an API key's mutable fields. Supports updating the API key name
        and expiration. The new expires_at must be a future timestamp (greater
        than current time) and cannot exceed 100 years from now.
      operationId: updateUserAccessKey
      parameters:
        - $ref: '#/components/parameters/key_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAccessKeyUpdateRequestBody'
      responses:
        '200':
          description: API key updated successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/UserAccessKeySingleResponseBody'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
  /v3/users:
    x-fiddler-api-version: v3
    get:
      tags:
        - users-v3
      summary: >-
        This API is used to get identity and access related information of a
        user. It also provides details into the last successful login of the
        user.
      description: List users
      operationId: getUsersV3
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: >-
            This API is used to get user's identity and access related
            information. It also provides details about the last successful
            login users.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items:
                            $ref: '#/components/schemas/Users'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
      x-fiddler-is-internal: false
components:
  schemas:
    ApiResponse:
      type: object
      description: |
        Response object for standard API responses.
      properties:
        api_version:
          type: string
          default: '3.0'
          enum:
            - '2.0'
            - '3.0'
          description: |
            API version.
        kind:
          type: string
          default: NORMAL
          enum:
            - NORMAL
          description: |
            Type of response, indicating a normal response.
    PaginatedApiResponse:
      type: object
      description: |
        Response object for paginated API responses.
      properties:
        api_version:
          type: string
          default: '3.0'
          enum:
            - '2.0'
            - '3.0'
          description: |
            API version of the response.
        kind:
          type: string
          default: PAGINATED
          enum:
            - PAGINATED
          description: |
            Type of response, indicating a paginated response.
        data:
          type: object
          properties:
            page_size:
              type: integer
              default: 10
              example: 10
              description: |
                Number of items per page in the response.
            item_count:
              type: integer
              default: 10
              example: 10
              description: |
                Number of items in the current page.
            total:
              type: integer
              example: 100
              default: 100
              description: |
                Total number of items across all pages.
            page_count:
              type: integer
              default: 10
              example: 10
              description: |
                Total number of pages.
            page_index:
              type: integer
              default: 1
              example: 1
              description: |
                Current page index.
            offset:
              type: integer
              default: 0
              example: 0
              description: |
                Offset of the first item in the current page.
    ErrorResponse:
      type: object
      description: |
        Response object for errors returned by the API.
      properties:
        api_version:
          type: string
          default: '3.0'
          enum:
            - '2.0'
            - '3.0'
          description: |
            API version of the response.
        kind:
          type: string
          default: ERROR
          enum:
            - ERROR
          description: |
            Type of response, usually indicating an error.
        error:
          type: object
          properties:
            code:
              type: integer
              format: int32
              description: >
                Represents the code for this error, typically an HTTP response
                code.
              default: 400
              enum:
                - 400
                - 403
                - 404
                - 500
            message:
              type: string
              description: >
                A human-readable message providing more details about the error.
                If there are multiple errors, it will be the message for the
                first error.
              example: Resource Not Found
            errors:
              type: array
              description: >
                Container for additional information regarding the error,
                especially for multiple errors.
              items:
                type: object
                properties:
                  reason:
                    type: string
                    description: >
                      Unique identifier for this error, different from the error
                      code.
                    example: ResourceNotFoundException
                  message:
                    type: string
                    description: >
                      A human-readable message providing more details about the
                      error. If there is only one error, this field will match
                      error.message.
                    example: Resource Not Found
                  help:
                    type: string
                    description: >
                      Link to support or documentation providing more
                      information on the error.
    EnrichmentName:
      type: string
      description: Type of enrichment
      enum:
        - topic_classification
        - embedding
        - token_count
        - answer_relevance
        - coherence
        - conciseness
        - rag_faithfulness
        - pii_detection
        - ftl_prompt_safety
        - secret_detection
        - sentiment_analysis
        - ftl_response_faithfulness
        - llm_as_a_judge
    TraceId:
      type: string
      description: OpenTelemetry trace ID (32-character hex string, all-zeros excluded)
      maxLength: 32
      minLength: 32
      pattern: ^(?!0{32})[0-9a-f]{32}$
    SessionId:
      type: string
      description: Session ID grouping related traces
      minLength: 1
    SpanType:
      type: string
      enum:
        - llm
        - tool
        - agent
        - chain
    TimeUnit:
      type: string
      enum:
        - microseconds
        - milliseconds
        - seconds
        - minutes
    EvaluatorFilter:
      type: object
      title: Rule Evaluator Filters
      description: Filters for rule evaluators
      required:
        - name
        - output_name
      properties:
        name:
          type: string
        output_name:
          type: string
        min:
          type: number
          description: Filter values greater or equal than this minimal value
        max:
          type: number
          description: Filter values lower or equal than this maximal value
        categories:
          type: array
          description: Filter values in those categories
          items:
            anyOf:
              - type: string
              - type: boolean
    AttributeFilter:
      type: object
      title: Attribute Filters
      description: Filters for attributes(span and session)
      required:
        - name
      properties:
        name:
          type: string
        min:
          type: number
          description: Filter values greater or equal than this minimal value
        max:
          type: number
          description: Filter values lower or equal than this maximal value
        categories:
          type: array
          description: Filter values in those categories(when attribute is categorical)
          items:
            anyOf:
              - type: string
              - type: number
    TokenCountFilter:
      type: object
      title: Token Count Filters
      description: Filters for token counts
      required:
        - name
      properties:
        name:
          type: string
        min:
          type: number
          description: Filter values greater or equal than this minimal value
        max:
          type: number
          description: Filter values lower or equal than this maximal value
    LatencyFilter:
      type: object
      title: Latency Filters
      description: Filters for latency
      required:
        - name
        - unit
      properties:
        name:
          type: string
        min:
          type: number
          description: Filter values greater or equal than this minimal value
        max:
          type: number
          description: Filter values lower or equal than this maximal value
        unit:
          $ref: '#/components/schemas/TimeUnit'
    FeatureDistributionConfig:
      type: object
      properties:
        config_type:
          type: string
          enum:
            - DISTRIBUTION
        visualization:
          description: Preferred type of visualization for feature distribution
          type: string
          enum:
            - HISTOGRAM
            - KERNEL_DENSITY_ESTIMATE
    Segment:
      type: object
      required:
        - id
        - name
        - description
        - definition
        - organization
        - project
        - model
        - created_at
        - updated_at
        - created_by
        - updated_by
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        definition:
          type: string
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        model:
          $ref: '#/components/schemas/ModelCompact'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        created_by:
          $ref: '#/components/schemas/UserCompact'
        updated_by:
          $ref: '#/components/schemas/UserCompact'
    SegmentWithoutID:
      type: object
      required:
        - name
        - definition
      properties:
        organization_name:
          type: string
        project_name:
          type: string
        model_name:
          type: string
        name:
          type: string
        description:
          type: string
        definition:
          type: string
    SegmentCompactIdOrDefinition:
      type: object
      description: UMAP's Segment compact representation
      properties:
        id:
          type: string
          format: uuid
          description: Identifier for saved segments
          nullable: true
        definition:
          type: string
          description: FDL definition for segment
          nullable: true
    CustomMetric:
      type: object
      required:
        - id
        - name
        - description
        - definition
        - organization
        - project
        - model
        - created_at
        - updated_at
        - created_by
        - updated_by
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        definition:
          type: string
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        model:
          $ref: '#/components/schemas/ModelCompact'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        created_by:
          $ref: '#/components/schemas/UserCompact'
        updated_by:
          $ref: '#/components/schemas/UserCompact'
    CustomMetricWithoutID:
      type: object
      required:
        - name
        - definition
      properties:
        organization_name:
          type: string
        project_name:
          type: string
        model_name:
          type: string
        name:
          type: string
        description:
          type: string
        definition:
          type: string
    ProjectRoleEnum:
      type: string
      description: >
        Defines the different types of project roles that can be assigned to
        users or teams.
      enum:
        - Project Admin
        - Project Writer
        - Project Viewer
        - Project Dashboard Viewer
    OrgRoleEnum:
      type: string
      description: >
        Defines the organization-level roles a user can hold. The `Deactivated`
        backend value is intentionally excluded as deactivated users do not
        appear in user-facing lists.
      enum:
        - Org Admin
        - Org Member
        - Org Viewer
    ModelTaskEnum:
      type: string
      description: |
        Enumeration of different types of model tasks.
      enum:
        - binary_classification
        - multiclass_classification
        - regression
        - ranking
        - not_set
        - llm
    ModelArtifactStatusEnum:
      type: string
      description: |
        Enumeration of different model artifact statuses.
      enum:
        - no_model
        - surrogate
        - user_uploaded
    ModelInputTypeEnum:
      type: string
      description: |
        Enumeration of different model input types.
      enum:
        - text
        - structured
    ArtifactTypeEnum:
      type: string
      description: |
        Enumeration of different artifact types.
      enum:
        - SURROGATE
        - PYTHON_PACKAGE
    ModelObject:
      type: object
      description: Model fields JSON
      required:
        - id
        - name
        - input_type
        - task
        - organization
        - project
        - algorithm
        - framework
        - deleted_at
        - created_at
        - updated_at
        - created_by
        - version
        - artifact_status
        - status
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: UUID format unique identifier for model
            name:
              type: string
              description: Name of the model
            version:
              type: string
              description: Version of the model
              default: v1
            status:
              type: string
              enum:
                - LIVE
                - DRAFT
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            input_type:
              $ref: '#/components/schemas/ModelInputTypeEnum'
            task:
              $ref: '#/components/schemas/ModelTaskEnum'
            description:
              type: string
              nullable: true
            owner:
              $ref: '#/components/schemas/UserCompact'
            deployment_date:
              type: string
              format: date-time
              nullable: true
              description: Date the model was deployed on
            artifact_status:
              $ref: '#/components/schemas/ModelArtifactStatusEnum'
            deleted_at:
              type: string
              format: date-time
              nullable: true
              description: flag used internally to support soft delete of model
            algorithm:
              type: string
              nullable: true
              description: Model algorithm
            framework:
              type: string
              description: >-
                A string providing information about the software library and
                version used to train and run this model
              nullable: true
            created_by:
              $ref: '#/components/schemas/UserCompact'
            updated_by:
              $ref: '#/components/schemas/UserCompact'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    QueryFilters:
      type: object
      title: QueryFilter
      description: |
        Filters for querying data, including time, time zone, and bin size.
      required:
        - time_zone
        - bin_size
      properties:
        time_label:
          type: string
          enum:
            - yesterday
            - today
            - 7d
            - 30d
            - 90d
            - 6m
            - 12m
            - ytd
            - null
          nullable: true
          description: |
            Time label for filtering data within specific time ranges.
        time_range:
          type: object
          nullable: true
          properties:
            start_time:
              type: string
              format: date-time
              description: |
                Start time of the time range for querying data.
            end_time:
              type: string
              format: date-time
              description: |
                End time of the time range for querying data.
          required:
            - start_time
            - end_time
          description: |
            Custom time range for querying data.
        time_zone:
          type: string
          default: Etc/GMT
          description: |
            Time zone used for data filtering.
        bin_size:
          type: string
          enum:
            - Hour
            - Day
            - Week
            - Month
            - Quarter
          default: Hour
          description: |
            Bin size for grouping data in queries, defaulting to hourly bins.
    LLMQueryFilters:
      type: object
      title: LLM Query Filters
      description: Filters for querying data
      properties:
        agents:
          type: array
          items:
            type: string
          description: List of agent names to filter by
          default: []
        span_groups:
          type: array
          items:
            type: string
          description: List of span groups to filter by
          default: []
        span_types:
          type: array
          description: List of span types to filter by
          items:
            $ref: '#/components/schemas/SpanType'
          default: []
        evaluator_rules:
          type: array
          items:
            $ref: '#/components/schemas/EvaluatorFilter'
          default: []
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/AttributeFilter'
          default: []
        token_counts:
          type: array
          items:
            $ref: '#/components/schemas/TokenCountFilter'
          default: []
        latency:
          type: array
          items:
            $ref: '#/components/schemas/LatencyFilter'
          default: []
    CreateUpdateTimestamp:
      type: object
      required:
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: |
            Date and time when the object was created.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: |
            Date and time when the object was last updated.
    UserCompact:
      type: object
      title: UserCompactV3
      description: >
        Compact version of a user which can be included in the response of
        relevant APIs.
      required:
        - id
        - email
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: |
            Unique identifier for the user.
        full_name:
          type: string
          readOnly: true
          description: |
            Full name of the user.
        email:
          type: string
          format: email
          description: |
            Email address of the user.
    TeamCompact:
      type: object
      title: TeamCompactV3
      description: >
        Compact version of a team which can be included in the response of
        relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: |
            Unique identifier for the team.
        name:
          type: string
          description: |
            Name of the team.
    DashboardFilters:
      type: object
      title: DashboardOptions
      properties:
        time_label:
          type: string
          enum:
            - yesterday
            - today
            - 7d
            - 30d
            - 90d
            - 6m
            - 12m
        time_range:
          type: object
          properties:
            start_time:
              type: string
              format: date-time
            end_time:
              type: string
              format: date-time
          required:
            - start_time
            - end_time
        time_zone:
          type: string
        bin_size:
          type: string
          enum:
            - Hour
            - Day
            - Week
            - Month
            - Quarter
    CreateAndUpdateMetaDetails:
      type: object
      title: CreateAndUpdateMetaDetails
      description: >
        Details about creation and update metadata, including timestamps and
        user information.
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: |
            Date and time when the object was created
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: |
            Date and time when the object was last updated
        created_by:
          $ref: '#/components/schemas/UserDetails'
        updated_by:
          $ref: '#/components/schemas/UserDetails'
    UserDetails:
      type: object
      title: UserDetails
      required:
        - id
        - email
      properties:
        id:
          type: integer
          readOnly: true
        full_name:
          type: string
          readOnly: true
        email:
          type: string
          format: email
    UserMembershipInfo:
      type: object
      title: User org membership details required for logged in user
      properties:
        company:
          type: string
        plan:
          type: string
        onboarding:
          type: object
          properties:
            show:
              type: boolean
        organization_id:
          type: integer
        organization_uuid:
          type: string
          format: uuid
        organization_name:
          type: string
        org_role:
          type: string
        settings:
          type: object
    UserInfo:
      title: UserInfo required for logged in user
      allOf:
        - $ref: '#/components/schemas/UserDetails'
        - type: object
          properties:
            first_name:
              type: string
            last_name:
              type: string
            image_url:
              type: string
            uuid:
              type: string
              format: uuid
            username:
              type: string
            settings:
              type: object
            membership:
              type: array
              items:
                $ref: '#/components/schemas/UserMembershipInfo'
    ModelCompact:
      type: object
      title: ModelCompact
      description: >
        Compact version of a model which can be included in the response of
        relevant APIs.
      required:
        - id
        - name
        - version
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier for the model.
        name:
          type: string
          description: |
            Name of the model.
        version:
          type: string
          description: |
            Version of the model.
    AgentCompact:
      type: object
      description: >-
        Compact version of an agent which can be included in the response of
        relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          description: Unique identifier of the agent
          type: string
          format: uuid
        name:
          description: Name of the agent
          type: string
    BaselineCompact:
      type: object
      title: BaselineCompact
      description: >
        Compact version of a baseline which can be included in the response of
        relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the baseline.
        name:
          type: string
          description: |
            Name of the baseline.
    ApplicationCompact:
      type: object
      title: ApplicationCompact
      description: >
        Compact version of an application which can be included in the response
        of relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the application.
        name:
          type: string
          description: |
            Name of the application.
    ProjectCompact:
      type: object
      title: ProjectCompact
      description: >
        Compact version of a project which can be included in the response of
        relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the project.
        name:
          type: string
          description: |
            Name of the project.
        asset_type:
          type: string
          enum:
            - ML_MODEL
            - GEN_AI_APP
          description: |
            Type of assets the project can have.
    OrganizationCompact:
      type: object
      title: OrganizationCompact
      description: >
        Compact version of an organization which can be included in the response
        of relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the organization.
        name:
          type: string
          description: |
            Name of the organization.
    ProjectRoleV3:
      title: ProjectRoleV3
      description: >
        Represents an explicit project role assignment for a user or team.
        Exactly one of `user` or `team` will be populated.
      oneOf:
        - $ref: '#/components/schemas/ProjectRoleUserAssignmentV3'
        - $ref: '#/components/schemas/ProjectRoleTeamAssignmentV3'
    ProjectRoleUserAssignmentV3:
      title: ProjectRoleUserAssignmentV3
      description: A project role assigned to a user.
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: Unique identifier of the project role assignment.
            role:
              $ref: '#/components/schemas/ProjectRoleEnum'
            user:
              $ref: '#/components/schemas/UserCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
          required:
            - id
            - role
            - user
            - project
            - organization
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    ProjectRoleTeamAssignmentV3:
      title: ProjectRoleTeamAssignmentV3
      description: A project role assigned to a team.
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: Unique identifier of the project role assignment.
            role:
              $ref: '#/components/schemas/ProjectRoleEnum'
            team:
              $ref: '#/components/schemas/TeamCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
          required:
            - id
            - role
            - team
            - project
            - organization
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    EnrichmentConfigCompact:
      type: object
      title: EnrichmentConfigCompact
      description: >
        Compact version of an enrichment config which can be included in the
        response of relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the enrichment config.
        name:
          type: string
          description: |
            Name of the enrichment.
    EvaluatorRuleCompact:
      type: object
      title: EvaluatorRuleCompact
      description: >
        Compact version of an evaluator rule which can be included in the
        response of relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the evaluator rule.
        name:
          type: string
          description: |
            Name of the evaluator rule.
    EnvironmentCompact:
      type: object
      title: EnvironmentCompact
      description: >
        Compact version of an environment which can be included in the response
        of relevant APIs.
      required:
        - id
        - type
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the environment.
        type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
          description: |
            Type of the environment (e.g., pre-production, production).
        name:
          type: string
          description: |
            Name of the environment.
    DatasetCompact:
      type: object
      title: DatasetCompact
      description: >
        Compact version of a dataset which can be included in the response of
        relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the dataset.
        name:
          type: string
          description: |
            Name of the dataset.
    JobCompact:
      type: object
      title: JobCompact
      description: >
        Compact version of a job which can be included in the response of
        relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the job.
        name:
          type: string
          description: |
            Name of the job.
    AsyncJobStatus:
      type: string
      description: Status of the job
      enum:
        - PENDING
        - STARTED
        - SUCCESS
        - FAILURE
        - REVOKED
    PartCompact:
      type: object
      title: PartCompact
      description: >
        Compact version of parts which can be included in the response of
        relevant APIs.
      required:
        - part_number
        - etag
      properties:
        part_number:
          type: integer
          description: |
            The number of the part.
        etag:
          type: string
          description: |
            Entity Tag (ETag) representing the version of the part.
    SegmentCompact:
      type: object
      title: SegmentCompact
      description: Compact version of segment for v3
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the saved segment
        definition:
          type: string
          description: FQL definition of the applied segment
    MetricCompact:
      type: object
      title: MetricCompact
      required:
        - id
        - type
        - display_name
        - type_display_name
      properties:
        id:
          type: string
          description: Name for builtin metrics, UUID for custom metrics
        display_name:
          type: string
        type:
          $ref: '#/components/schemas/MetricTypeEnum'
        type_display_name:
          $ref: '#/components/schemas/MetricTypeDisplayNameEnum'
    MetricTypeCompact:
      type: object
      title: MetricTypeCompact
      description: >-
        Compact version of metric type which can be included in the response of
        relevant APIs
      required:
        - key
        - Name
      properties:
        key:
          type: string
        name:
          type: string
    MetricTypeEnum:
      type: string
      enum:
        - drift
        - data_integrity
        - performance
        - service_metrics
        - statistic
        - custom
    GenAIAggregationEnum:
      type: string
      description: Supported aggregation types for GenAI metrics
      enum:
        - sum
        - average
        - p50
        - p75
        - p90
        - p95
        - p99
        - count
    GenAIMetricSourceEnum:
      type: string
      description: Source of the metric data
      enum:
        - raw_data
        - attribute
        - evaluator
        - custom
    GenAIMetricUnitEnum:
      type: string
      description: Unit for metric values.
      enum:
        - milliseconds
    SemanticConcept:
      type: string
      description: >-
        Canonical semantic concept that an attribute key maps to. Used by
        materialized columns, search scoping, and input/output content
        extraction.
      enum:
        - input_tokens
        - output_tokens
        - total_tokens
        - total_cost
        - input_cost
        - output_cost
        - model_name
        - provider_name
        - agent_name
        - agent_id
        - agent_description
        - tool_name
        - tool_id
        - tool_type
        - tool_definitions
        - session_id
        - user_id
        - input
        - output
        - system_instructions
        - retrieval_context
        - tool_input
        - tool_output
        - latency
        - ttft
        - span_name
        - span_type
        - received_time
        - request_id
        - response_id
        - cache_read_input_tokens
        - cache_creation_input_tokens
        - reasoning_tokens
        - finish_reason
    GenAIMetricParams:
      type: object
      description: >-
        Additional parameters for the metric. Which fields are required depends
        on metric_source.
      properties:
        attribute_name:
          type: string
          description: >-
            Name of the attribute (required for attribute metrics when
            semantic_name is not set)
        semantic_name:
          nullable: true
          description: >-
            Semantic concept name. When set, the query matches all attribute
            keys mapped to this concept, making charts and alerts SDK-agnostic.
            Mutually exclusive with attribute_name.
          allOf:
            - $ref: '#/components/schemas/SemanticConcept'
        attribute_values:
          type: array
          items:
            type: string
          description: >-
            List of attribute values (required for attribute metrics with count
            aggregation)
        rule_name:
          type: string
          description: Name of the evaluator rule (required for evaluator metrics)
        output_name:
          type: string
          description: Name of the evaluator output (required for evaluator metrics)
        output_values:
          type: array
          items:
            type: string
          description: >-
            List of evaluator output values (required for evaluator metrics with
            count aggregation)
        custom_metric_id:
          type: string
          format: uuid
          description: UUID of the custom metric to execute (required for custom metrics)
    GenAIMetricName:
      type: string
      description: >
        Name of the metric. For core metrics this is one of traffic,
        token_count, attribute, latency, or custom_metric. For evaluator metrics
        this is the enrichment name (e.g., topic_classification, sentiment).
    Tag:
      type: object
      description: Details of a Tag
      properties:
        id:
          description: Unique identifier of the tag
          type: string
          format: uuid
        name:
          description: Name of the tag
          type: string
        enabled:
          type: boolean
          description: Indicates if the Tag is enabled or not for the Span type.
    SpanCompact:
      type: object
      description: Compact view of Span
      required:
        - id
        - name
      properties:
        id:
          description: Unique identifier of the span type
          type: string
          format: uuid
        name:
          description: Name of the span type
          type: string
        type:
          $ref: '#/components/schemas/SpanType'
    DefaultDashboard:
      title: DefaultDashboard
      allOf:
        - type: object
          properties:
            dashboard_uuid:
              type: string
              format: uuid
    UpdateDefaultDashboardRequest:
      title: UpdateDefaultDashboard
      allOf:
        - type: object
          properties:
            dashboard_uuid:
              type: string
              format: uuid
    JsonSchema:
      type: object
      description: JSON Schema object representing enrichment config schema
      required:
        - type
      properties:
        type:
          type: string
          description: JSON Schema type (typically 'object')
        title:
          type: string
          description: Title of the schema
        description:
          type: string
          description: Description of the schema
        properties:
          type: object
          description: Dictionary of property definitions
          additionalProperties:
            $ref: '#/components/schemas/JsonSchemaProperty'
        required:
          type: array
          description: List of required property names
          items:
            type: string
        additional_properties:
          type: boolean
          description: Whether additional properties are allowed
    JsonSchemaProperty:
      type: object
      description: JSON Schema property definition
      required:
        - type
      properties:
        type:
          type: string
          description: Property type (e.g., 'string', 'array', 'object')
        title:
          type: string
          description: Title of the property
        description:
          type: string
          description: Description of the property
        items:
          $ref: '#/components/schemas/JsonSchemaItems'
        min_items:
          type: integer
          description: Minimum items for array types
    JsonSchemaItems:
      type: object
      description: JSON Schema items definition for array types
      required:
        - type
      properties:
        type:
          type: string
          description: Type of array items
        enum:
          type: array
          items:
            type: string
    QueryConditionType:
      type: string
      description: Condition type to apply for filters
      enum:
        - AND
        - OR
    OperatorType:
      type: string
      description: Type of operator
      enum:
        - EQUAL
        - NOT_EQUAL
        - IN
        - NOT_IN
        - LESS
        - LESS_OR_EQUAL
        - GREATER
        - GREATER_OR_EQUAL
        - BETWEEN
    QueryRule:
      type: object
      description: Rule to apply for filters
      required:
        - field
        - operator
        - value
      properties:
        field:
          type: string
          description: Name of the field to apply the filter on
        operator:
          $ref: '#/components/schemas/OperatorType'
        value:
          description: value of the filter
          anyOf:
            - type: string
            - type: number
            - type: boolean
            - type: array
              items:
                type: string
    QueryCondition:
      type: object
      description: Recursive filter condition supporting AND/OR nesting with rules
      required:
        - condition
        - rules
      properties:
        condition:
          $ref: '#/components/schemas/QueryConditionType'
        rules:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/QueryCondition'
              - $ref: '#/components/schemas/QueryRule'
    TimestampResponse:
      type: object
      title: timestamp
      description: To record created at and updated at timestamp fields
      required:
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          format: date-time
          description: To capture created at timestamp
        updated_at:
          type: string
          format: date-time
          description: To capture updated at timestamp
    AccessKeyExtendExpiryRequestBody:
      type: object
      required:
        - extend_by_days
      anyOf:
        - required:
            - user_id
        - required:
            - user_email
      properties:
        extend_by_days:
          type: integer
          example: 30
        user_id:
          type: string
          format: uuid
        user_email:
          type: string
          format: email
    AccessKeyRequestBody:
      type: object
      anyOf:
        - type: object
          properties:
            user_id:
              type: string
              format: uuid
            user_email:
              type: string
              format: email
    AccessKeyListResponseBody:
      type: array
      items:
        $ref: '#/components/schemas/AccessKeySingleResponseBody'
    AccessKeySingleResponseBody:
      type: object
      required:
        - token
        - user
        - organization
      properties:
        token:
          type: string
          example: footoken
        expire_at:
          type: string
        user:
          $ref: '#/components/schemas/UserCompact'
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ListAgentResponse:
      type: array
      items:
        $ref: '#/components/schemas/Agent'
    Agent:
      type: object
      description: Details of the agent
      required:
        - id
        - name
        - organization
        - project
        - application
        - created_at
        - updated_at
      allOf:
        - type: object
          properties:
            id:
              description: Unique identifier of the agent
              type: string
              format: uuid
            name:
              description: Name of the agent
              type: string
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            application:
              $ref: '#/components/schemas/ApplicationCompact'
            span_count:
              description: Number of span type for this agent
              type: integer
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    ListAgentsApplicationResponse:
      type: array
      description: List of agent names
      items:
        type: string
    AggregationInvalidationRequestObject:
      type: object
      description: AggInvalidationRequest fields JSON
      required:
        - id
        - metric_type
        - column_name
        - bin_start_time
        - bin_end_time
        - status
        - model
        - organization
        - project
        - job
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: UUID format unique identifier for AggInvalidationRequest
            status:
              $ref: '#/components/schemas/AsyncJobStatus'
            metric_type:
              $ref: '#/components/schemas/MetricTypeEnum'
            column_name:
              type: string
              description: Column name for which AggInvalidationRequest is made
            bin_start_time:
              type: string
              format: date-time
              description: Bin start time of the AggInvalidationRequest
            bin_end_time:
              type: string
              format: date-time
              description: Bin end time of the AggInvalidationRequest
            model:
              $ref: '#/components/schemas/ModelCompact'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            job:
              $ref: '#/components/schemas/JobCompact'
    MetricTypesEnum:
      type: string
      description: Metric types on which aggregation invalidation requeste is made
      enum:
        - drift
        - data_integrity
        - performance
        - service_metrics
        - statistic
        - custom
    ListAggregationInvalidationRequestResponse:
      type: array
      items:
        $ref: '#/components/schemas/AggregationInvalidationRequestObject'
    AlertRuleSummary:
      allOf:
        - type: object
          required:
            - id
            - alert_rule_id
            - name
            - metric
            - priority
            - bin_size
            - condition
            - alert_record_count
            - alert_value
            - baseline
            - threshold_type
            - latest_alert_record_severity
            - latest_alert_record_value
            - latest_alert_time_bucket
            - latest_alert_feature_name
            - latest_alert_feature_id
            - model
            - project
            - organization
          properties:
            alert_rule_id:
              type: string
              format: uuid
              description: Unique identifier for an Alert Rule.
            id:
              type: string
              format: uuid
              description: Unique identifier of the latest Alert Record.
            name:
              type: string
              description: Name of an Alert Rule.
            metric:
              $ref: '#/components/schemas/MetricCompact'
            is_fiddler_generated:
              type: boolean
              description: >-
                Boolean indicating whether the Alert Rule is generated by
                Fiddler.
            priority:
              $ref: '#/components/schemas/PriorityEnum'
            compare_to:
              $ref: '#/components/schemas/CompareToEnum'
            bin_size:
              $ref: '#/components/schemas/BinSizeEnum'
            condition:
              type: string
              description: Metric value comparision (lesser or greater).
            alert_record_count:
              type: integer
              description: >-
                The number of Alert evaluations that resulted in triggered Alert
                Records.
            alert_value:
              type: number
              format: float
              description: >-
                Value of the metric from the latest triggered Alert Record for
                the Alert Rule.
            feature_names:
              type: array
              items:
                type: string
              description: List of feature names, if specified in the Alert Rule.
            threshold_type:
              $ref: '#/components/schemas/ThresholdAlgoEnum'
            critical_threshold:
              type: number
              format: double
              description: Critical threshold value specified in the Alert Rule.
            warning_threshold:
              type: number
              format: double
              description: Warning threshold value specified in the Alert Rule.
            enable_notification:
              type: boolean
              description: >-
                Boolean indicating whether to send notification when an Alert
                Rule is created.
            compare_bin_delta:
              type: integer
              nullable: true
              description: >-
                This field specifies the lookback period for relative
                comparisons, expressed as a multiple of the chosen time bin
                size. It determines the historical data timeframe used to
                evaluate changes in the metric value.
            latest_alert_record_value:
              type: number
              format: float
              description: >-
                Value of the metric from the latest triggered Alert Record for
                the Alert Rule.
            latest_alert_time_bucket:
              type: number
              format: float
              description: >-
                Value of the time bucket from the latest triggered Alert Record
                for the Alert Rule.
            latest_alert_feature_name:
              type: string
              description: >-
                Name of feature from the latest triggered Alert Record for the
                Alert Rule.
            latest_alert_feature_id:
              type: string
              description: >-
                Id of feature from the latest triggered Alert Record for the
                Alert Rule.
            latest_threshold:
              type: number
              format: float
              description: >-
                Value of threshold from the latest triggered Alert Record for
                the Alert Rule.
            latest_alert_record_severity:
              $ref: '#/components/schemas/SeverityEnum'
            severity:
              $ref: '#/components/schemas/SeverityEnum'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            model:
              $ref: '#/components/schemas/ModelCompact'
            baseline:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/BaselineCompact'
            segment:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/SegmentCompact'
            created_at:
              type: string
              format: date-time
              description: The time when the latest triggered Alert Record is created.
            updated_at:
              type: string
              format: date-time
              description: The time when the latest triggered Alert Record is updated.
            created_by:
              $ref: '#/components/schemas/UserCompact'
            updated_by:
              $ref: '#/components/schemas/UserCompact'
    AlertRecord:
      type: object
      title: AlertRecord
      required:
        - alert_rule_id
        - alert_rule_revision
        - critical_threshold
        - id
        - alert_time_bucket
        - severity
        - alert_value
        - baseline_time_bucket
        - baseline_value
        - message
        - feature_name
        - alert_record_main_version
        - alert_record_sub_version
        - created_at
        - updated_at
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: Unique identifier for an Alert Record.
            alert_rule_id:
              type: string
              format: uuid
              description: Unique identifier of the corresponding Alert Rule.
            alert_rule_revision:
              type: number
              nullable: false
              description: Revision of corresponding Alert Rule.
            warning_threshold:
              type: number
              format: float
              nullable: true
              description: The warning threshold used to evaluate the Alert Record.
            critical_threshold:
              type: number
              format: float
              nullable: false
              description: The critical threshold used to evaluate the Alert Record.
            alert_run_start_time:
              type: number
              format: date-time
              description: Time pointing to when an Alert Record is created.
            baseline_time_bucket:
              type: number
              format: date-time
              nullable: true
              description: >-
                Time pointing to the start of the previous time bucket against
                which the metric value of this alert_time_bucket is compared.
                Applies only when the corresponding Alert Rule has 'time_period'
                based comparision.
            baseline_value:
              type: number
              format: float
              nullable: true
              description: >-
                Value of the metric from the previous time bucket against which
                the same from this alert_time_bucket is compared. Applies only
                when the corresponding Alert Rule has 'time_period' based
                comparision.
            severity:
              $ref: '#/components/schemas/SeverityEnum'
            alert_time_bucket:
              type: integer
              description: >-
                Time pointing to the start of the time bucket for which an Alert
                Record is created.
            alert_value:
              type: number
              format: float
              description: Value of the metric from the alert_time_bucket.
            failure_reason:
              type: string
              description: >-
                Error message if anything goes wrong while executing alerting
                logic.
            message:
              type: string
              description: A message describing Alert Record.
            feature_name:
              type: string
              description: >-
                Name of a specific feature for which this Alert Record was
                triggered. Applies only when one or more fetaure names were
                specified in the corresponding Alert Rule.
            alert_record_main_version:
              type: integer
              description: >-
                Alerting logic is executed every time a metric value is updated
                for a completed time bin. When an Alert Record is created for
                the first time for a metric and time bin combination, the main
                version is set to 1. It is incremented by 1 every time the
                Severity of the same metric and time bin combination changes.
                For example, when Severity changes from WARNING to CRITCIAL,
                alert_record_main_version is incremented by 1.
            alert_record_sub_version:
              type: integer
              description: >-
                Alerting logic is executed every time a metric value is updated
                for a completed time bin. When an Alert Record is created for
                the first time for a metric and time bin combination, the main
                version and sub versions are set to 1. The sub version is
                incremented by 1 every time the an alert record created with the
                same Severity for the same metric and time bin combination. Once
                Severity value changes, for example, from WARNING to CRITCIAL,
                alert_record_main_version is incremented by 1 and
                alert_record_sub_version is set back to 1.
            created_at:
              type: string
              format: date-time
              description: Time pointing to when an Alert Record is created.
            updated_at:
              type: string
              format: date-time
              description: Time pointing to when an Alert Record is updated.
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    AlertRecordCompact:
      type: object
      title: AlertRecordCompact
      required:
        - id
        - alert_rule_id
        - alert_time_bucket
        - feature_name
        - alert_value
        - severity
        - critical_threshold
        - created_at
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: Unique identifier for an Alert Record.
            alert_rule_id:
              type: string
              format: uuid
              description: Unique identifier of the corresponding Alert Rule.
            warning_threshold:
              type: number
              format: float
              nullable: true
              description: The warning threshold used to evaluate the Alert Record.
            critical_threshold:
              type: number
              format: float
              nullable: false
              description: The critical threshold used to evaluate the Alert Record.
            severity:
              $ref: '#/components/schemas/SeverityEnum'
            alert_time_bucket:
              type: integer
              description: >-
                Time pointing to the start of the time bucket for which an Alert
                Record is created.
            alert_value:
              type: number
              format: float
              description: Value of the metric from the alert_time_bucket.
            feature_name:
              type: string
              nullable: true
              description: >-
                Name of a specific feature for which this Alert Record was
                triggered. Applies only when one or more fetaure names were
                specified in the corresponding Alert Rule.
            created_at:
              type: string
              format: date-time
              description: Time pointing to when an Alert Record is created.
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    AlertRecordHistory:
      allOf:
        - type: object
          properties:
            time_bucket:
              type: integer
              description: >-
                Time pointing to start of a time bucket for which one or more
                Alert Records are created.
            alert_count:
              type: integer
              description: Number of Alert Records created for the time_bucket.
            alert_history_count:
              type: integer
              description: Number of Alert Records created minus one for the time_bucket.
            latest_record:
              $ref: '#/components/schemas/AlertRecordCompact'
          required:
            - time_bucket
            - alert_count
            - alert_history_count
            - latest_record
    AlertRule:
      type: object
      required:
        - id
        - name
        - organization
        - project
        - model
        - priority
        - metric
        - compare_to
        - condition
        - threshold_type
        - baseline
        - created_at
        - updated_at
        - created_by
        - updated_by
        - bin_size
        - evaluation_delay
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the Alert Rule.
        is_fiddler_generated:
          type: boolean
          description: Boolean indicating whether the Alert Rule is generated by Fiddler.
        created_at:
          type: string
          format: date-time
          description: Timestamp indicating when the Alert Rule was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp indicating when the Alert Rule was last updated.
        name:
          type: string
          description: Name of the Alert Rule.
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        metric:
          $ref: '#/components/schemas/MetricCompact'
        feature_names:
          type: array
          items:
            type: string
          description: List of feature names for which we have created an Alert Rule.
        priority:
          $ref: '#/components/schemas/PriorityEnum'
        compare_to:
          $ref: '#/components/schemas/CompareToEnum'
        condition:
          $ref: '#/components/schemas/ConditionEnum'
        compare_bin_delta:
          type: integer
          description: >-
            This field specifies the lookback period for relative comparisons,
            expressed as a multiple of the chosen time bin size. It determines
            the historical data timeframe used to evaluate changes in the metric
            value.
        evaluation_delay:
          type: integer
          description: >-
            It indroduces the delay in the evaluation of Alert Rule. It is in
            multiple of hours, and max could be one year.
        category:
          type: string
          description: >-
            Setting Frequency Alerts on categorical columns requires specifying
            a category. For example, if the column represents geographical
            locations such as France, Germany, and India, you would pass
            'France' as the category and 'geography' as the feature name to set
            a frequency alert.
        bin_size:
          $ref: '#/components/schemas/BinSizeEnum'
        threshold_type:
          $ref: '#/components/schemas/ThresholdAlgoEnum'
        auto_threshold_params:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/StandardDeviationAlgorithmParams'
        warning_threshold:
          type: number
          format: double
          description: Threshold value for triggering a warning alert.
        critical_threshold:
          type: number
          format: double
          description: Threshold value for triggering a critical alert.
        enable_notification:
          type: boolean
          description: Indicates whether notifications are enabled for the Alert Rule.
        model:
          $ref: '#/components/schemas/ModelCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        baseline:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/BaselineCompact'
        segment:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SegmentCompact'
        created_by:
          $ref: '#/components/schemas/UserCompact'
        updated_by:
          $ref: '#/components/schemas/UserCompact'
    Notification:
      type: object
      required:
        - emails
        - pagerduty_services
        - pagerduty_severity
        - webhooks
      properties:
        emails:
          type: array
          items:
            type: string
        pagerduty_services:
          type: array
          items:
            type: string
        pagerduty_severity:
          type: string
        webhooks:
          type: array
          items:
            type: string
            format: uuid
    NotificationPayload:
      type: object
      minProperties: 1
      properties:
        emails:
          type: array
          items:
            type: string
        pagerduty_services:
          type: array
          items:
            type: string
        pagerduty_severity:
          type: string
        webhooks:
          type: array
          items:
            type: string
            format: uuid
    TestNotificationChannelResult:
      type: object
      required:
        - channel_type
        - is_sent_success
      properties:
        channel_type:
          type: string
          enum:
            - email
            - pagerduty
            - webhook
          description: The type of notification channel.
        is_sent_success:
          type: boolean
          description: Whether the test notification was sent successfully.
        failure_reason:
          type: string
          nullable: true
          description: >-
            The reason for failure if the notification was not sent
            successfully.
    TestNotificationResponse:
      type: object
      required:
        - results
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/TestNotificationChannelResult'
          description: Per-channel results of the test notification attempt.
        message:
          type: string
          nullable: true
          description: Optional message, e.g. when no channels are configured.
    AlertRulePostPayload:
      type: object
      allOf:
        - type: object
          required:
            - model_id
            - name
            - priority
            - metric_id
            - bin_size
            - compare_to
            - condition
            - threshold_type
          properties:
            compare_bin_delta:
              type: integer
              description: >-
                This field specifies the lookback period for relative
                comparisons, expressed as a multiple of the chosen time bin
                size. It determines the historical data timeframe used to
                evaluate changes in the metric value.
            evaluation_delay:
              description: >-
                It indroduces the delay in the evaluation of Alert Rule. It is
                in multiple of hours, and max could be one year.
              type: integer
            model_id:
              description: Unique identifier of the model.
              type: string
              format: uuid
            segment_id:
              description: Unique identifier of the segment.
              type: string
              format: uuid
            name:
              description: Name of the Alert Rule.
              type: string
            metric_id:
              description: >-
                The unique identifier of the metric for which we want to create
                an Alert Rule.
              type: string
            feature_names:
              description: List of feature names for which we want to create an Alert Rule.
              type: array
              items:
                type: string
            category:
              type: string
              description: >-
                Setting Frequency Alerts on categorical columns requires
                specifying a category. For example, if the column represents
                geographical locations such as France, Germany, and India, you
                would pass 'France' as the category and 'geography' as the
                feature name to set a frequency alert.
            baseline_id:
              description: >-
                It should only be specified for the drift Alert Rules. Is is
                unique identifier of the baseline selected for drift
                calculations.
              type: string
              format: uuid
            priority:
              $ref: '#/components/schemas/PriorityEnum'
            bin_size:
              $ref: '#/components/schemas/BinSizeEnum'
            compare_to:
              $ref: '#/components/schemas/CompareToEnum'
            condition:
              $ref: '#/components/schemas/ConditionEnum'
            threshold_type:
              $ref: '#/components/schemas/ThresholdAlgoEnum'
            auto_threshold_params:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/StandardDeviationAlgorithmParams'
            warning_threshold:
              description: Threshold value for triggering a warning alert.
              type: number
              format: double
            critical_threshold:
              description: Threshold value for triggering a critical alert.
              type: number
              format: double
    AlertRuleUpdatableFields:
      type: object
      properties:
        name:
          description: Name of the Alert Rule.
          type: string
        warning_threshold:
          description: Warning threshold for the Alert Rule.
          type: number
          format: float
          nullable: true
        critical_threshold:
          description: Critical threshold for the Alert Rule.
          type: number
          format: float
        evaluation_delay:
          description: Evaluation Delay for the Alert Rule. It is in number of hours.
          type: number
          format: integer
        priority:
          $ref: '#/components/schemas/PriorityEnum'
        enable_notification:
          description: Indicates whether notifications are enabled for the Alert Rule.
          type: boolean
        auto_threshold_params:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/StandardDeviationAlgorithmParams'
    AlertThresholdsForBinResponse:
      type: object
      required:
        - threshold_type
        - critical_threshold
      properties:
        threshold_type:
          $ref: '#/components/schemas/ThresholdAlgoEnum'
        warning_threshold:
          type: number
          format: float
        critical_threshold:
          type: number
          format: float
    StandardDeviationAlgorithmParams:
      type: object
      description: >-
        Auto threshold parameters for the Alert Rule. These parameters are used
        to tweak the calculations of the thresholds.
      required:
        - warning_multiplier
        - critical_multiplier
      properties:
        warning_multiplier:
          type: number
          format: float
        critical_multiplier:
          type: number
          format: float
    SeverityEnum:
      type: string
      enum:
        - WARNING
        - CRITICAL
        - DEFAULT
    CompareToEnum:
      type: string
      description: >-
        This API provides two alert evaluation methods, absolute comparisons
        determine if the current metric value breaches a predefined threshold,
        while relative comparisons analyze changes in metric by referencing a
        chosen time period.
      enum:
        - raw_value
        - time_period
    BinSizeEnum:
      type: string
      description: The Supported bin sizes for the Alert Rules.
      enum:
        - Hour
        - Day
        - Week
        - Month
    MetricTypeDisplayNameEnum:
      type: string
      enum:
        - Data Drift
        - Data Integrity
        - Performance
        - Traffic
        - Statistic
        - Custom Metric
    PriorityEnum:
      type: string
      enum:
        - HIGH
        - MEDIUM
        - LOW
    ThresholdAlgoEnum:
      type: string
      description: The type of threshold algorithm used to evaluate alerts.
      enum:
        - manual
        - standard_deviation_auto_threshold
    ConditionEnum:
      type: string
      description: The comparison condition while evaluating the Alert Rule.
      enum:
        - lesser
        - greater
    AlertRuleStats:
      type: object
      required:
        - drift
        - performance
        - data_integrity
      properties:
        drift:
          $ref: '#/components/schemas/AlertRuleStatDetailsObject'
        performance:
          $ref: '#/components/schemas/AlertRuleStatDetailsObject'
        data_integrity:
          $ref: '#/components/schemas/AlertRuleStatDetailsObject'
        last_modified:
          type: string
          format: date-time
    AlertRuleStatDetailsObject:
      type: object
      required:
        - warning
        - critical
      properties:
        warning:
          type: integer
        critical:
          type: integer
    WriteableWebhookInAlertRule:
      type: object
      required:
        - uuid
      properties:
        uuid:
          type: string
          format: uuid
          example: 02a244dd-289a-4120-8804-e47f12feeb2e
    ApplicationRequest:
      type: object
      title: ApplicationRequest
      description: Request body for creating an application
      required:
        - name
        - project_id
      properties:
        project_id:
          type: string
          format: uuid
          description: UUID format unique identifier for the project the model is added in
        name:
          description: Name of the application
          type: string
    Application:
      type: object
      description: Details of the application
      required:
        - id
        - name
        - organization
        - project
        - created_at
        - updated_at
        - created_by
        - updated_by
      allOf:
        - type: object
          properties:
            id:
              description: Unique identifier of the application
              type: string
              format: uuid
            name:
              description: Name of the application
              type: string
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            created_by:
              $ref: '#/components/schemas/UserCompact'
            updated_by:
              $ref: '#/components/schemas/UserCompact'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    ApplicationSummaryCompact:
      type: object
      description: Details of the application for dashboard
      required:
        - id
        - name
      properties:
        id:
          description: Unique identifier of the application
          type: string
          format: uuid
        name:
          description: Name of the application
          type: string
        created_at:
          type: string
          format: date-time
          description: Date and time when the object was created.
    AgentWithSpanCount:
      type: object
      description: Details of an agent with number of span type
      properties:
        id:
          description: Unique identifier of the application
          type: string
          format: uuid
        name:
          description: Name of the application
          type: string
        created_at:
          type: string
          format: date-time
          description: Datetime the agent was created
        created_by:
          $ref: '#/components/schemas/UserCompact'
        number_spans:
          type: integer
          description: Number of span types for this agent
    ListApplicationResponse:
      type: array
      items:
        $ref: '#/components/schemas/Application'
    ApplicationHealthResponse:
      type: object
      required:
        - summary
      properties:
        summary:
          $ref: '#/components/schemas/ApplicationHealthSummary'
    ApplicationHealthSummary:
      type: array
      description: List of summary data for each application
      items:
        $ref: '#/components/schemas/ApplicationHealthObject'
    ApplicationHealthObject:
      type: object
      description: Health details for a given application
      required:
        - application
        - traffic
        - type
      properties:
        type:
          $ref: '#/components/schemas/ApplicationHealthType'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        application:
          allOf:
            - $ref: '#/components/schemas/ApplicationSummaryCompact'
            - type: object
              properties:
                deployment_date:
                  type: string
                  format: date
                  description: Date the application was deployed on
        traffic:
          $ref: '#/components/schemas/ApplicationTraffic'
    ApplicationHealthType:
      type: string
      description: Enum describing the state of the application
      enum:
        - Active
        - Inactive
    ApplicationTraffic:
      type: object
      description: Traffic details for an application
      required:
        - last_event_time
        - current_window_count
      properties:
        current_window_count:
          description: Traffic for the desired window ( for example past 7 days)
          type: integer
        last_event_time:
          description: datetime of the last occurred at event
          type: string
          format: date-time
    ListApplicationSummaryResponse:
      type: array
      items:
        $ref: '#/components/schemas/ApplicationSummary'
    ApplicationSummary:
      type: object
      description: Summary details for an application
      properties:
        project:
          $ref: '#/components/schemas/ProjectCompact'
        application:
          $ref: '#/components/schemas/ApplicationSummaryCompact'
        traffic:
          $ref: '#/components/schemas/ApplicationTraffic'
    GetPossibleValuesFieldRequest:
      type: object
      description: Payload to get the possible values for a given field
      properties:
        field:
          type: string
          description: Name of the field to get possible values for
    PossibleValuesFieldResponse:
      type: object
      description: Response giving the possible values for the field
      properties:
        field:
          type: string
          description: Name of the field to get possible values for
          example: SpanType
        possible_values:
          type: array
          items:
            type: string
          example:
            - LLM
            - TOOL
            - CHAIN
    FieldValueItem:
      type: object
      description: A single distinct value of a filterable field
      required:
        - value
      properties:
        value:
          type: string
          description: The field value
          example: chat_completion
    ApplicationDeletionJob:
      type: object
      description: Job object for application deletion
      required:
        - job
      properties:
        job:
          $ref: '#/components/schemas/JobCompact'
    FieldTypeEnum:
      type: string
      description: Type of field configuration (static or dynamic)
      enum:
        - static
        - dynamic
    DataTypeEnum:
      type: string
      description: Data type of the field or metric
      enum:
        - string
        - float
    MetricGroupNameEnum:
      type: string
      description: Category groupings for metrics
      enum:
        - Measures
        - Evaluators
        - Custom Metrics
    AggregationOption:
      type: object
      description: Available aggregation function
      required:
        - id
        - name
        - value
        - data_type
      properties:
        id:
          type: string
          description: Unique identifier for the aggregation
        name:
          type: string
          description: Display name of the aggregation
        value:
          $ref: '#/components/schemas/GenAIAggregationEnum'
        data_type:
          $ref: '#/components/schemas/DataTypeEnum'
    MetricFieldValue:
      type: object
      description: Possible value for a metric field
      required:
        - id
        - name
        - value
      properties:
        id:
          type: string
          description: Unique identifier for the value
        name:
          type: string
          description: Display name of the value
        value:
          type: string
          description: Actual value to use
    MetricField:
      type: object
      description: Field configuration for a metric
      required:
        - id
        - name
        - type
        - depends_on
        - values
      properties:
        id:
          type: string
          description: Unique identifier for the field
        name:
          type: string
          description: Display name of the field
        type:
          $ref: '#/components/schemas/FieldTypeEnum'
        depends_on:
          type: array
          items:
            type: string
          description: List of field IDs this field depends on
        values:
          type: array
          items:
            $ref: '#/components/schemas/MetricFieldValue'
          description: >-
            Available values for this field (empty for dynamic fields or when
            populated by aggregations)
    MetricDefinition:
      type: object
      description: Definition of a metric with its configurable fields
      required:
        - id
        - name
        - value
        - group_name
        - source
        - fields
      properties:
        id:
          type: string
          description: Unique identifier for the metric
        name:
          type: string
          description: Display name of the metric
        value:
          type: string
          description: >-
            Metric identifier (e.g., 'traffic', 'token_count', 'attribute',
            'latency', 'evaluator', or 'custom')
        group_name:
          $ref: '#/components/schemas/MetricGroupNameEnum'
        source:
          $ref: '#/components/schemas/GenAIMetricSourceEnum'
        fields:
          type: array
          items:
            $ref: '#/components/schemas/MetricField'
          description: Configurable fields for this metric
    MetricsMetadata:
      type: object
      description: >-
        Metadata about available metrics, aggregations, and configurations for
        an application
      required:
        - application
        - project
        - organization
        - aggregations
        - metrics
      properties:
        application:
          $ref: '#/components/schemas/ApplicationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        aggregations:
          type: array
          items:
            $ref: '#/components/schemas/AggregationOption'
          description: Available aggregation functions
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/MetricDefinition'
          description: Available metrics and their configurations
    ListAttributesCompactResponse:
      type: array
      items:
        $ref: '#/components/schemas/AttributeCompactResponse'
    AttributeCompactResponse:
      type: object
      required:
        - id
        - name
        - data_type
        - scope
        - attribute_type
      properties:
        id:
          description: Unique identifier of the Attribute
          type: string
          format: uuid
        name:
          description: Name of the Attribute
          type: string
        display_name:
          description: Display Name of the Attribute
          type: string
        data_type:
          description: AttributeDataType
          type: string
          enum:
            - float
            - string
        scope:
          description: AttributeScope
          type: string
          enum:
            - span
            - session
        attribute_type:
          description: AttributeType
          type: string
          enum:
            - system
            - user
    AttributeCategoriesResponse:
      type: object
      required:
        - category_name
      properties:
        category_name:
          type: string
          description: Name of the Category
    AuthStrategiesResponseBody:
      type: object
      required:
        - sso_active
        - credentials_active
      properties:
        sso_active:
          type: boolean
        credentials_active:
          type: boolean
        provider_data:
          type: object
          description: >-
            This dictionary will only be present if sso_active is true. It will
            contain the provider data for the SSO provider. The provider data
            will contain the provider name and the provider url.
          properties:
            id:
              type: string
            url:
              type: string
          required:
            - id
            - url
    AddBaselineRequestBody:
      type: object
      required:
        - name
        - model_id
        - type
        - env_type
      properties:
        name:
          type: string
          description: A name describing the baseline
        model_id:
          type: string
          format: uuid
          description: The unique identifier for the model associated with the baseline
        type:
          type: string
          enum:
            - STATIC
            - ROLLING
          description: The type of baseline, indicating whether it is STATIC or ROLLING.
        env_type:
          type: string
          enum:
            - PRODUCTION
            - PRE_PRODUCTION
          description: >-
            The environment type for the baseline, indicating whether it applies
            to production or pre-production environments.
        env_id:
          type: string
          format: uuid
          nullable: true
          description: Required when env_type is PRE_PRODUCTION
        start_time:
          type: integer
          description: Start time in milliseconds from epoch for production data
          nullable: false
        end_time:
          type: integer
          description: End time in milliseconds from epoch for production data
          nullable: false
        offset_delta:
          type: integer
          description: x is offset delta for offset=x*window_bin_size
          nullable: false
          minimum: 1
        window_bin_size:
          $ref: '#/components/schemas/WindowBinSize'
    Baseline:
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: Unique identifier for the baseline
            name:
              type: string
              description: A name describing the baseline
            type:
              type: string
              enum:
                - STATIC
                - ROLLING
              description: >-
                The type of baseline, indicating whether it is STATIC or
                ROLLING.
            row_count:
              type: integer
              nullable: true
              description: Number of rows in the baseline
            start_time:
              type: integer
              description: Start time in milliseconds from epoch for production data
              nullable: true
            end_time:
              type: integer
              description: End time in milliseconds from epoch for production data
              nullable: true
            offset_delta:
              type: integer
              description: x is offset delta for offset=x*window_bin_size
              nullable: true
              minimum: 1
            window_bin_size:
              $ref: '#/components/schemas/WindowBinSize'
            model:
              $ref: '#/components/schemas/ModelCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            environment:
              $ref: '#/components/schemas/EnvironmentCompact'
          required:
            - id
            - name
            - type
            - row_count
            - model
            - project
            - organization
            - environment
        - $ref: '#/components/schemas/TimestampResponse'
    WindowBinSize:
      type: string
      description: Window size to be used for relative baseline
      enum:
        - Hour
        - Day
        - Week
        - Month
    Baselines:
      type: array
      items:
        $ref: '#/components/schemas/Baseline'
    EntityType:
      type: string
      description: >-
        Type of entity in the catalog. `attribute` covers user-defined and
        system span attributes. The other types correspond to top-level trace
        columns.
      enum:
        - attribute
        - agent_name
        - span_type
        - span_name
    EntityDataType:
      type: string
      description: >-
        Data type of the entity value. `numeric` for float/integer values,
        `string` for categorical values, `content` for long-form text (LLM
        inputs/outputs).
      enum:
        - numeric
        - string
        - content
    CatalogItem:
      type: object
      required:
        - name
        - data_type
      properties:
        name:
          type: string
          description: >-
            Bare OTel attribute key (e.g. `gen_ai.usage.input_tokens`). This is
            the `OriginalName` from the entity catalog.
        semantic_name:
          type: string
          description: >-
            Canonical semantic concept name (e.g. `input_tokens`, `model_name`).
            Returns `UNKNOWN` for unmapped attributes.
        data_type:
          $ref: '#/components/schemas/EntityDataType'
        first_seen:
          type: string
          format: date-time
          description: Timestamp when this entity was first observed.
        last_seen:
          type: string
          format: date-time
          description: Timestamp when this entity was last observed.
        row_count:
          type: integer
          description: Number of spans containing this entity.
    CatalogValueItem:
      type: object
      required:
        - value
      properties:
        value:
          type: string
          description: A distinct value observed for the entity.
        first_seen:
          type: string
          format: date-time
          description: Timestamp when this value was first observed.
        last_seen:
          type: string
          format: date-time
          description: Timestamp when this value was last observed.
        row_count:
          type: integer
          description: Number of spans with this value.
    ChartAnnotationObject:
      type: object
      description: Chart annotation fields JSON
      required:
        - id
        - title
        - start_time
        - end_time
        - model
        - organization
        - project
        - created_at
        - updated_at
        - created_by
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: UUID format unique identifier for chart annotation
            title:
              type: string
              description: Title of the chart annotation
            description:
              type: string
              description: Description of the chart annotation
            start_time:
              type: string
              format: date-time
              description: Start time of the chart annotation
            end_time:
              type: string
              format: date-time
              description: End time of the chart annotation
            model:
              $ref: '#/components/schemas/ModelCompact'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            created_by:
              $ref: '#/components/schemas/UserCompact'
            updated_by:
              $ref: '#/components/schemas/UserCompact'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    ListChartAnnotationResponse:
      type: array
      items:
        $ref: '#/components/schemas/ChartAnnotationObject'
    ChartModelCompact:
      type: object
      title: Chart ModelCompact
      description: Compact version of model for chart v3
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
    ChartSegmentCompact:
      type: object
      title: Chart SegmentCompact
      description: Compact version of segment for chart v3
      properties:
        id:
          type: string
          format: uuid
        definition:
          type: string
          description: FQL definition
    QueryType:
      type: string
      description: Specfies the query type to fetch the corresponding metrics
      enum:
        - MONITORING
        - EMBEDDING
        - ANALYTICS
    QueryMonitoringResponse:
      type: object
      title: Monitoring query response structure
      description: Monitoring query response structure
      required:
        - query_key
        - model
        - baseline
        - metric
        - columns
      properties:
        query_key:
          type: string
          format: uuid
        model:
          $ref: '#/components/schemas/ChartModelCompact'
        baseline_id:
          type: string
          format: uuid
        metric:
          type: string
        metric_type:
          type: string
        columns:
          type: array
          items:
            type: string
        categories:
          type: array
          items:
            type: string
        segment_id:
          type: string
          format: uuid
        segment:
          $ref: '#/components/schemas/SegmentCompact'
        viz_type:
          type: string
          enum:
            - line
            - bar
    QueryEmbeddingResponse:
      type: object
      title: Embedding query response structure
      description: Embedding query response structure
      required:
        - query_key
        - model
        - column_name
        - minimum_distance
        - number_of_neighbors
        - sample_size
        - metric_type
        - plot
      properties:
        query_key:
          type: string
          format: uuid
        model:
          $ref: '#/components/schemas/ChartModelCompact'
        column_name:
          type: string
        baseline_id:
          type: string
          format: uuid
        retrieve_columns:
          type: array
          items:
            type: string
        metric_type:
          type: string
          enum:
            - umap
            - pca
            - tsne
        minimum_distance:
          type: number
        number_of_neighbors:
          type: number
        plot:
          type: string
          enum:
            - 2D
            - 3D
        distance_metric:
          type: string
          enum:
            - cosine
            - euclidean
            - manhattan
        sample_size:
          type: integer
        segment:
          $ref: '#/components/schemas/SegmentCompactIdOrDefinition'
    MonitoringDataSource:
      type: object
      title: Chart data source for queries monitoring metadata
      description: Chart data source for queries monitoring metadata
      required:
        - filters
        - queries
      properties:
        query_type:
          type: string
          enum:
            - MONITORING
        time_comparison:
          description: Specifes the time period to comapre the current data against
          type: string
          enum:
            - Previous Day
            - Previous Week
            - Previous Month
            - Previous Quarter
            - Previous Year
        filters:
          $ref: '#/components/schemas/QueryFilters'
        queries:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/QueryMonitoringResponse'
    AnalyticsDataSource:
      type: object
      title: Chart data source for analytics charts metadata
      description: Chart data source for analytics charts metadata
      required:
        - model
        - env_type
        - payload
      properties:
        query_type:
          type: string
          enum:
            - ANALYTICS
        model:
          $ref: '#/components/schemas/ChartModelCompact'
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
        type:
          $ref: '#/components/schemas/AnalyticsChartType'
        payload:
          $ref: '#/components/schemas/AnalyticsPayload'
        env_id:
          type: string
          format: uuid
          nullable: true
          description: Environment id, required for PRE_PRODUCTION env_type
        segment:
          $ref: '#/components/schemas/ChartSegmentCompact'
        time_filter:
          $ref: '#/components/schemas/AnalyticsTimeFilter'
    EmbeddingDataSource:
      type: object
      title: Chart data source for embedding charts metadata
      description: Chart data source for embedding charts metadata
      required:
        - filters
        - queries
      properties:
        query_type:
          type: string
          enum:
            - EMBEDDING
        filters:
          $ref: '#/components/schemas/QueryFilters'
        queries:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/QueryEmbeddingResponse'
    ChartOptions:
      type: object
      title: Chart options
      description: Chart options
      properties:
        axes:
          type: array
          items:
            type: object
            properties:
              is_xaxis:
                type: boolean
              scale:
                type: string
                enum:
                  - linear
                  - log
                default: linear
              orientation:
                type: string
                enum:
                  - y1
                  - y2
        series:
          type: array
          items:
            type: object
            properties:
              viz_type:
                type: string
                enum:
                  - line
                  - bar
                default: line
        customYAxis:
          type: array
          items:
            $ref: '#/components/schemas/CustomYAxis'
        hiddenQueries:
          type: array
          items:
            type: string
        queryNames:
          type: object
          additionalProperties:
            type: string
        time_unit:
          $ref: '#/components/schemas/TimeUnit'
    CustomYAxis:
      type: object
      title: CustomYAxis
      properties:
        min:
          type: string
        max:
          type: string
        scale:
          type: string
          enum:
            - value
            - log
        query_keys:
          type: array
          items:
            type: string
    MetricChartOptions:
      type: object
      title: Metric Chart options
      description: Chart options for metric
      properties:
        display_name:
          type: string
          description: Name to be displayed for the metric
          example: Average monthly Salary
        unit:
          type: string
          description: Custom unit to add on the chart next to the metric value
          example: $
        unit_placement:
          type: string
          description: >-
            Indicates where to render th custom unit, before or after the metric
            value
          enum:
            - PREFIX
            - POSTFIX
          example: PREFIX
        decimal_places:
          type: integer
          description: Number of decimal points to show
          example: 1
        abbreviation:
          type: boolean
          description: abbreviated numbers
          example: true
    ChartDetails:
      title: Chart Details
      description: Chart Details
      required:
        - title
        - query_type
        - data_source
      properties:
        title:
          type: string
        description:
          type: string
        query_type:
          oneOf:
            - $ref: '#/components/schemas/QueryType'
            - $ref: '#/components/schemas/LLMQueryType'
        options:
          $ref: '#/components/schemas/ChartOptions'
        data_source:
          oneOf:
            - $ref: '#/components/schemas/MonitoringDataSource'
            - $ref: '#/components/schemas/AnalyticsDataSource'
            - $ref: '#/components/schemas/EmbeddingDataSource'
            - $ref: '#/components/schemas/LLMDataSource'
    AddChartRequestBody:
      title: Add chart request body
      description: Add chart request body
      allOf:
        - type: object
          properties:
            project_id:
              type: string
              format: uuid
        - $ref: '#/components/schemas/ChartDetails'
    Chart:
      title: Chart Detail Response
      description: Chart Detail Response
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              readOnly: true
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            created_by:
              $ref: '#/components/schemas/UserCompact'
            updated_by:
              $ref: '#/components/schemas/UserCompact'
          required:
            - id
            - organization
            - project
        - $ref: '#/components/schemas/ChartDetails'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    ListChartResponse:
      type: array
      title: Chart List Response
      description: Chart List Response
      items:
        allOf:
          - type: object
            properties:
              id:
                type: string
                format: uuid
                readOnly: true
              title:
                type: string
              description:
                type: string
              query_type:
                oneOf:
                  - $ref: '#/components/schemas/QueryType'
                  - $ref: '#/components/schemas/LLMQueryType'
              chart_type:
                $ref: '#/components/schemas/ChartTypeAnalytics'
              organization:
                $ref: '#/components/schemas/OrganizationCompact'
              project:
                $ref: '#/components/schemas/ProjectCompact'
              created_by:
                $ref: '#/components/schemas/UserCompact'
              updated_by:
                $ref: '#/components/schemas/UserCompact'
            required:
              - id
              - title
              - description
              - query_type
              - organization
              - project
          - $ref: '#/components/schemas/CreateUpdateTimestamp'
    UpdateChartRequest:
      type: object
      title: Update chart request body
      description: Update chart request body
      required:
        - title
        - data_source
        - query_type
      properties:
        title:
          type: string
        description:
          type: string
        options:
          $ref: '#/components/schemas/ChartOptions'
        data_source:
          oneOf:
            - $ref: '#/components/schemas/MonitoringDataSource'
            - $ref: '#/components/schemas/AnalyticsDataSource'
            - $ref: '#/components/schemas/EmbeddingDataSource'
            - $ref: '#/components/schemas/LLMDataSource'
    QueryMonitoringRequestFields:
      type: object
      title: Monitoring query request fields
      description: Monitoring query request fields
      required:
        - query_key
        - model_id
        - metric
        - columns
      properties:
        query_key:
          description: Unique identifier of the query.
          type: string
          format: uuid
        model_id:
          description: Unique identifier of the model.
          type: string
          format: uuid
        baseline_id:
          description: Unique identifier of the baseline.
          type: string
          format: uuid
        metric:
          description: Metric key.
          type: string
        columns:
          description: List of column names.
          type: array
          items:
            type: string
        categories:
          description: List of categories.
          type: array
          items:
            type: string
        segment_id:
          description: Unique identifier of the baseline.
          type: string
          format: uuid
        segment:
          $ref: '#/components/schemas/SegmentCompact'
        viz_type:
          description: Specifies the visualization Type for the UI.
          type: string
          enum:
            - line
            - bar
    MonitoringQueryRequestObject:
      type: object
      title: Monitoring queries request object
      description: Monitoring queries request object
      properties:
        time_comparison:
          description: Specifes the time period to comapre the data against
          type: string
          enum:
            - Previous Day
            - Previous Week
            - Previous Month
            - Previous Quarter
            - Previous Year
        query_type:
          $ref: '#/components/schemas/QueryType'
        filters:
          $ref: '#/components/schemas/QueryFilters'
        queries:
          type: array
          items:
            $ref: '#/components/schemas/QueryMonitoringRequestFields'
    MonitoringQueryRequest:
      allOf:
        - type: object
          properties:
            project_id:
              description: Unique identifier of the project
              type: string
              format: uuid
          required:
            - project_id
        - $ref: '#/components/schemas/MonitoringQueryRequestObject'
    MonitoringQueryResponseObject:
      type: object
      required:
        - query_key
        - model
        - metric
        - viz_type
        - col_names
        - data
      properties:
        query_key:
          description: Unique identifier of the query.
          type: string
          format: uuid
        model:
          $ref: '#/components/schemas/ModelCompact'
        baseline:
          $ref: '#/components/schemas/BaselineCompact'
        segment:
          $ref: '#/components/schemas/SegmentCompact'
        metric:
          description: Metric key.
          type: string
        viz_type:
          description: Specifies the visualization Type for the UI.
          type: string
          enum:
            - line
            - bar
        columns:
          description: List of columns.
          type: array
          items:
            type: string
        col_names:
          description: List of column names.
          type: array
          uniqueItems: true
          items:
            type: string
        data:
          description: The metric response data.
          type: array
          items:
            type: array
            items:
              anyOf:
                - type: string
                - type: number
                - type: integer
                - type: boolean
                  nullable: true
    MonitoringQueryResponse:
      type: object
      required:
        - organization
        - project
        - query_type
        - filters
      properties:
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        time_comparison:
          description: Specifes the time period to comapre the data against.
          type: string
          enum:
            - Previous Day
            - Previous Week
            - Previous Month
            - Previous Quarter
            - Previous Year
            - null
          nullable: true
        query_type:
          $ref: '#/components/schemas/QueryType'
        filters:
          $ref: '#/components/schemas/QueryFilters'
        results:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/MonitoringQueryResponseObject'
    AnalyticsChartType:
      type: string
      enum:
        - PERFORMANCE
        - METRICS
        - FEATURE_ANALYTICS
    PerformanceChartType:
      type: string
      enum:
        - CONFUSION_MATRIX
        - ROC_CURVE
        - PRECISION_RECALL_CURVE
        - CALIBRATION_CURVE
        - ERROR_DISTRIBUTION
        - PREDICTION_SCATTERPLOT
    AnalyticsPayload:
      oneOf:
        - $ref: '#/components/schemas/PerformancePayload'
        - $ref: '#/components/schemas/MetricsPayload'
        - $ref: '#/components/schemas/FeatureAnalyticsPayload'
    PerformancePayload:
      type: object
      properties:
        response_type:
          type: string
          enum:
            - PERFORMANCE
        chart_type:
          $ref: '#/components/schemas/PerformanceChartType'
        binary_threshold:
          type: number
          description: Threshold for binary classification models
          minimum: 0
          maximum: 1
        top_k:
          type: integer
          description: Top K for ranking models
          minimum: 1
          maximum: 500
        num_samples:
          type: integer
          description: Max records to fetch for performance charts
          minimum: 1
          maximum: 500000
        labels:
          type: array
          items:
            type: string
          nullable: true
    MetricsPayload:
      type: object
      required:
        - chart_type
        - metrics
      properties:
        response_type:
          type: string
          enum:
            - METRICS
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/MetricsCompact'
        binary_threshold:
          type: number
          description: Threshold for binary classification models
          minimum: 0
          maximum: 1
        top_k:
          type: integer
          description: Top K for ranking models
          minimum: 1
          maximum: 500
    MetricsCompact:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: >-
            Metric name (accuracy, precision, jsd, ...) or UUID of the custom
            metric
        column:
          type: string
          description: Column name to compute the metric on (only for some metrics)
        category:
          oneOf:
            - type: string
            - type: integer
            - type: number
            - type: boolean
          description: Category to compute the metric on for categorical column
        baseline_id:
          type: string
          format: uuid
          description: Baseline uuid to compute the metric with (only for some metrics)
        options:
          $ref: '#/components/schemas/MetricChartOptions'
    FeatureAnalyticsPayload:
      type: object
      required:
        - visualization
        - columns
      properties:
        response_type:
          type: string
          enum:
            - FEATURE_ANALYTICS
        visualization:
          type: string
          enum:
            - FEATURE_DISTRIBUTION
            - FEATURE_CORRELATION
            - CORRELATION_MATRIX
        columns:
          description: list of column names for the analysis
          type: array
          items:
            type: string
            nullable: false
        num_samples:
          type: integer
          minimum: 1
          maximum: 10000
          description: Max number of samples to represent for line plot and scatter plot
        num_bins:
          type: integer
          minimum: 1
          maximum: 1000
          description: Number of bins, only used for line plot and feature distribution
        config:
          oneOf:
            - $ref: '#/components/schemas/FeatureCorrelationConfig'
            - $ref: '#/components/schemas/FeatureDistributionConfig'
    AnalyticsTimeFilter:
      type: object
      properties:
        time_label:
          type: string
          enum:
            - yesterday
            - today
            - 7d
            - 30d
            - 90d
            - 6m
            - 12m
            - ytd
            - null
          nullable: true
        time_range:
          type: object
          nullable: true
          properties:
            start_time:
              type: string
              format: date-time
            end_time:
              type: string
              format: date-time
          required:
            - start_time
            - end_time
        time_zone:
          type: string
          default: Etc/GMT
    FeatureCorrelationConfig:
      type: object
      properties:
        config_type:
          type: string
          enum:
            - CORRELATION
        visualization:
          description: Preferred type of visualization for feature correlation
          type: string
          enum:
            - LINE_PLOT
            - SCATTER_PLOT
            - STACKED_PLOT
            - BOX_PLOT
        x_axis_column:
          type: string
          description: Column name to use as the x-axis in the chart
    ChartTypeAnalytics:
      type: string
      title: Analytic chart type
      description: Chart type for ANALYTICS query type
      enum:
        - PERFORMANCE
        - METRICS
        - FEATURE_ANALYTICS
    ChartApplicationCompact:
      type: object
      title: Chart ApplicationCompact
      description: Compact version of an application for chart v3
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
    LLMQueryType:
      type: string
      description: Specifies the chart type to fetch the corresponding metrics
      enum:
        - GEN_AI_MONITORING
        - GEN_AI_METRICS
    LLMQueryObject:
      type: object
      title: LLM Monitoring query response structure
      description: LLM Monitoring query response structure
      required:
        - query_key
        - query_scope
        - application
        - metric_source
        - metric_name
        - viz_type
      properties:
        query_key:
          type: string
          format: uuid
        query_scope:
          type: string
          enum:
            - SPAN
            - SESSION
        application:
          $ref: '#/components/schemas/ChartApplicationCompact'
        filters:
          $ref: '#/components/schemas/LLMQueryFilters'
        options:
          $ref: '#/components/schemas/MetricChartOptions'
        viz_type:
          type: string
          enum:
            - line
            - bar
        metric_source:
          $ref: '#/components/schemas/GenAIMetricSourceEnum'
        metric_name:
          $ref: '#/components/schemas/GenAIMetricName'
        aggregation:
          $ref: '#/components/schemas/GenAIAggregationEnum'
        metric_params:
          $ref: '#/components/schemas/GenAIMetricParams'
    LLMDataSource:
      type: object
      title: Chart data source for llm monitoring/metrics card
      description: Chart data source for llm queries monitoring/metrics card
      required:
        - queries
      properties:
        query_type:
          $ref: '#/components/schemas/LLMQueryType'
        time_filters:
          $ref: '#/components/schemas/LLMTimeFilters'
        queries:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/LLMQueryObject'
    LLMTimeFilters:
      type: object
      title: LLM Time Filters
      description: >
        Filters for querying data, including time range, time zone, and bin
        size(Only for monitoring queries).
      oneOf:
        - required:
            - time_label
        - required:
            - time_range
      properties:
        time_label:
          type: string
          enum:
            - yesterday
            - today
            - 7d
            - 30d
            - 90d
            - 6m
            - 12m
            - ytd
            - null
          nullable: true
          description: |
            Time label for filtering data within specific time ranges.
        time_range:
          type: object
          nullable: true
          properties:
            start_time:
              type: string
              format: date-time
              description: |
                Start time of the time range for querying data.
            end_time:
              type: string
              format: date-time
              description: |
                End time of the time range for querying data.
          required:
            - start_time
            - end_time
          description: |
            Custom time range for querying data.
        time_zone:
          type: string
          default: Etc/GMT
          description: |
            Time zone used for data filtering.
        bin_size:
          type: string
          enum:
            - Hour
            - Day
            - Week
            - Month
          default: Hour
          description: >
            Bin size for grouping data in monitoring queries, defaulting to
            hourly bins.
        time_comparison:
          description: Specifes the time period to comapre the current data against
          type: string
          enum:
            - Previous Day
            - Previous Week
            - Previous Month
            - Previous Quarter
            - Previous Year
    LLMQueryMonitoringRequestFields:
      type: object
      title: Monitoring query request fields
      description: Monitoring query request fields
      required:
        - query_key
        - query_scope
        - query_type
        - application_id
        - viz_type
        - metric_source
        - metric_name
      properties:
        query_type:
          $ref: '#/components/schemas/LLMQueryType'
        query_key:
          description: Unique identifier of the query.
          type: string
          format: uuid
        query_scope:
          description: Query scope
          type: string
          enum:
            - SPAN
            - SESSION
        application_id:
          description: Unique identifier of the application
          type: string
          format: uuid
        filters:
          $ref: '#/components/schemas/LLMQueryFilters'
        viz_type:
          description: Specifies the visualization Type for the UI.
          type: string
          enum:
            - line
            - bar
        metric_source:
          $ref: '#/components/schemas/GenAIMetricSourceEnum'
        metric_name:
          $ref: '#/components/schemas/GenAIMetricName'
        aggregation:
          $ref: '#/components/schemas/GenAIAggregationEnum'
        metric_params:
          $ref: '#/components/schemas/GenAIMetricParams'
        timestamp_mode:
          type: string
          nullable: true
          enum:
            - event_time
            - processing_time
          description: >-
            Controls which time axis is used for query binning and filtering.
            Use processing_time for evaluator alert previews to match actual
            alert evaluation behavior. Defaults to event_time when not provided.
    LLMQueryRequestObject:
      type: object
      title: LLM Monitoring queries request object
      description: LLM Monitoring queries request object
      properties:
        query_type:
          $ref: '#/components/schemas/LLMQueryType'
        time_filters:
          $ref: '#/components/schemas/LLMTimeFilters'
        queries:
          type: array
          items:
            $ref: '#/components/schemas/LLMQueryMonitoringRequestFields'
    LLMQueryRequest:
      allOf:
        - type: object
          properties:
            project_id:
              description: Unique identifier of the project
              type: string
              format: uuid
          required:
            - project_id
        - $ref: '#/components/schemas/LLMQueryRequestObject'
    LLMMonitoringQueryResponseObject:
      type: object
      required:
        - query_key
        - query_type
        - application
        - viz_type
        - data
        - chart_col_names
        - metric_source
        - metric_name
        - aggregation
      properties:
        query_type:
          $ref: '#/components/schemas/LLMQueryType'
        query_key:
          description: Unique identifier of the query.
          type: string
          format: uuid
        application:
          $ref: '#/components/schemas/ChartApplicationCompact'
        chart_col_names:
          description: List of chart column names.
          type: array
          uniqueItems: true
          items:
            type: string
        viz_type:
          description: Specifies the visualization Type for the UI.
          type: string
          enum:
            - line
            - bar
        data:
          description: The metric response data.
          type: array
          items:
            type: array
            items:
              anyOf:
                - type: string
                - type: number
                - type: integer
                - type: boolean
                  nullable: true
        metric_source:
          $ref: '#/components/schemas/GenAIMetricSourceEnum'
        metric_name:
          $ref: '#/components/schemas/GenAIMetricName'
        aggregation:
          $ref: '#/components/schemas/GenAIAggregationEnum'
        metric_params:
          $ref: '#/components/schemas/GenAIMetricParams'
        timestamp_mode:
          type: string
          nullable: true
          enum:
            - event_time
            - processing_time
          description: >-
            The time axis used for this query. Echoes back the timestamp_mode
            from the request.
    LLMMonitoringQueryResponse:
      type: object
      required:
        - organization
        - project
        - query_type
        - time_filters
        - results
      properties:
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        query_type:
          $ref: '#/components/schemas/LLMQueryType'
        time_filters:
          $ref: '#/components/schemas/LLMTimeFilters'
        results:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/LLMMonitoringQueryResponseObject'
    ConfigurationName:
      type: string
      description: Configuration name value
    ConfigurationSource:
      type: string
      description: Configuration source scope enum value
      enum:
        - ORGANIZATION
        - PROJECT
        - MODEL
        - APPLICATION
    ConfigurationSourceId:
      type: string
      format: uuid
      description: >-
        Source entity ID (organization ID, project ID, model ID, or application
        ID depending on source_name)
    ConfigurationGroup:
      type: string
      description: Configuration group value
    ConfigurationValue:
      description: >
        Configuration value. The format depends on the configuration type
        (determined by the `name` field).

        The value must be one of:


        - **Boolean**: `true` or `false` (for BoolConfigValue)

        - **Integer**: `123` (for IntConfigValue)

        - **Float**: `123.45` (for FloatConfigValue)

        - **String**: `"string"` (for StringConfigValue)


        The actual type is determined by the configuration name and validated
        against the config registry.
      oneOf:
        - type: boolean
        - type: number
        - type: string
    AddConfigurationRequestBody:
      type: object
      required:
        - name
        - source_name
        - source_id
        - value
      properties:
        name:
          $ref: '#/components/schemas/ConfigurationName'
        source_name:
          $ref: '#/components/schemas/ConfigurationSource'
        source_id:
          $ref: '#/components/schemas/ConfigurationSourceId'
        value:
          $ref: '#/components/schemas/ConfigurationValue'
    UpdateConfigurationRequestBody:
      type: object
      required:
        - value
      properties:
        value:
          $ref: '#/components/schemas/ConfigurationValue'
    ConfigurationResponse:
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: Configuration UUID
            name:
              $ref: '#/components/schemas/ConfigurationName'
            source_name:
              $ref: '#/components/schemas/ConfigurationSource'
            source_id:
              $ref: '#/components/schemas/ConfigurationSourceId'
            value:
              $ref: '#/components/schemas/ConfigurationValue'
            description:
              type: string
              nullable: true
              description: Human-readable description of the configuration
            is_secret:
              type: boolean
              description: Whether the configuration value contains sensitive data
            is_system:
              type: boolean
              description: Whether this is a system configuration
            group_name:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/ConfigurationGroup'
              description: Configuration group identifier
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            created_by:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/UserCompact'
            updated_by:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/UserCompact'
          required:
            - id
            - name
            - source_name
            - source_id
            - value
            - is_secret
            - is_system
            - organization
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    ListConfigurationResponse:
      type: array
      title: Configuration List Response
      description: Configuration List Response
      items:
        $ref: '#/components/schemas/ConfigurationResponse'
    CreateCustomMetricRequest:
      type: object
      required:
        - model_id
        - name
        - definition
      properties:
        model_id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        definition:
          type: string
    DRAdvancedOption:
      type: object
      properties:
        type:
          type: string
        default:
          oneOf:
            - type: string
            - type: integer
            - type: number
            - type: boolean
        min:
          nullable: true
          oneOf:
            - type: integer
            - type: number
        max:
          nullable: true
          oneOf:
            - type: integer
            - type: number
        options:
          nullable: true
          oneOf:
            - type: array
              items:
                type: string
    UmapAdvancedOptions:
      type: object
      properties:
        sample_size:
          $ref: '#/components/schemas/DRAdvancedOption'
        number_of_neighbors:
          $ref: '#/components/schemas/DRAdvancedOption'
        minimum_distance:
          $ref: '#/components/schemas/DRAdvancedOption'
        distance_metric:
          $ref: '#/components/schemas/DRAdvancedOption'
    DimensionalityReductionAdvancedOptions:
      type: object
      properties:
        umap:
          $ref: '#/components/schemas/UmapAdvancedOptions'
    KeyDisplayNamePair:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        group:
          type: string
    ModelDimensionalityReductionInfo:
      type: object
      required:
        - columns
        - retrieve_columns
        - baselines
        - supported_algorithms
        - advanced_options
        - organization
        - project
        - model
      properties:
        columns:
          type: array
          items:
            $ref: '#/components/schemas/KeyDisplayNamePair'
        retrieve_columns:
          type: array
          items:
            $ref: '#/components/schemas/KeyDisplayNamePair'
        baselines:
          type: array
          items:
            $ref: '#/components/schemas/BaselineCompact'
        supported_algorithms:
          type: array
          items:
            type: string
        advanced_options:
          $ref: '#/components/schemas/DimensionalityReductionAdvancedOptions'
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        model:
          $ref: '#/components/schemas/ModelCompact'
    QueryDimensionalityReduction:
      type: object
      properties:
        query_key:
          nullable: true
          type: string
        baseline_id:
          nullable: true
          type: string
        retrieve_columns:
          nullable: true
          type: array
          items:
            type: string
        metric_type:
          type: string
          enum:
            - umap
            - pca
            - tsne
        plot:
          type: string
          enum:
            - 3D
            - 2D
        filters:
          $ref: '#/components/schemas/QueryFilters'
        column_name:
          type: string
        sample_size:
          type: integer
        number_of_neighbors:
          type: integer
        minimum_distance:
          type: number
        distance_metric:
          type: string
          enum:
            - cosine
            - euclidean
            - manhattan
        segment:
          $ref: '#/components/schemas/SegmentCompactIdOrDefinition'
    QueryDimensionalityReductionResponse:
      type: object
      required:
        - metric_type
        - plot
        - point_metadata
        - points
        - organization
        - project
        - model
      properties:
        metric_type:
          type: string
          nullable: false
        plot:
          type: string
        point_metadata:
          type: object
          properties:
            src_type:
              type: string
              enum:
                - text
                - image_url
                - image
            fields:
              type: array
              items:
                type: object
                properties:
                  display_name:
                    type: string
                  color_by_default:
                    type: boolean
                    default: false
                  key:
                    type: string
                  type:
                    type: string
                    enum:
                      - categorical
                      - numeric
                      - string
                  possible_values:
                    type: object
                    additionalProperties:
                      type: string
                  additionalProperties:
                    type: string
            color_by_fields:
              type: array
              items:
                type: string
        points:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              src:
                type: string
              coords:
                type: array
                items:
                  type: number
              fields:
                type: object
                additionalProperties:
                  oneOf:
                    - type: string
                    - type: number
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        model:
          $ref: '#/components/schemas/ModelCompact'
        baseline:
          $ref: '#/components/schemas/BaselineCompact'
    Environment:
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            type:
              type: string
              enum:
                - PRE_PRODUCTION
                - PRODUCTION
            row_count:
              type: integer
              nullable: true
            model:
              $ref: '#/components/schemas/ModelCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
          required:
            - id
            - name
            - type
            - model
            - project
            - organization
        - $ref: '#/components/schemas/TimestampResponse'
    Environments:
      type: array
      items:
        $ref: '#/components/schemas/Environment'
    EvalDataset:
      type: object
      description: Eval dataset metadata
      required:
        - id
        - name
        - active
        - created_at
        - updated_at
        - created_by
        - updated_by
        - organization
        - project
        - application
      properties:
        id:
          type: string
          format: uuid
          description: Dataset UUID
        name:
          type: string
          maxLength: 256
        description:
          type: string
          nullable: true
          maxLength: 512
        metadata:
          type: object
          additionalProperties: true
          maxProperties: 10
        field_mapping:
          type: object
          nullable: true
          additionalProperties:
            type: object
            additionalProperties:
              type: string
          maxProperties: 10
          description: >-
            Last-used span-to-column field mapping for "add to dataset"
            operations. Null when no mapping has been saved.
        active:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        created_by:
          $ref: '#/components/schemas/UserCompact'
        updated_by:
          $ref: '#/components/schemas/UserCompact'
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        application:
          $ref: '#/components/schemas/ApplicationCompact'
    CreateEvalDataset:
      type: object
      description: Request to create a new dataset
      required:
        - name
        - application_id
      properties:
        name:
          type: string
          maxLength: 256
        description:
          type: string
          nullable: true
          maxLength: 512
        metadata:
          type: object
          nullable: true
          additionalProperties: true
          maxProperties: 10
        application_id:
          type: string
          format: uuid
          description: Application UUID
        active:
          type: boolean
          default: true
    UpdateEvalDataset:
      type: object
      description: Partial update of a dataset
      properties:
        description:
          type: string
          nullable: true
          maxLength: 512
        metadata:
          type: object
          nullable: true
          additionalProperties: true
          maxProperties: 10
        field_mapping:
          type: object
          nullable: true
          additionalProperties:
            type: object
            additionalProperties:
              type: string
          maxProperties: 10
          description: Span-to-column field mapping. Set to null to clear.
        active:
          type: boolean
    CreateEvalDatasetItemsRequest:
      type: object
      description: Request body to create a new dataset items
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/EvalDatasetItemPayload'
    EvalDatasetItemPayload:
      type: object
      description: Payload for creating a new dataset item
      required:
        - id
        - inputs
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier for the new dataset item.
        inputs:
          type: object
          description: Flexible JSON field for nested input structures.
          example:
            question: What is the capital of France?
            context:
              - Paris is the capital.
        expected_outputs:
          type: object
          nullable: true
          description: Flexible JSON field for nested ground truth structures.
          example:
            answer: Paris
            rationale: Common knowledge.
        metadata:
          type: object
          nullable: true
          description: A JSON object for storing additional test case metadata.
          example:
            reviewer: Alice
            status: approved
        extras:
          type: object
          description: A JSON object for storing additional custom data
          additionalProperties: true
        source_name:
          type: string
          nullable: true
          description: An optional name identifying the source of the test case.
        source_id:
          type: string
          nullable: true
          description: An optional identifier for the source of the test case.
    DatasetItem:
      type: object
      description: Details of a dataset item
      required:
        - id
        - inputs
        - created_at
        - updated_at
      properties:
        id:
          description: Unique identifier of the dataset item
          type: string
          format: uuid
          readOnly: true
        inputs:
          type: object
          description: JSON object representing the inputs for this dataset item.
          additionalProperties: true
        expected_outputs:
          type: object
          nullable: true
          description: JSON object representing the expected outputs for this dataset item.
          additionalProperties: true
        metadata:
          type: object
          nullable: true
          description: JSONB field for unstructured metadata.
          additionalProperties: true
        extras:
          type: object
          nullable: true
          description: JSONB field for unstructured extra data.
          additionalProperties: true
        source_name:
          type: string
          nullable: true
          description: Name of the source for this dataset item.
        source_id:
          type: string
          nullable: true
          description: ID of the item in the source.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    ListDatasetItemsResponse:
      allOf:
        - $ref: '#/components/schemas/PaginatedApiResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                items:
                  type: array
                  items:
                    $ref: '#/components/schemas/DatasetItem'
    DatasetFieldCoverage:
      type: object
      description: Coverage and inferred type for a single field key within a bucket.
      required:
        - count
        - data_type
      properties:
        count:
          type: integer
          description: >-
            Number of items (within the sample) that have this key set. Divide
            by total_items to get the coverage ratio.
        data_type:
          type: string
          enum:
            - STRING
            - FLOAT
          description: >-
            Inferred data type of the field value across the sampled items.
            FLOAT when all observed values are numeric; STRING otherwise.
            Conflicts default to STRING.
    DatasetSchema:
      type: object
      description: >-
        Schema of existing dataset items. Each bucket maps field keys to their
        coverage count and inferred type. Empty objects indicate no items exist
        for that bucket or no keys were found within it.
      required:
        - total_items
        - sampled
        - inputs
        - expected_outputs
        - metadata
        - extras
      properties:
        total_items:
          type: integer
          description: >-
            Number of items used to compute the schema. When sampled is true
            this is capped and counts are approximate; when sampled is false
            this is the exact item count for the dataset.
        sampled:
          type: boolean
          description: >-
            True when the result is based on a sample of a larger item set.
            Counts are approximate in this case.
        inputs:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DatasetFieldCoverage'
          description: Keys found in the inputs bucket across sampled items.
          example:
            question:
              count: 500
              data_type: STRING
            context:
              count: 423
              data_type: STRING
        expected_outputs:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DatasetFieldCoverage'
          description: Keys found in the expected_outputs bucket across sampled items.
          example:
            answer:
              count: 500
              data_type: STRING
        metadata:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DatasetFieldCoverage'
          description: Keys found in the metadata bucket across sampled items.
          example:
            trace_id:
              count: 500
              data_type: STRING
            model:
              count: 500
              data_type: STRING
        extras:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DatasetFieldCoverage'
          description: Keys found in the extras bucket across sampled items.
          example:
            cost_usd:
              count: 120
              data_type: FLOAT
    SpanReference:
      type: object
      required:
        - trace_id
        - span_id
      properties:
        trace_id:
          type: string
          description: OpenTelemetry trace ID (hex string)
        span_id:
          type: string
          description: OpenTelemetry span ID (hex string)
    FieldMapping:
      type: object
      description: >-
        Maps dataset field keys to source span attribute paths. Each bucket
        contains { field_key: source_attr_path } pairs where source_attr_path is
        an OTel-convention key from the span's attributes.
      properties:
        inputs:
          type: object
          additionalProperties:
            type: string
          example:
            question: gen_ai.request.user_message
        expected_outputs:
          type: object
          additionalProperties:
            type: string
          example:
            answer: gen_ai.completion.content
        metadata:
          type: object
          additionalProperties:
            type: string
          example:
            trace_id: trace.id
            model: gen_ai.request.model
        extras:
          type: object
          additionalProperties:
            type: string
          example:
            context: gen_ai.contents.context
    BulkAddSpansRequest:
      type: object
      required:
        - application_id
        - start_time
        - end_time
        - spans
        - mapping
      properties:
        application_id:
          type: string
          format: uuid
          description: UUID of the GenAI application to query spans from
        start_time:
          type: string
          format: date-time
          description: >-
            Start of the time range (inclusive, UTC). Used to bound the
            ClickHouse partition scan to the relevant monthly partitions. Should
            match the time range of the spans being exported.
        end_time:
          type: string
          format: date-time
          description: >-
            End of the time range (exclusive, UTC). Used to bound the ClickHouse
            partition scan to the relevant monthly partitions. Should match the
            time range of the spans being exported.
        spans:
          type: array
          items:
            $ref: '#/components/schemas/SpanReference'
          minItems: 1
          maxItems: 200
          description: >-
            Explicit span references to resolve and write as dataset items.
            Maximum 200 per request.
        mapping:
          $ref: '#/components/schemas/FieldMapping'
    BulkAddSpansResultItem:
      type: object
      required:
        - trace_id
        - span_id
        - item_id
      properties:
        trace_id:
          type: string
          description: OpenTelemetry trace ID (hex string)
        span_id:
          type: string
          description: OpenTelemetry span ID (hex string)
        item_id:
          type: string
          format: uuid
          description: UUID of the created dataset item
    BulkAddSpansResponse:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BulkAddSpansResultItem'
          description: >-
            Created dataset items, one per input span reference, in the same
            order as the request. All spans were resolved — if any span could
            not be resolved, no items are written and a 422 is returned instead.
    ScoreInputsRequest:
      type: object
      title: Score Inputs Request
      description: Request body for scoring inputs
      required:
        - evaluator_name
        - parameters
        - inputs
      properties:
        evaluator_name:
          type: string
          description: Name of the evaluator
        parameters:
          type: object
          description: JSON object containing parameters for the evaluator
          additionalProperties: true
          example:
            key1: value1
            key2: value2
        inputs:
          type: object
          description: JSON object containing the inputs to be evaluated
          additionalProperties: true
          example:
            key1: value1
            key2: value2
    Score:
      type: object
      title: Score
      description: Details of a computed score
      required:
        - name
      properties:
        name:
          type: string
          description: Name of the score (e.g., "accuracy", "toxicity_score").
        value:
          type: number
          format: float
          nullable: true
          description: Floating-point value of the score, if applicable.
        label:
          type: string
          nullable: true
          description: String value of the score, if applicable.
        reasoning:
          type: string
          nullable: true
          description: Reasoning or explanation for the score.
    UpdateEvaluatorRequest:
      type: object
      title: Update Evaluator Request
      description: >
        Request body for updating an evaluator. At least one field must be
        provided; only provided fields will be updated. The evaluator's
        enrichment_name cannot be changed.
      minProperties: 1
      properties:
        name:
          type: string
          description: New name for the evaluator
          minLength: 1
          maxLength: 256
        enrichment_config:
          description: >-
            Updated enrichment configuration. Must match the evaluator's
            enrichment type.
          oneOf:
            - $ref: '#/components/schemas/PiiDetectionConfig'
            - $ref: '#/components/schemas/TopicClassificationConfig'
            - $ref: '#/components/schemas/LLMAsAJudgeConfig'
            - $ref: '#/components/schemas/ChatCompletionConfig'
    EvaluatorRequest:
      type: object
      title: Evaluator Request
      description: Request body for creating an evaluator
      required:
        - name
        - enrichment_name
      properties:
        name:
          type: string
          description: Name of the evaluator
        enrichment_name:
          $ref: '#/components/schemas/EnrichmentName'
        enrichment_config:
          oneOf:
            - $ref: '#/components/schemas/PiiDetectionConfig'
            - $ref: '#/components/schemas/TopicClassificationConfig'
            - $ref: '#/components/schemas/LLMAsAJudgeConfig'
            - $ref: '#/components/schemas/ChatCompletionConfig'
    TopicClassificationConfig:
      type: object
      description: configs for Topic Classification enrichment
      required:
        - topics
      properties:
        topics:
          description: A non-empty list of topics for classification.
          type: array
          items:
            type: string
          minItems: 1
    PiiDetectionConfig:
      type: object
      description: PII detection enrichment configurations
      properties:
        entities:
          description: >-
            List of entities to detect.  An *entity* is a span of text that can
            be used to directly identify an individual. For example, a phone
            number, email address, or social security number.
          type: array
          nullable: true
          items:
            type: string
        allow_list:
          description: A list of terms that should not be identified as PII
          type: array
          nullable: true
          items:
            type: string
    LLMAsAJudgeConfig:
      type: object
      description: Model for LLM-as-a-Judge enrichment configurations.
      required:
        - model_id
        - prompt_spec
      properties:
        model_id:
          description: ID of the LLM Gateway model
          type: string
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        credential_id:
          description: >-
            ID of the LLM Gateway credential, optional for some models such as
            internally hosted LLMs
          type: string
          format: uuid
          example: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
        prompt_spec:
          description: Prompt spec for an LLM-as-a-Judge
          type: object
          additionalProperties: true
          example:
            prompt_template:
              - role: user
                content: >-
                  Please analyze this question, and decide whether is a good
                  question for someone traveling to Japan. Question: {{ question
                  }}
            output_fields:
              evaluation:
                type: string
                choices:
                  - poor
                  - fair
                  - good
                  - excellent
              reasoning:
                type: string
              confidence:
                type: boolean
              numeric_confidence:
                type: number
    ChatCompletionConfig:
      type: object
      description: Chat completion enrichment configurations
      properties:
        model_id:
          type: string
          description: ID of the LLM Gateway model
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        credential_id:
          type: string
          description: ID of the LLM Gateway credential
          format: uuid
          example: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
    Evaluator:
      type: object
      description: Details of the evaluator
      required:
        - id
        - name
        - enrichment_name
        - enrichment_display_name
        - status
        - created_at
      properties:
        id:
          description: Unique identifier of the evaluator
          type: string
          format: uuid
        name:
          description: Name of the evaluator
          type: string
        enrichment_name:
          $ref: '#/components/schemas/EnrichmentName'
        enrichment_display_name:
          description: Human-readable display name of the enrichment type
          type: string
        status:
          description: Current status of the evaluator
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
        created_at:
          type: string
          format: date-time
        enrichment_config:
          oneOf:
            - $ref: '#/components/schemas/PiiDetectionConfig'
            - $ref: '#/components/schemas/TopicClassificationConfig'
            - $ref: '#/components/schemas/ChatCompletionConfig'
            - $ref: '#/components/schemas/LLMAsAJudgeConfig'
    ListEvaluatorConfigSchema:
      type: object
      required:
        - enrichments
      properties:
        config_schemas:
          description: >-
            List the evaluator config schemas in pydantic format for each
            enrichment name
          type: array
          items:
            $ref: '#/components/schemas/EvaluatorConfigSchema'
    EvaluatorConfigSchema:
      type: object
      description: Config schema in pydantic JSON Schema format for an enrichment
      required:
        - enrichment_name
        - enrichment_display_name
        - enrichment_config
      properties:
        enrichment_name:
          $ref: '#/components/schemas/EnrichmentName'
        enrichment_display_name:
          type: string
          description: Human-readable display name of the enrichment
        enrichment_config:
          $ref: '#/components/schemas/JsonSchema'
        preset_fields:
          $ref: '#/components/schemas/PresetFields'
    PresetFields:
      type: object
      description: >-
        Fields already pre-configured by Fiddler for this evaluator and not
        updatable
      properties:
        prompt:
          type: string
          description: Defined system prompt for this evaluator
        outputs:
          description: List of defined outputs for the evaluator
          type: array
          items:
            $ref: '#/components/schemas/OutputConfig'
    OutputConfig:
      type: object
      description: Defined output names and type for the evaluator
      required:
        - name
        - type
      properties:
        name:
          type: string
          description: output name
        type:
          type: string
          description: output type
    SamplingRate:
      type: number
      format: float
      description: >-
        Shared numeric constraint for an evaluator rule's `sampling_rate`: a
        fraction in the half-open range (0.0, 1.0]. 0.0 is rejected — to pause
        evaluation entirely, PATCH the rule with `enabled=false` instead.
        Referenced via `allOf` so each usage can add its own
        description/default.
      maximum: 1
      minimum: 0
      exclusiveMinimum: true
    RuleEvaluatorRequest:
      type: object
      title: Rule Evaluator Request
      description: Request body for creating a Rule evaluator with filters
      required:
        - name
        - application_id
        - evaluator_id
      properties:
        name:
          type: string
          description: Name of the Rule evaluator
        application_id:
          type: string
          format: uuid
          description: Application UUID
        evaluator_id:
          type: string
          format: uuid
          description: UUID of the corresponding evaluator
        mapped_input_keys:
          type: object
          nullable: true
          additionalProperties:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
          description: >-
            Mapping of input field names to verbatim span attribute keys
            (framework-specific). Mutually exclusive with
            `mapped_semantic_names` — provide exactly one.
        mapped_semantic_names:
          type: object
          nullable: true
          additionalProperties:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
          description: >-
            Mapping of input field names to semantic concept names
            (framework-agnostic). Same structure as `mapped_input_keys` but
            values are semantic concepts instead of literal attribute keys. The
            enrichment worker resolves each concept to all mapped attribute keys
            at evaluation time via the semantic mapping cache. Valid concepts:
            `input`, `output`, `system_instructions`, `retrieval_context`,
            `tool_input`, `tool_output`. Mutually exclusive with
            `mapped_input_keys` — provide exactly one.
        filters:
          $ref: '#/components/schemas/EvaluatorRuleFilters'
        backfill:
          description: Whether to backfill already ingested spans
          type: boolean
          default: false
        sampling_rate:
          description: >-
            Fraction of matching spans on which this evaluator runs, in the
            half-open range (0.0, 1.0]. Defaults to 1.0 (every matching span).
            Traces are always persisted even when downsampling is enabled. To
            pause evaluation entirely, create the rule and then PATCH it with
            `enabled=false` — a small `sampling_rate` is not a pause mechanism
            (and `enabled` is not accepted on this create request).
          default: 1
          allOf:
            - $ref: '#/components/schemas/SamplingRate'
        backfill_start_time:
          description: >-
            Starting point for backfill in case backfill is not required for the
            entire period
          type: string
          format: date-time
          nullable: true
    EvaluatorRuleFilters:
      type: object
      description: Filters for applying Rule evaluator
      required:
        - condition
        - rules
      properties:
        condition:
          $ref: '#/components/schemas/QueryConditionType'
        rules:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/QueryConditionType'
              - $ref: '#/components/schemas/QueryRule'
    RuleEvaluator:
      type: object
      description: Rule Evaluator
      required:
        - id
        - name
        - evaluator_id
        - evaluator_name
        - evaluator_type
        - evaluator_type_display_name
        - mapped_input_keys
        - enabled
        - filters
        - outputs
        - backfill
        - created_at
        - updated_at
      allOf:
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
        - type: object
          properties:
            id:
              description: Unique identifier of the Rule evaluator
              type: string
              format: uuid
            name:
              type: string
              description: Name of the Rule evaluator
            evaluator_id:
              type: string
              format: uuid
              description: UUID of the corresponding evaluator
            evaluator_name:
              type: string
              description: Name of the corresponding evaluator
            evaluator_type:
              $ref: '#/components/schemas/EnrichmentName'
            evaluator_type_display_name:
              type: string
              description: Human-readable display name for the evaluator type
            mapped_input_keys:
              type: object
              nullable: true
              additionalProperties:
                anyOf:
                  - type: string
                  - type: array
                    items:
                      type: string
              description: >-
                Mapping of input field names to verbatim span attribute keys.
                Null when `mapped_semantic_names` is set.
            mapped_semantic_names:
              type: object
              nullable: true
              additionalProperties:
                anyOf:
                  - type: string
                  - type: array
                    items:
                      type: string
              description: >-
                Mapping of input field names to semantic concept names. Null
                when `mapped_input_keys` is set.
            filters:
              $ref: '#/components/schemas/EvaluatorRuleFilters'
            outputs:
              $ref: '#/components/schemas/RuleEvaluatorOutputList'
            enabled:
              type: boolean
              description: Indicates if the evaluator is enabled or disabled
            sampling_rate:
              description: >-
                Fraction of matching spans on which this evaluator runs, in
                (0.0, 1.0]. Always present; defaults to 1.0 for rules created
                before this field existed.
              allOf:
                - $ref: '#/components/schemas/SamplingRate'
            application:
              $ref: '#/components/schemas/ApplicationCompact'
            backfill:
              $ref: '#/components/schemas/EvaluatorRuleBackfill'
    EvaluatorRuleBackfill:
      type: object
      description: Details of the evaluator rule backfill
      required:
        - id
        - status
        - backfill_start_time
      properties:
        id:
          type: string
          format: uuid
        backfill_start_time:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - COMPLETED
            - FAILED
            - PARTIALLY_COMPLETED
    RuleEvaluatorOutputList:
      type: array
      description: List of outputs for the rule evaluator
      items:
        $ref: '#/components/schemas/RuleEvaluatorOutput'
    RuleEvaluatorOutput:
      type: object
      description: Output name and type
      properties:
        name:
          description: output name
          type: string
        type:
          description: output type
          type: string
          enum:
            - boolean
            - string
            - number
            - integer
        possible_values:
          description: List of possible values for categorical outputs
          type: array
          items:
            type: string
    ListRuleEvaluatorsResponse:
      type: array
      items:
        $ref: '#/components/schemas/RuleEvaluator'
    UpdateRuleEvaluatorRequest:
      type: object
      description: >-
        Partial update. Any subset of fields may be supplied. At least one field
        must be present. To pause evaluation entirely, set `enabled` to false
        instead of supplying a small `sampling_rate`.
      minProperties: 1
      properties:
        enabled:
          type: boolean
          description: Disable or enable a Rule evaluator
        sampling_rate:
          description: New sampling fraction in (0.0, 1.0].
          allOf:
            - $ref: '#/components/schemas/SamplingRate'
    MapInputKeysRequest:
      type: object
      properties:
        application_id:
          type: string
          format: uuid
          description: UUID for the application
        evaluator_id:
          type: string
          format: uuid
          description: UUID of the corresponding evaluator
    SemanticNameOption:
      type: object
      description: A single semantic name available for evaluator rule input mapping.
      required:
        - name
        - display_name
      properties:
        name:
          type: string
          description: Programmatic semantic name (e.g. `input`, `output`)
        display_name:
          type: string
          description: Human-readable label (e.g. `Input`, `Output`)
    MapInputKeys:
      type: object
      properties:
        attribute_names:
          description: >-
            List of possible attribute names to use for inputs
            (framework-specific)
          type: array
          items:
            type: string
        semantic_names:
          description: >-
            List of semantic name options available for framework-agnostic input
            mapping (V2 only). Use these as values in `mapped_semantic_names`
            when creating an evaluator rule.
          type: array
          items:
            $ref: '#/components/schemas/SemanticNameOption'
        rule_input_keys:
          $ref: '#/components/schemas/JsonSchema'
    ListEnrichmentBackfillResponse:
      type: array
      items:
        $ref: '#/components/schemas/EnrichmentBackfill'
    EnrichmentBackfill:
      type: object
      description: Details of the enrichment backfill
      required:
        - id
        - progress
        - status
        - skipped_count
        - expected_count
        - failed_count
        - succeeded_count
        - created_at
        - updated_at
        - organization
        - project
        - application
        - evaluator_rule
      properties:
        id:
          type: string
          format: uuid
        backfill_start_time:
          type: string
          format: date-time
          nullable: true
        error_message:
          type: string
          nullable: true
        error_reason:
          type: string
          nullable: true
        progress:
          type: number
          minimum: 0
          maximum: 100
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          nullable: true
        started_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - COMPLETED
            - FAILED
            - PARTIALLY_COMPLETED
        skipped_count:
          type: integer
        expected_count:
          type: integer
        failed_count:
          type: integer
        succeeded_count:
          type: integer
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        application:
          $ref: '#/components/schemas/ApplicationCompact'
        evaluator_rule:
          $ref: '#/components/schemas/EvaluatorRuleCompact'
    Experiment:
      type: object
      description: Details of an experiment
      required:
        - id
        - name
        - description
        - metadata
        - error_reason
        - error_message
        - traceback
        - status
        - duration_ms
        - created_by
        - updated_by
        - organization
        - project
        - dataset
        - application
        - created_at
        - updated_at
      allOf:
        - type: object
          properties:
            id:
              description: Unique identifier of the experiment
              type: string
              format: uuid
              readOnly: true
            name:
              type: string
              maxLength: 256
              description: Name of the experiment
            description:
              type: string
              nullable: true
              maxLength: 512
              description: Description of the experiment
            metadata:
              type: object
              nullable: true
              description: JSONB field for unstructured metadata
              additionalProperties: true
              example:
                key1: value1
                key2: value2
            error_reason:
              type: string
              nullable: true
              maxLength: 64
              description: Error reason of the experiment
            error_message:
              type: string
              nullable: true
              description: Error message of the experiment
            traceback:
              type: string
              nullable: true
              description: Traceback of the experiment
            duration_ms:
              type: integer
              nullable: true
              description: Duration of the experiment in milliseconds
            status:
              type: string
              maxLength: 64
              enum:
                - PENDING
                - IN_PROGRESS
                - COMPLETED
                - FAILED
                - CANCELLED
              description: Current status of the experiment
            created_by:
              $ref: '#/components/schemas/UserCompact'
            updated_by:
              $ref: '#/components/schemas/UserCompact'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            dataset:
              $ref: '#/components/schemas/DatasetCompact'
            application:
              $ref: '#/components/schemas/ApplicationCompact'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    CreateExperimentRequest:
      type: object
      title: Create Experiment Request
      description: Request body for creating an experiment
      required:
        - name
        - application_id
        - dataset_id
      properties:
        name:
          type: string
          maxLength: 256
          description: Name of the experiment
        description:
          type: string
          nullable: true
          maxLength: 512
          description: Description of the experiment
        metadata:
          type: object
          nullable: true
          description: JSONB field for unstructured metadata
          additionalProperties: true
          maxProperties: 10
          example:
            key1: value1
            key2: value2
        dataset_id:
          type: string
          format: uuid
          description: ID of the dataset used in this experiment
        application_id:
          type: string
          format: uuid
          description: ID of the application this experiment belongs to
    UpdateExperimentRequest:
      type: object
      title: Update Experiment Request
      description: Request body for updating an experiment
      properties:
        name:
          type: string
          nullable: true
          maxLength: 256
          description: Updated name of the experiment
        description:
          type: string
          nullable: true
          maxLength: 512
          description: Updated description of the experiment
        metadata:
          type: object
          nullable: true
          description: JSONB field for unstructured metadata
          additionalProperties: true
          maxProperties: 10
          example:
            key1: value1
            key2: value2
        status:
          type: string
          maxLength: 64
          enum:
            - IN_PROGRESS
            - COMPLETED
            - FAILED
            - CANCELLED
          description: Update experiment status
        error_reason:
          type: string
          nullable: true
          maxLength: 64
          description: Error reason of the experiment
        error_message:
          type: string
          nullable: true
          description: Error message of the experiment
        traceback:
          type: string
          nullable: true
          description: Traceback of the experiment
    ListExperimentsResponse:
      type: array
      items:
        $ref: '#/components/schemas/Experiment'
    EvalScore:
      type: object
      title: Evaluation Score
      description: Details of an evaluation score
      required:
        - application_id
        - experiment_id
        - dataset_id
        - dataset_item_id
        - evaluator_id
        - evaluator_name
        - score_name
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Unique identifier for the evaluation score.
        timestamp:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when the score was recorded.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when the score was created.
        application_id:
          type: string
          format: uuid
          description: ID of the application for which the evaluation score was computed.
        experiment_id:
          type: string
          format: uuid
          description: ID of the experiment this score is part of.
        dataset_id:
          type: string
          format: uuid
          description: ID of the dataset related to this score.
        dataset_item_id:
          type: string
          description: ID of the specific dataset item this score evaluates.
        evaluator_id:
          type: string
          format: uuid
          description: Unique identifier for the evaluator.
        evaluator_name:
          type: string
          description: Name of the evaluator.
        score_name:
          type: string
          description: Name of the score (e.g., "accuracy", "toxicity_score").
        score_value:
          type: number
          format: float
          nullable: true
          description: Floating-point value of the score, if applicable.
        score_label:
          type: string
          nullable: true
          description: String value of the score, if applicable.
        reasoning:
          type: string
          nullable: true
          description: Reasoning or explanation for the score.
    ListEvalScoresResponse:
      type: array
      items:
        $ref: '#/components/schemas/EvalScore'
    ExperimentItem:
      type: object
      title: Experiment Item
      description: Details of an experiment item
      required:
        - application_id
        - dataset_id
        - dataset_item_id
        - experiment_id
        - outputs
        - start_time
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Unique identifier for the experiment item.
        timestamp:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when the experiment item was created in the client/SDK.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when the experiment item was created in the backend.
        application_id:
          type: string
          format: uuid
          description: ID of the application the experiment belongs to.
        experiment_id:
          type: string
          format: uuid
          description: ID of the experiment this item is part of.
        dataset_id:
          type: string
          format: uuid
          description: ID of the dataset used for this experiment item.
        dataset_item_id:
          type: string
          description: ID of the specific dataset item this experiment item corresponds to.
        outputs:
          type: object
          description: >-
            JSON object representing the actual outputs generated by the
            experiment.
        start_time:
          type: string
          format: date-time
          description: Timestamp when the processing of this experiment item started.
        end_time:
          type: string
          format: date-time
          nullable: true
          description: >-
            Optional timestamp when the processing of this experiment item
            ended.
        duration:
          type: integer
          format: uint64
          nullable: true
          readOnly: true
          description: >-
            Duration of the experiment item processing in milliseconds (derived
            from end_time - start_time).
    CreateExperimentItemRequest:
      type: object
      title: New Experiment Item
      description: Request body for creating an experiment item
      required:
        - application_id
        - dataset_id
        - dataset_item_id
        - outputs
        - start_time
      properties:
        application_id:
          type: string
          format: uuid
          description: ID of the application the experiment belongs to.
        dataset_id:
          type: string
          format: uuid
          description: ID of the dataset used for this experiment item.
        dataset_item_id:
          type: string
          description: ID of the specific dataset item this experiment item corresponds to.
        outputs:
          type: object
          description: >-
            JSON object representing the actual outputs generated by the
            experiment.
        start_time:
          type: string
          format: date-time
          description: Timestamp when the processing of this experiment item started.
        end_time:
          type: string
          format: date-time
          nullable: true
          description: >-
            Optional timestamp when the processing of this experiment item
            ended.
    CreateExperimentResultsRequest:
      type: object
      title: Create Experiment Results Request
      description: Request body for uploading a batch of experiment results.
      required:
        - results
      properties:
        results:
          type: array
          description: Array of experiment results.
          items:
            $ref: '#/components/schemas/ExperimentItemResultPayload'
    ExperimentItemResultPayload:
      type: object
      title: Experiment Result Payload
      description: >-
        Payload for a single experiment result, containing an item and its
        scores.
      required:
        - experiment_item
        - scores
      properties:
        experiment_item:
          $ref: '#/components/schemas/ExperimentItemPayload'
        scores:
          type: array
          description: Array of new evaluation scores for this item.
          items:
            $ref: '#/components/schemas/EvalScorePayload'
    ExperimentItemPayload:
      type: object
      title: Experiment Item Payload in Experiment Results Request Payload
      description: Payload for a single experiment item in the experiment results request.
      required:
        - dataset_item_id
        - outputs
        - duration_ms
        - timestamp
        - status
      properties:
        id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Optional client-generated ID for the experiment item for
            idempotency.
        dataset_item_id:
          type: string
          description: ID of the specific dataset item this experiment item corresponds to.
        outputs:
          type: object
          description: >-
            JSON object representing the actual output generated by the
            experiment.
        duration_ms:
          type: integer
          format: uint32
          description: Duration of evaluation for the experiment item in milliseconds.
        timestamp:
          type: string
          format: date-time
          description: Timestamp when the experiment item was recorded on the client/SDK.
        status:
          type: string
          description: The status of the experiment item.
          enum:
            - SUCCESS
            - FAILED
            - SKIPPED
        error_reason:
          type: string
          nullable: true
          description: Reason for the error, if any.
        error_message:
          type: string
          nullable: true
          description: Detailed error message, if any.
    EvalScorePayload:
      type: object
      title: Eval Score Payload
      description: Details of a single new evaluation score for an experiment item.
      required:
        - evaluator_name
        - name
        - status
      properties:
        evaluator_name:
          type: string
          description: Name of the evaluator.
        name:
          type: string
          description: Name of the score (e.g., "accuracy", "toxicity_score").
        value:
          type: number
          format: float
          nullable: true
          description: Floating-point value of the score, if applicable.
        label:
          type: string
          nullable: true
          description: String value of the score, if applicable.
        reasoning:
          type: string
          nullable: true
          description: Reasoning or explanation for the score.
        status:
          type: string
          description: The status of evaluation for this score.
          enum:
            - SUCCESS
            - FAILED
            - SKIPPED
        error_reason:
          type: string
          nullable: true
          description: Reason for the error, if applicable.
        error_message:
          type: string
          nullable: true
          description: Message for the error, if applicable.
    ExperimentItemResult:
      type: object
      title: Experiment Item Result
      description: Details of evaluation results for an experiment item.
      required:
        - experiment_item_id
        - dataset_item_id
        - inputs
        - outputs
        - expected_outputs
        - scores
      properties:
        experiment_item_id:
          type: string
          format: uuid
          description: Unique identifier for the experiment item.
        dataset_item_id:
          type: string
          description: >-
            ID of the dataset item based on which this experiment result was
            computed.
        inputs:
          type: object
          description: JSON object representing the inputs for this experiment item.
        outputs:
          type: object
          description: >-
            JSON object representing the actual outputs generated by the
            experiment.
        expected_outputs:
          type: object
          description: >-
            JSON object representing the expected outputs for this experiment
            item.
        error_reason:
          type: string
          nullable: true
          description: Optional reason for any errors on experiment item level.
        error_message:
          type: string
          nullable: true
          description: Optional message for any errors on experiment item level.
        scores:
          type: array
          description: Array of evaluation scores for this item.
          items:
            $ref: '#/components/schemas/ExperimentResultScore'
    ExperimentResultScore:
      type: object
      title: Experiment Result Score
      description: Details of a single evaluation score for an experiment result.
      required:
        - score_id
        - evaluator_name
        - score_name
      properties:
        score_id:
          type: string
          format: uuid
          description: Unique identifier for the score.
        evaluator_name:
          type: string
          description: Name of the evaluator that produced this score.
        score_name:
          type: string
          description: Name of the score (e.g., "accuracy", "toxicity_score").
        score_label:
          type: string
          nullable: true
          description: String value of the score, if applicable.
        score_value:
          type: number
          format: float
          nullable: true
          description: Floating-point value of the score, if applicable.
        reasoning:
          type: string
          nullable: true
          description: Reasoning or explanation for the score.
        error_reason:
          type: string
          nullable: true
          description: Optional reason for errors during evaluation of score.
        error_message:
          type: string
          nullable: true
          description: Optional message for errors during evaluation of score.
    ListExperimentResultsResponse:
      allOf:
        - $ref: '#/components/schemas/PaginatedApiResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                experiment_id:
                  type: string
                  format: uuid
                  description: ID of the experiment this result is part of.
                dataset_id:
                  type: string
                  format: uuid
                  description: >-
                    ID of the dataset based on which this experiment result was
                    computed.
                items:
                  type: array
                  items:
                    $ref: '#/components/schemas/ExperimentItemResult'
    HistogramBin:
      type: object
      title: Histogram Bin
      description: >
        A single equal-width bin in a numeric-range evaluator histogram. `low`
        and `high` are the inclusive lower and exclusive upper bin edges. `mean`
        and `stddev` are computed over the scores that fall in this bin.
      required:
        - low
        - high
        - count
        - mean
        - stddev
      properties:
        low:
          type: number
          format: double
          description: Lower edge of the bin (inclusive).
          example: 0
        high:
          type: number
          format: double
          description: Upper edge of the bin (exclusive, except for the last bin).
          example: 0.1
        count:
          type: integer
          minimum: 0
          description: Number of scores that fall within this bin.
          example: 12
        mean:
          type: number
          format: double
          description: Mean score value for scores within this bin.
          example: 0.053
        stddev:
          type: number
          format: double
          minimum: 0
          description: Population standard deviation of scores within this bin.
          example: 0.028
    DistributionBucket:
      type: object
      title: Distribution Bucket
      description: >
        A single bucket in a categorical or numeric-categorical evaluator
        distribution. `label` is the display string (the score value cast to
        string, or the score label). `ratio` is the fraction of total scored
        items that fall in this bucket.
      required:
        - label
        - count
        - ratio
      properties:
        label:
          type: string
          description: >-
            Display label for this bucket (stringified score value or score
            label).
          example: positive
        count:
          type: integer
          minimum: 0
          description: Number of scores with this value/label.
          example: 34
        ratio:
          type: number
          format: double
          minimum: 0
          maximum: 1
          description: Fraction of total scored items represented by this bucket.
          example: 0.68
    EvaluatorMetricBase:
      type: object
      title: Evaluator Metric Base
      description: Fields common to all evaluator metric types.
      required:
        - evaluator_name
        - score_name
        - type
        - count
        - error_count
        - mean
      properties:
        evaluator_name:
          type: string
          description: Name of the evaluator.
          example: coherence
        score_name:
          type: string
          description: >
            Name of the specific score within the evaluator. For single-score
            evaluators this equals evaluator_name. For multi-score evaluators
            like ftl_prompt_safety, each sub-score (e.g. jailbreak_prob,
            illegal_prob) gets its own entry.
          example: coherence
        type:
          type: string
          description: >
            Auto-detected type of the evaluator output. `numeric_range` —
            continuous numeric scores with >10 distinct values (rendered as
            histogram). `numeric_categorical` — discrete numeric scores with
            <=10 distinct values (rendered as distribution bars). `categorical`
            — string label scores (rendered as distribution bars).
          enum:
            - numeric_range
            - numeric_categorical
            - categorical
        count:
          type: integer
          minimum: 0
          description: Total number of scored items for this evaluator.
          example: 50
        error_count:
          type: integer
          minimum: 0
          description: Number of items where the evaluator returned a non-SUCCESS status.
          example: 2
        mean:
          type: number
          format: double
          nullable: true
          description: >
            Mean numeric score across all items. Null for purely categorical
            evaluators that have no numeric score value.
          example: 0.762
    NumericRangeEvaluatorMetric:
      title: Numeric Range Evaluator Metric
      description: >
        Evaluator metric for continuous numeric scores (>10 distinct values).
        Includes an equal-width histogram with up to 10 bins.
      allOf:
        - $ref: '#/components/schemas/EvaluatorMetricBase'
        - type: object
          properties:
            type:
              type: string
              enum:
                - numeric_range
            histogram:
              type: array
              maxItems: 10
              description: >
                Equal-width histogram bins covering the full score range. Always
                has at most 10 bins. Bins are ordered by ascending `low` edge.
              items:
                $ref: '#/components/schemas/HistogramBin'
          required:
            - type
            - histogram
    CategoricalEvaluatorMetric:
      title: Categorical Evaluator Metric
      description: >
        Evaluator metric for categorical or discrete-numeric scores. Includes a
        value distribution ordered by descending count.
      allOf:
        - $ref: '#/components/schemas/EvaluatorMetricBase'
        - type: object
          properties:
            type:
              type: string
              enum:
                - numeric_categorical
                - categorical
            distribution:
              type: array
              description: |
                Per-value bucket counts and ratios, ordered by descending count.
              items:
                $ref: '#/components/schemas/DistributionBucket'
          required:
            - type
            - distribution
    EvaluatorMetric:
      title: Evaluator Metric
      description: >
        Per-evaluator aggregate metrics. The shape of the object is determined
        by the `type` discriminator field: - `numeric_range` →
        `NumericRangeEvaluatorMetric` (contains `histogram`) -
        `numeric_categorical` → `CategoricalEvaluatorMetric` (contains
        `distribution`) - `categorical` → `CategoricalEvaluatorMetric` (contains
        `distribution`)
      oneOf:
        - $ref: '#/components/schemas/NumericRangeEvaluatorMetric'
        - $ref: '#/components/schemas/CategoricalEvaluatorMetric'
    ExperimentMetricsResponse:
      type: object
      title: Experiment Metrics Response
      description: Aggregate metrics for all evaluators in an experiment.
      required:
        - total_evaluators
        - total_scores
        - total_items
        - evaluators
      properties:
        total_evaluators:
          type: integer
          minimum: 0
          description: >
            Number of distinct evaluator names in this experiment. For
            multi-score evaluators, this counts the evaluator once regardless of
            how many sub-scores it produces.
          example: 3
        total_scores:
          type: integer
          minimum: 0
          description: >
            Total number of (evaluator_name, score_name) entries in the
            evaluators array. For single-score evaluators this equals
            total_evaluators. For multi-score evaluators this is higher.
          example: 5
        total_items:
          type: integer
          minimum: 0
          description: >
            Total number of scored experiment items (taken as the maximum item
            count across all evaluators).
          example: 50
        evaluators:
          type: array
          description: >
            Ordered list of per-evaluator metrics. Empty when no scores have
            been recorded yet.
          items:
            $ref: '#/components/schemas/EvaluatorMetric'
    EvaluatorFlag:
      type: object
      title: Evaluator Flag
      description: >
        A single evaluator's score for a specific experiment row, including the
        numeric value (if applicable), string label (if applicable), and any
        reasoning produced by the evaluator.
      required:
        - evaluator_name
        - score_name
        - value
        - label
        - reasoning
      properties:
        evaluator_name:
          type: string
          description: Name of the evaluator that produced this flag.
          example: coherence
        score_name:
          type: string
          description: >
            Name of the specific score within the evaluator. For single-score
            evaluators this equals evaluator_name.
          example: coherence
        value:
          type: number
          format: double
          nullable: true
          description: Numeric score value, or null for label-only evaluators.
          example: 0.95
        label:
          type: string
          nullable: true
          description: >-
            String label produced by the evaluator, or null for numeric-only
            evaluators.
          example: positive
        reasoning:
          type: string
          nullable: true
          description: Free-text reasoning or explanation from the evaluator, if available.
          example: The response is highly coherent and on-topic.
    OutlierRow:
      type: object
      title: Outlier Row
      description: >
        A row flagged as an outlier by one or more evaluators, including the
        row's inputs and the evaluator flags that triggered the detection.
      required:
        - experiment_item_id
        - dataset_item_id
        - inputs
        - flags
      properties:
        experiment_item_id:
          type: string
          format: uuid
          description: Unique identifier for the experiment item.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        dataset_item_id:
          type: string
          description: ID of the dataset item this row corresponds to.
          example: ds-item-001
        inputs:
          type: object
          description: >
            Free-form JSON object containing the inputs for this experiment item
            (e.g., question, context, prompt).
          additionalProperties: true
          example:
            question: What is Python?
        flags:
          type: array
          minItems: 1
          description: Per-evaluator scores and reasoning for this row.
          items:
            $ref: '#/components/schemas/EvaluatorFlag'
    ExperimentRowMetricsResponse:
      type: object
      title: Experiment Row Metrics Response
      description: >
        Top and bottom performing rows identified via percentile-based outlier
        detection. Numeric evaluators use P10/P90 thresholds; categorical
        evaluators flag labels that differ from the mode. Rows are ranked by how
        many evaluators flagged them as outliers. At most 3 rows are returned in
        each list.
      required:
        - top
        - bottom
      properties:
        top:
          type: array
          description: >
            Up to 3 rows with the highest number of above-P90 evaluator scores,
            ordered by descending outlier count.
          maxItems: 3
          items:
            $ref: '#/components/schemas/OutlierRow'
        bottom:
          type: array
          description: >
            Up to 3 rows with the highest number of below-P10 evaluator scores
            or non-mode categorical labels, ordered by descending outlier count.
          maxItems: 3
          items:
            $ref: '#/components/schemas/OutlierRow'
    InferCategoriesResponse:
      type: object
      description: Unique category values inferred from model data
      required:
        - data_type
        - categories
      properties:
        data_type:
          type: string
          description: Data type designation for the categories
          enum:
            - CATEGORY
          example: CATEGORY
        categories:
          type: array
          description: Array of unique category values found in the data
          items:
            oneOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
          example:
            - France
            - Germany
            - Spain
    FetchSliceDataRequestBody:
      type: object
      required:
        - model_id
        - env_type
        - offset
      properties:
        model_id:
          type: string
          format: uuid
          description: Unique identifier of a model
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
          description: Type of data to use for analysis
        env_id:
          nullable: true
          type: string
          format: uuid
          description: Unique identifier of PRE-PRODUCTION environments
        segment:
          $ref: '#/components/schemas/SegmentCompact'
        time_filter:
          $ref: '#/components/schemas/TimeFilter'
        column_names:
          nullable: true
          type: array
          items:
            type: string
          description: the column names to fetch. If not specified, all columns are fetched
        num_samples:
          type: integer
          description: the maximum number of rows to fetch in total
          default: 100
          minimum: 1
          maximum: 1000
        offset:
          type: integer
          description: number of rows to skip
          minimum: 0
          maximum: 999
        page_size:
          type: integer
          description: the maximum number of rows for the page
          default: 10
          minimum: 1
        fetch_vectors:
          type: boolean
          default: false
          description: >-
            whether to fetch vector columns or not, in the case column_names is
            not specified
        data_integrity_filter:
          $ref: '#/components/schemas/DataIntegrityFilter'
    FetchSliceDataResponse:
      properties:
        column_names:
          description: Column names corresponding for the rows
          type: array
          items:
            type: string
          example:
            - Country
            - index
            - Has a Bike
            - Age
        column_types:
          type: array
          items:
            $ref: '#/components/schemas/ColumnsDataTypeEnum'
        items:
          description: Rows of data
          type: array
          items:
            type: array
            items:
              anyOf:
                - type: integer
                - type: number
                - type: string
                - type: object
                - type: boolean
          example:
            - - France
              - 2.7
              - false
              - 30
            - - US
              - 1.8
              - true
              - 28
        data_integrity:
          description: List of data integrity per row
          type: array
          items:
            type: array
            items:
              $ref: '#/components/schemas/DataIntegrityResult'
        has_vectors:
          description: Indicated whether the model has vector columns or not
          type: boolean
    DownloadSliceDataRequestBody:
      required:
        - model_id
        - env_type
      properties:
        model_id:
          type: string
          format: uuid
          description: Unique identifier of a model
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
          description: Type of data to use for analysis
        env_id:
          nullable: true
          type: string
          format: uuid
          description: Unique identifier of PRE-PRODUCTION environments
        segment:
          $ref: '#/components/schemas/SegmentCompact'
        time_filter:
          $ref: '#/components/schemas/TimeFilter'
        column_names:
          nullable: true
          type: array
          items:
            type: string
          description: the column names to fetch. If not specified, all columns are fetched
        num_samples:
          type: integer
          description: the maximum number of rows to fetch in total
          default: 1000
          minimum: 1
          maximum: 10000000
        chunk_size:
          type: integer
          description: chunk size to fetch the data
          default: 1000
        fetch_vectors:
          type: boolean
          default: false
          description: >-
            whether to fetch vector columns or not, in the case column_names is
            not specified
        csv:
          type: boolean
          default: false
          description: >-
            whether to download the dat to a CSV file. If not, the data is
            downloaded as a Parquet file, which is more efficient for large
            amount of data
        data_integrity_filter:
          $ref: '#/components/schemas/DataIntegrityFilter'
    CorrelationMatrixRequestBody:
      type: object
      required:
        - model_id
        - env_type
        - column_names
      properties:
        model_id:
          type: string
          format: uuid
          description: Unique identifier of a model
        column_names:
          type: array
          maxItems: 8
          items:
            type: string
          description: list of column names for matrix correlation
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
          description: Type of data to use for analysis
        env_id:
          nullable: true
          type: string
          format: uuid
          description: Unique identifier of PRE-PRODUCTION environments
        segment:
          $ref: '#/components/schemas/SegmentCompact'
        time_filter:
          $ref: '#/components/schemas/TimeFilter'
    CorrelationMatrixResponse:
      type: object
      properties:
        matrix:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: number
          description: Correlation matrix
          example:
            feature_1:
              feature_1: 1
              feature_2: 0.53
              feature_3: -0.08
            actual_label_2:
              feature_1: 0.53
              feature_2: 1
              feature_3: 0.007
            actual_label_3:
              predicted_label_1: -0.08
              predicted_label_2: 0.007
              predicted_label_3: 1
    CorrelationRequestBody:
      type: object
      required:
        - model_id
      properties:
        model_id:
          type: string
          format: uuid
          description: Unique identifier of a model
        column_names:
          type: array
          items:
            type: string
          description: list of 2 column names for analysis (mandatory for Analytics Charts)
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
          description: Type of data to use for analysis (mandatory for Analytics Charts)
        env_id:
          nullable: true
          type: string
          format: uuid
          description: Unique identifier of PRE-PRODUCTION environments
        segment:
          $ref: '#/components/schemas/SegmentCompact'
        time_filter:
          $ref: '#/components/schemas/TimeFilter'
        slice_query:
          type: string
          description: slice query (For Analyze page only)
        x_column_name:
          type: string
          description: column name for x axis (For Analyze page only)
        y_column_name:
          type: string
          description: column name for y axis (For Analyze page only)
        num_samples:
          type: integer
          minimum: 1
          maximum: 10000
          description: Number of samples to use (For Analyze page only)
        num_bins:
          type: integer
          minimum: 1
          maximum: 1000
          description: Number of bins for the line plot ((For Analyze page only)
    CorrelationScatterLineResponse:
      type: object
      properties:
        response_type:
          type: string
          enum:
            - SCATTER_LINE_PLOT
        scatter:
          type: array
          items:
            type: array
            items:
              type: integer
          example:
            - - 43
              - 43
            - - 36
              - 36
        line:
          type: array
          items:
            type: array
            items:
              type: number
          example:
            - - 18
              - 18
            - - 20
              - 20
        config:
          type: object
          properties:
            visualization:
              description: Preferred type of visualization for feature correlation
              type: string
              enum:
                - LINE_PLOT
                - SCATTER_PLOT
            x_axis_column:
              type: string
              description: Column name to use as the x-axis in the chart
            axis_interchangeable:
              type: boolean
              description: >-
                Whether or not the axis / column representation, can be swapped
                in the chart
    CorrelationBoxResponse:
      type: object
      properties:
        response_type:
          type: string
          enum:
            - BOX_PLOT
        box:
          type: array
          items:
            type: array
            items:
              anyOf:
                - type: string
                - type: number
          example:
            - - France
              - 19
              - 31
              - 37
              - 44
              - 78
            - - Germany
              - 18
              - 33
              - 39
              - 47
              - 75
            - - Spain
              - 18
              - 31
              - 38
              - 45
              - 72
        config:
          type: object
          properties:
            visualization:
              description: Preferred type of visualization for feature correlation
              type: string
              enum:
                - BOX_PLOT
            x_axis_column:
              type: string
              description: Column name to use as the x-axis in the chart
            axis_interchangeable:
              type: boolean
              description: >-
                Whether or not the axis / column representation, can be swapped
                in the chart
    CorrelationStackedResponse:
      type: object
      properties:
        response_type:
          type: string
          enum:
            - STACKED_PLOT
        stacked:
          type: array
          items:
            type: array
            items:
              anyOf:
                - type: string
                - type: number
          example:
            - - France
              - France
              - 470
            - - Germany
              - Germany
              - 266
            - - Spain
              - Spain
              - 240
        config:
          type: object
          properties:
            visualization:
              description: Preferred type of visualization for feature correlation
              type: string
              enum:
                - STACKED_PLOT
            x_axis_column:
              type: string
              description: Column name to use as the x-axis in the chart
            axis_interchangeable:
              type: boolean
              description: >-
                Whether or not the axis / column representation, can be swapped
                in the chart
    FeatureDistributionRequestBody:
      type: object
      required:
        - model_id
        - column_name
      properties:
        model_id:
          type: string
          format: uuid
          description: Unique identifier of a model
        column_name:
          type: string
          description: Name of the column to get distribution on
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
          description: Type of data to use for analysis (mandatory for Analytics Charts)
        env_id:
          nullable: true
          type: string
          format: uuid
          description: Unique identifier of PRE-PRODUCTION environments
        segment:
          $ref: '#/components/schemas/SegmentCompact'
        time_filter:
          $ref: '#/components/schemas/TimeFilter'
        num_bins:
          type: integer
          minimum: 1
          maximum: 1000
          description: Number of bins for feature distribution
        slice_query:
          type: string
          description: slice query (For Analyze page only)
    FeatureDistributionKDEHistResponse:
      type: object
      properties:
        response_type:
          type: string
          enum:
            - KERNEL_DENSITY_HISTOGRAM
        kernel_density:
          type: array
          items:
            type: array
            items:
              type: number
          example:
            - - 17.5
              - 0
            - - 18.5
              - 0.002
        histogram:
          type: array
          items:
            type: array
            items:
              type: number
          example:
            - - 19
              - 20
              - 5
            - - 20
              - 21
              - 2
        config:
          $ref: '#/components/schemas/FeatureDistributionConfig'
    FeatureDistributionHistogramResponse:
      type: object
      properties:
        response_type:
          type: string
          enum:
            - HISTOGRAM
        histogram:
          type: array
          items:
            type: array
            items:
              anyOf:
                - type: string
                - type: number
          example:
            - - France
              - 470
            - - Germany
              - 266
            - - Spain
              - 240
        config:
          $ref: '#/components/schemas/FeatureDistributionConfig'
    ParseSliceQueryRequestBody:
      type: object
      required:
        - model_id
        - query
      properties:
        model_id:
          type: string
          format: uuid
        query:
          type: string
    ParseSliceQueryResponseBody:
      type: object
      required:
        - environment_name
        - is_prod
        - is_slice
        - model_name
        - table_name
      properties:
        environment_name:
          type: string
        is_prod:
          type: boolean
        is_slice:
          type: boolean
        model_name:
          type: string
        table_name:
          type: string
    FetchSliceQueryRequestBody:
      type: object
      required:
        - model_id
        - query
      properties:
        model_id:
          type: string
          format: uuid
        query:
          type: string
        sample:
          type: boolean
        max_rows:
          type: integer
          minimum: 1
          maximum: 10000
        columns:
          type: array
          items:
            type: string
    FetchSliceQueryResponseMetadata:
      type: object
      properties:
        is_slice:
          type: boolean
        columns:
          type: array
          items:
            type: string
        dtypes:
          type: array
          items:
            type: string
        env:
          $ref: '#/components/schemas/EnvironmentCompact'
        model:
          $ref: '#/components/schemas/ModelCompact'
    FetchSliceQueryResponse:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/FetchSliceQueryResponseMetadata'
        rows:
          type: array
          items:
            type: array
            items:
              anyOf:
                - type: string
                - type: integer
                - type: boolean
                - type: object
                - type: number
    DependencePlotRequestBody:
      type: object
      required:
        - model_id
        - reference_data_source
        - input_data_source
        - inputs
        - output_column
      properties:
        model_id:
          type: string
          format: uuid
        input_data_source:
          $ref: '#/components/schemas/DependencePlotInputDataSource'
        reference_data_source:
          $ref: '#/components/schemas/DependencePlotReferenceDataSource'
        inputs:
          type: array
          items:
            type: string
          description: List of features we want to compute dependence plots on.
        output_column:
          type: string
          description: Name of the output class we want to compute dependence plots on.
        plot_type:
          type: string
          enum:
            - PDP
            - ICE
          description: >-
            Either ICE or PDP. Predictions are averaged if plot type is PDP.
            Defaults to ICE.
        grid_resolution:
          type: integer
          description: >-
            number of values in the grid for numeric features i.e. number of
            points we want to plot. This value will be overridden for
            categorical variables, where the number of values will be equal to
            the number of categories.
          minimum: 1
          maximum: 10000
        ci_level:
          type: number
          description: >-
            The confidence level (between 0 and 1) to use for all confidence
            intervals computed
          minimum: 0
          maximum: 1
    DependencePlotReferenceDataSource:
      type: object
      properties:
        source_type:
          type: string
          enum:
            - ENVIRONMENT
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
        env_id:
          type: string
          format: uuid
          nullable: true
          description: Environment id, required for PRE_PRODUCTION env_type
        num_samples:
          type: integer
          description: Number of rows to retrieve
          minimum: 1
          maximum: 10000
    DependencePlotInputDataSource:
      oneOf:
        - $ref: '#/components/schemas/DependencePlotInputEnvDataSource'
        - $ref: '#/components/schemas/DependencePlotInputSqlSliceQueryDataSource'
        - $ref: '#/components/schemas/DependencePlotInputEventIdDataSource'
        - $ref: '#/components/schemas/DependencePlotInputRawDataDataSource'
    DependencePlotInputEnvDataSource:
      type: object
      properties:
        source_type:
          type: string
          enum:
            - ENVIRONMENT
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
        env_id:
          type: string
          format: uuid
          nullable: true
          description: Environment id, required for PRE_PRODUCTION env_type
        num_samples:
          type: integer
          description: Number of rows to retrieve
          minimum: 1
          maximum: 10000
    DependencePlotInputSqlSliceQueryDataSource:
      type: object
      properties:
        source_type:
          type: string
          enum:
            - SQL_SLICE_QUERY
        query:
          type: string
          description: SQL query
        num_samples:
          type: integer
          description: Number of rows to retrieve
          minimum: 1
          maximum: 10000
    DependencePlotInputEventIdDataSource:
      type: object
      properties:
        source_type:
          type: string
          enum:
            - EVENT_ID
        event_id:
          type: string
          description: event ID of the row to fetch forming the input dataset
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
        env_id:
          type: string
          format: uuid
          nullable: true
          description: Environment id, required for PRE_PRODUCTION env_type
    DependencePlotInputRawDataDataSource:
      type: object
      properties:
        source_type:
          type: string
          enum:
            - ROWS
        rows:
          type: array
          items:
            type: object
          description: list of dictionaries specifying data for the input_df
        num_samples:
          type: integer
          description: Number of rows to consider
          minimum: 1
          maximum: 10000
    DependencePlotResponse:
      type: object
      properties:
        plot_type:
          type: string
          enum:
            - PDP
            - ICE
        output_column:
          type: string
        columns:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DependencePlot'
    DependencePlot:
      type: object
      properties:
        central_tendency:
          type: array
          items:
            type: number
          example:
            - 0.04
            - 0.002
            - 0.1
        confidence_intervals:
          type: array
          items:
            type: number
          example:
            - 0.007
            - 0.02
            - 0.08
        grid:
          type: array
          items:
            type: number
          example:
            - 427
            - 568
            - 709
            - 850
        predictions:
          type: array
          items:
            type: number
          example:
            - 0.25543349849002067
            - 0.22185671902183196
            - 0.21882196458436376
            - 0.22168418439383217
    ExplainRequestBody:
      type: object
      required:
        - model_id
        - input_data_source
      properties:
        model_id:
          type: string
          format: uuid
        ref_data_source:
          $ref: '#/components/schemas/ExplainReferenceDataSource'
        input_data_source:
          $ref: '#/components/schemas/ExplainInputDataSource'
        explanation_type:
          type: string
          enum:
            - FIDDLER_SHAP
            - SHAP
            - IG
            - MEAN_RESET
            - ZERO_RESET
            - PERMUTE
            - YOUR_CUSTOM_EXPLANATION_NAME
          description: Explanation method
        num_permutations:
          type: integer
          minimum: 1
          maximum: 10000
          description: >-
            For Fiddler SHAP, that corresponds to the number of coalitions to
            sample to estimate the Shapley values of each single-reference game.
            For the permutation algorithms, this corresponds to the number of
            permutations from the dataset to use for the computation.
          example: 500
        ci_level:
          type: number
          description: >-
            The confidence interval level (between 0 and 1) to use for Fiddler
            SHAP
          example: 0.95
          minimum: 0
          maximum: 1
        top_n_class:
          type: integer
          description: >-
            For multiclass classification models only, specifying if only the n
            top classes are computed or all classes (when parameter is None)
          example: 3
          minimum: 1
        generate_text_description:
          type: boolean
          description: Boolean to generate Text description (for UI)
    ExplainInputDataSource:
      oneOf:
        - $ref: '#/components/schemas/ExplainInputRowDataSource'
        - $ref: '#/components/schemas/ExplainInputEventIdDataSource'
    ExplainInputRowDataSource:
      type: object
      required:
        - row
        - source_type
      properties:
        source_type:
          type: string
          enum:
            - ROW
        row:
          type: object
          example:
            CreditScore: 619
            Geography: France
            Gender: Female
            Age: 42
            Tenure: 2
            Balance: 0
            NumOfProducts: 1
            HasCrCard: 'Yes'
            IsActiveMember: 'Yes'
            EstimatedSalary: 101348.88
          description: >-
            Single row to explain in dictionary format, with keys the feature
            names and values the associated values.
    ExplainInputEventIdDataSource:
      type: object
      required:
        - event_id
        - source_type
        - env_type
      properties:
        source_type:
          type: string
          enum:
            - EVENT_ID
        event_id:
          type: string
          description: Fiddler ID of the row to be explained
        env_id:
          type: string
          format: uuid
          description: uuid of Environment where the event ID is from
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
    ExplainReferenceDataSource:
      oneOf:
        - $ref: '#/components/schemas/ExplainReferenceEnvSource'
        - $ref: '#/components/schemas/ExplainReferenceSliceQueryDataSource'
    ExplainReferenceEnvSource:
      type: object
      required:
        - source_type
        - env_type
      properties:
        source_type:
          type: string
          enum:
            - ENVIRONMENT
        env_id:
          type: string
          format: uuid
          description: Env uuid
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
        num_samples:
          type: integer
          description: Number of rows to retrieve for reference dataset
          example: 200
          minimum: 1
          maximum: 1000000
    ExplainReferenceSliceQueryDataSource:
      type: object
      required:
        - source_type
        - query
      properties:
        source_type:
          type: string
          enum:
            - SQL_SLICE_QUERY
        query:
          type: string
          description: SQL query
        num_samples:
          type: integer
          description: Number of rows to retrieve for reference dataset
          example: 200
          minimum: 1
          maximum: 1000000
    ExplainResponse:
      type: object
      properties:
        explanation_ci_level:
          type: number
          example: 0.95
        explanation_type:
          type: string
          example: FIDDLER_SHAP
        num_permutations:
          type: integer
          example: 300
        num_refs:
          type: integer
          example: 200
        explanations:
          type: object
          additionalProperties:
            type: object
            properties:
              model_prediction:
                type: number
                example: 0.40507
              baseline_prediction:
                type: number
                example: 0.175291
              GEM:
                type: object
                properties:
                  type:
                    type: string
                    example: container
                  content:
                    type: array
                    example:
                      - type: simple
                        feature_name: CreditScore
                        value: 619
                        attribution: -0.08369918667452322
                        attribution-uncertainty: 0.17771162663751516
                      - type: simple
                        feature_name: Geography
                        value: France
                        attribution: 0.06518146363651527
                        attribution-uncertainty: 0.10341287070782923
                    items:
                      type: object
                  attribution:
                    type: number
                    example: 0.220791
    FeatureImpactRequestBody:
      type: object
      description: Feature Impact api request body
      required:
        - data_source
        - model_id
      properties:
        data_source:
          $ref: '#/components/schemas/FeatureImpactDataSource'
        model_id:
          type: string
          format: uuid
          description: Unique ID of model.
        num_refs:
          type: integer
          description: >-
            Number of reference points used in the explanations. Only for non
            text inputs
          minimum: 1
          maximum: 1000000
        num_iterations:
          type: integer
          description: >-
            The maximum number of ablated model inferences *per feature*. Only
            for non text inputs
          minimum: 1
          maximum: 100000
        ci_level:
          type: number
          description: >-
            The confidence interval level (between 0 and 1) to use for all
            confidence intervals computed. Only for non text inputs
          minimum: 0
          maximum: 1
        min_support:
          type: integer
          description: >-
            Specify a minimum support to retrieve top words. Only for Text data
            (NLP models)
          minimum: 1
        output_columns:
          type: array
          items:
            type: string
          description: >-
            Only used for NLP (TEXT inputs) models. Output column names to
            compute feature impact on. If None, use all.
        ref_env_id:
          type: string
          format: uuid
          description: environment to use for the reference dataset.
    UploadFeatureImpactTabularRequestBody:
      type: object
      description: User uploaded Feature Impact api request body
      required:
        - model_id
        - feature_impact_map
      properties:
        model_id:
          type: string
          format: uuid
          description: Unique ID of model.
        feature_impact_map:
          description: >-
            Feature impacts dictionary with feature name as key and impact as
            value
          type: object
          additionalProperties:
            type: number
            format: float
          example:
            feature_1: 0.123
            feature_2: -0.012
            feature_n: 0.0345
    FeatureImpactDataSource:
      description: Feature Impact api data sources
      oneOf:
        - $ref: '#/components/schemas/FeatureImpactEnvDataSource'
        - $ref: '#/components/schemas/FeatureImpactSliceQueryDataSource'
        - $ref: '#/components/schemas/FeatureImpactFqlDataSource'
    FeatureImpactEnvDataSource:
      type: object
      description: Feature Impact api dataset data source
      required:
        - source_type
        - env_type
      properties:
        source_type:
          type: string
          enum:
            - ENVIRONMENT
          description: Environment data source type.
        env_id:
          type: string
          format: uuid
          description: Unique identifier of environment.
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
          description: Type of environment. Either PRE_PRODUCTION or PRODUCTION.
        num_samples:
          type: integer
          description: Number of input points explained.
          minimum: 1
          maximum: 1000000
    FeatureImpactSliceQueryDataSource:
      type: object
      description: Feature Impact api SQL slice query data source
      required:
        - source_type
        - query
      properties:
        source_type:
          type: string
          enum:
            - SQL_SLICE_QUERY
          description: Sql query data source type.
        query:
          type: string
          description: SQL query
        num_samples:
          type: integer
          description: Number of input points explained.
          minimum: 1
          maximum: 1000000
    FeatureImpactFqlDataSource:
      type: object
      description: Feature Impact api FQL data source
      required:
        - source_type
        - env_type
      properties:
        source_type:
          type: string
          enum:
            - FQL
          description: FQL data source type.
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
          description: Type of environment. Either PRE_PRODUCTION or PRODUCTION.
        env_id:
          type: string
          format: uuid
          description: Unique identifier of environment.
        slice_definition:
          type: string
          description: FQL definition.
        time_filter:
          $ref: '#/components/schemas/TimeFilter'
        num_samples:
          type: integer
          description: Number of input points explained
          minimum: 1
          maximum: 1000000
    FeatureImpactResponse:
      description: Feature Impact api response (text or tabular).
      oneOf:
        - $ref: '#/components/schemas/FeatureImpactTextResponse'
        - $ref: '#/components/schemas/FeatureImpactTabularResponse'
        - $ref: '#/components/schemas/UploadFeatureImpactTabularResponse'
    FeatureImpactTabularResponse:
      type: object
      description: Feature Impact Tabular api response.
      properties:
        response_type:
          type: string
          enum:
            - FEATURE_IMPACT_TABULAR
        model_task:
          type: string
          description: Task the model is designed to address.
        model_input_type:
          type: string
          description: Input type of model.
        ci_level:
          type: number
          example: 0.9
          description: The confidence level (between 0 and 1).
        feature_names:
          type: array
          items:
            type: string
          example:
            - CreditScore
            - Geography
            - Age
          description: >-
            Names of the features as inferred from the points used in
            explanation.
        fixed_sample_ci:
          type: array
          items:
            type: number
          example:
            - 0.04
            - 0.002
            - 0.1
          description: >-
            Confidence interval when we consider our points fixed and only the
            ablation as random. If n_cycles == 1, this is None. This is a tuple
            with the ith entry corresponding to the feature impact fixed sample
            CI of the ith feature.
        num_inputs:
          type: integer
          example: 3100
          description: Number of input points explained.
        num_refs:
          type: integer
          example: 500
          description: The number of points used as the reference sample.
        random_sample_ci:
          type: array
          items:
            type: number
          example:
            - 0.024
            - 0.0204
            - 0.0246
          description: >-
            Confidence interval when we consider our feature importance measure
            as an estimate of a single point sampled randomly. This is a tuple
            with the ith entry corresponding to the feature impact random sample
            CI of the ith feature.
        mean_abs_prediction_change_impact:
          type: array
          items:
            type: number
          example:
            - 0.01628
            - 0.0456
            - 0.01728
          description: >-
            Feature impact as  measured by average absolute change in prediction
            when a given feature is randomly ablated. This is a tuple with the
            ith entry corresponding to the feature impact value of the ith
            feature.
        mean_prediction_ci:
          type: number
          example: 0.00484
          description: Random-sample CI for the mean prediction.
        mean_prediction:
          type: number
          example: 0.2063
          description: The mean prediction over the explained points.
        num_iterations:
          type: integer
          example: 200
          description: The maximum number of ablated model inferences *per feature*.
        env_name:
          type: string
          example: bank_churn
          description: Name of the environment.
        env_uuid:
          type: string
          example: bcb8e333-39d1-4ba5-a485-dec1591f7122
          description: Unique identifier of environment.
        created_at:
          type: string
          example: 2023-12-12T18:21:07.616Z
          description: Created at time stamp.
        feature_impact_scores:
          type: array
          items:
            type: number
          example:
            - 0.01628
            - 0.0456
            - 0.01728
          description: >-
            A copy of mean_abs_prediction_change_impact. To maintain parity in
            keys for UI in precomputed endpoint.
    FeatureImpactTextResponse:
      type: object
      description: Feature Impact Text api response
      properties:
        response_type:
          type: string
          enum:
            - FEATURE_IMPACT_TEXT
        model_task:
          type: string
          description: Task the model is designed to address.
        model_input_type:
          type: string
          description: Input type of model.
        output_name:
          type: string
          example: sentiment
          description: Name of the output.
        tokens:
          type: object
          description: Table of delta-prob, support and Word
        min_support:
          type: integer
          example: 15
          description: Min support to retrieve top words.
        num_inputs:
          type: integer
          example: 200
          description: Number of input points explained.
        env_name:
          type: string
          example: bank_churn
          description: Name of the environment.
        env_uuid:
          type: string
          example: bcb8e333-39d1-4ba5-a485-dec1591f7122
          description: Unique identifier of environment.
        created_at:
          type: string
          example: 2023-12-12T18:21:07.616Z
          description: Created at time stamp.
    UploadFeatureImpactTabularResponse:
      type: object
      description: Response for customer generated feature impacts for the given model.
      properties:
        response_type:
          type: string
          enum:
            - FEATURE_IMPACT_TABULAR_UPLOADED
        feature_names:
          type: array
          items:
            type: string
          example:
            - CreditScore
            - Geography
            - Age
          description: >-
            Names of the features as inferred from the points used in
            explanation.
        feature_impact_scores:
          type: array
          items:
            type: number
          example:
            - 0.01628
            - 0.0456
            - -0.01728
          description: Directional(+ve or -ve) feature impact score as input by user.
        system_generated:
          type: boolean
          description: >-
            Boolean flag identifier indicating that the feature impact was
            computed or user uploaded.
    FeatureImportanceRequestBody:
      type: object
      required:
        - data_source
        - model_id
      properties:
        data_source:
          $ref: '#/components/schemas/FeatureImportanceDataSource'
        model_id:
          type: string
          format: uuid
        num_refs:
          type: integer
          description: Number of reference points used in the explanations
          minimum: 1
          maximum: 1000000
        num_iterations:
          type: integer
          description: The maximum number of ablated model inferences *per feature*
          minimum: 1
          maximum: 100000
        ci_level:
          type: number
          description: >-
            The confidence interval level (between 0 and 1) to use for all
            confidence intervals computed
          minimum: 0
          maximum: 1
        ref_env_id:
          type: string
          format: uuid
          description: environment to use for the reference dataset.
    FeatureImportanceDataSource:
      oneOf:
        - $ref: '#/components/schemas/FeatureImportanceEnvDataSource'
        - $ref: '#/components/schemas/FeatureImportanceSliceQueryDataSource'
        - $ref: '#/components/schemas/FeatureImpactFqlDataSource'
    FeatureImportanceEnvDataSource:
      type: object
      required:
        - source_type
        - env_type
      properties:
        source_type:
          type: string
          enum:
            - ENVIRONMENT
        env_id:
          type: string
          format: uuid
          description: Env uuid
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
        num_samples:
          type: integer
          description: Number of input points explained
          minimum: 1
          maximum: 1000000
    FeatureImportanceSliceQueryDataSource:
      type: object
      required:
        - source_type
        - query
      properties:
        source_type:
          type: string
          enum:
            - SQL_SLICE_QUERY
        query:
          type: string
          description: SQL query
        num_samples:
          type: integer
          description: Number of input points explained
          minimum: 1
          maximum: 1000000
    FeatureImportanceResponse:
      type: object
      properties:
        model_task:
          type: string
        model_input_type:
          type: string
        total_input_samples:
          type: integer
          example: 10000
        valid_input_samples:
          type: integer
          example: 9000
        ci_level:
          type: number
          example: 0.9
        feature_names:
          type: array
          items:
            type: string
          example:
            - CreditScore
            - Geography
            - Age
        fixed_sample_ci:
          type: array
          items:
            type: number
          example:
            - 0.04
            - 0.002
            - 0.1
        loss:
          type: string
          example: pointwise_logloss
        mean_loss:
          type: number
          example: 2.41122
        mean_loss_ci:
          type: number
          example: 0.0434
        mean_loss_increase_importance:
          type: array
          items:
            type: number
          example:
            - -0.0581
            - -0.097
            - -0.0707
        num_refs:
          type: integer
          example: 500
        random_sample_ci:
          type: array
          items:
            type: number
          example:
            - 0.024
            - 0.0204
            - 0.0246
        num_inputs:
          type: integer
          example: 250
        num_iterations:
          type: integer
          example: 200
        env_name:
          type: string
          example: bank_churn
        env_uuid:
          type: string
          example: bcb8e333-39d1-4ba5-a485-dec1591f7122
        created_at:
          type: string
          example: 2023-12-12T18:21:07.616Z
    ScoreRequestBody:
      type: object
      required:
        - data_source
        - model_id
      properties:
        data_source:
          $ref: '#/components/schemas/ScoresDataSource'
        model_id:
          type: string
          format: uuid
          description: Model uuid
        binary_threshold:
          type: number
          description: Threshold for binary classification models
          minimum: 0
          maximum: 1
        top_k:
          type: integer
          description: Top K for ranking models
          minimum: 1
          maximum: 500
        metrics:
          type: array
          items:
            type: string
            enum:
              - AUC
              - LOG_LOSS
              - F1_SCORE
              - ACCURACY
              - PRECISION
              - RECALL
              - CONFUSION_MATRIX
              - ROC_CURVE
              - PRECISION_RECALL_CURVE
              - CALIBRATION_CURVE
              - R2
              - RMSE
              - MAE
              - ERROR_DISTRIBUTION
              - PREDICTION_SCATTERPLOT
              - MAP
              - NDCG
              - TOP_K_MEAN_SCORE
    ScoresDataSource:
      oneOf:
        - $ref: '#/components/schemas/ScoresEnvDataSource'
        - $ref: '#/components/schemas/ScoresSqlSliceQueryDataSource'
        - $ref: '#/components/schemas/ScoresFqlDataSource'
    ScoresEnvDataSource:
      type: object
      required:
        - source_type
        - env_type
      properties:
        source_type:
          type: string
          enum:
            - ENVIRONMENT
        env_id:
          type: string
          format: uuid
          description: Env uuid
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
        num_samples:
          type: integer
          description: Max records to fetch for scoring
          minimum: 1
          maximum: 500000
    ScoresSqlSliceQueryDataSource:
      type: object
      required:
        - source_type
        - query
      properties:
        source_type:
          type: string
          enum:
            - SQL_SLICE_QUERY
        query:
          type: string
          description: SQL query
        num_samples:
          type: integer
          description: Max records to fetch for scoring
          minimum: 1
          maximum: 500000
    ScoresFqlDataSource:
      type: object
      required:
        - source_type
        - env_type
      properties:
        source_type:
          type: string
          enum:
            - FQL
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
        env_id:
          nullable: true
          type: string
          format: uuid
          description: Env uuid
        slice_definition:
          type: string
          description: Segment definition
        segment_id:
          nullable: true
          type: string
          format: uuid
          description: Segment uuid
        time_filter:
          $ref: '#/components/schemas/TimeFilter'
        num_samples:
          type: integer
          description: Max records to fetch for scoring
          minimum: 1
          maximum: 500000
    ScoresResponse:
      oneOf:
        - $ref: '#/components/schemas/ScoresRegressionResponse'
        - $ref: '#/components/schemas/ScoresBinaryClassificationResponse'
        - $ref: '#/components/schemas/ScoresMultiClassClassificationResponse'
        - $ref: '#/components/schemas/ScoresRankingResponse'
    ScoresRegressionResponse:
      type: object
      required:
        - model_task
        - total_samples
        - valid_samples
        - targets
        - predictions
        - error_distribution
      properties:
        model_task:
          type: string
          enum:
            - REGRESSION
        total_samples:
          type: integer
          example: 10000
        valid_samples:
          type: integer
          example: 9500
        r_squared:
          type: number
          example: 0.6934094625050112
        root_mean_squared_error:
          type: number
          example: 0.43712324037225403
        mean_absolute_error:
          type: number
          example: 0.34032740270302
        predictions:
          type: array
          items:
            type: number
          example:
            - 6.346766948699951
            - 5.74676698811151
        targets:
          type: array
          items:
            type: number
          example:
            - 6
            - 5
        error_distribution:
          $ref: '#/components/schemas/ErrorDistribution'
    ScoresBinaryClassificationResponse:
      type: object
      required:
        - model_task
        - total_samples
        - valid_samples
      properties:
        model_task:
          type: string
          enum:
            - BINARY_CLASSIFICATION
        total_samples:
          type: integer
          example: 10000
        valid_samples:
          type: integer
          example: 9500
        auc:
          type: number
          example: 0.9354554635924722
        log_loss:
          type: number
          example: 0.2637920823961373
        f1_score:
          type: number
          example: 0.6707317073170732
        accuracy:
          type: number
          example: 0.892
        precision:
          type: number
          example: 0.8870967741935484
        recall:
          type: number
          example: 0.5392156862745098
        confusion_matrix:
          $ref: '#/components/schemas/ConfusionMatrix'
        calibration_curve:
          $ref: '#/components/schemas/CalibrationCurve'
        precision_recall_curve:
          $ref: '#/components/schemas/PrecisionRecallCurve'
        roc_curve:
          $ref: '#/components/schemas/RocCurve'
    ScoresMultiClassClassificationResponse:
      type: object
      required:
        - model_task
        - total_samples
        - valid_samples
      properties:
        model_task:
          type: string
          enum:
            - MULTICLASS_CLASSIFICATION
        total_samples:
          type: integer
          example: 10000
        valid_samples:
          type: integer
          example: 9500
        accuracy:
          type: number
          example: 0.6229
        f1_score:
          type: number
          example: 0.6229
        log_loss:
          type: number
          example: 0.7753224258287094
        confusion_matrix:
          $ref: '#/components/schemas/ConfusionMatrixMulticlass'
    ScoresRankingResponse:
      type: object
      required:
        - model_task
        - is_binary_ranking_model
        - total_samples
        - valid_samples
      properties:
        model_task:
          type: string
          enum:
            - RANKING
        is_binary_ranking_model:
          type: boolean
        total_samples:
          type: integer
          example: 10000
        valid_samples:
          type: integer
          example: 9500
        map:
          type: number
          example: 0.12155080034826872
        ndcg:
          type: number
          example: 0.12616757949512272
        top_k_mean_score:
          $ref: '#/components/schemas/TopKMeanScore'
    ConfusionMatrix:
      type: object
      properties:
        tp:
          type: integer
          example: 110
        tn:
          type: integer
          example: 782
        fp:
          type: integer
          example: 14
        fn:
          type: integer
          example: 94
    CalibrationCurve:
      type: object
      properties:
        fraction_of_positives:
          type: array
          items:
            type: number
          example:
            - 0.002
        mean_predicted_value:
          type: array
          items:
            type: number
          example:
            - 0.011457310620268222
    PrecisionRecallCurve:
      type: object
      properties:
        precisions:
          type: array
          items:
            type: number
          example:
            - 0.20396515470111146
        recalls:
          type: array
          items:
            type: number
          example:
            - 1
        thresholds:
          type: array
          items:
            type: number
          example:
            - 0.005939082209609516
    RocCurve:
      type: object
      properties:
        fpr:
          type: array
          items:
            type: number
          example:
            - 0
        tpr:
          type: array
          items:
            type: number
          example:
            - 0
        thresholds:
          type: array
          items:
            type: number
          example:
            - 1
    TopKMeanScore:
      type: object
      properties:
        mean_scores:
          type: array
          items:
            type: number
          example:
            - -0.8083528706335152
            - 0.4732407096140612
        targets:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
          description: Targets can be an array of strings or integers
          example:
            - Churned
            - Not Churned
    ConfusionMatrixMulticlass:
      type: object
      additionalProperties:
        type: object
        additionalProperties:
          type: integer
    ErrorDistribution:
      type: object
      properties:
        count:
          type: array
          items:
            type: integer
          example:
            - 2
            - 6
        bins:
          type: array
          items:
            type: number
          example:
            - 0
            - 1
            - 2
    MutualInformationRequestBody:
      type: object
      required:
        - model_id
        - query
        - column_name
      properties:
        model_id:
          type: string
          format: uuid
          description: model uuid
        query:
          type: string
          description: SQL query
        column_name:
          type: string
          description: Column name to use as reference to compute mutual information
        num_samples:
          type: integer
          description: Max records to fetch for mutual information analysis
          minimum: 1
          maximum: 500000
        normalized:
          type: boolean
          description: If normalized is True, compute Normalized Mutual Information
    MutualInformationResponse:
      type: object
    SliceStatisticsRequestBody:
      type: object
      required:
        - model_id
        - query
      properties:
        model_id:
          type: string
          format: uuid
          description: model uuid
        query:
          type: string
          description: SQL query
    SliceStatisticsResponse:
      type: object
    PrecomputeFeatureImpactRequestBody:
      type: object
      description: Request body for precompute feature impact
      required:
        - model_id
        - env_id
        - env_type
      properties:
        model_id:
          type: string
          format: uuid
          description: Unique identifier for model.
        env_id:
          type: string
          format: uuid
          description: Unique identifier for environment.
        env_type:
          type: string
          description: Type of environment. Either PRE_PRODUCTION or PRODUCTION.
        num_refs:
          type: integer
          description: Number of reference points used in the explanations
          minimum: 1
          maximum: 1000000
        num_iterations:
          type: integer
          description: The maximum number of ablated model inferences *per feature*
          minimum: 1
          maximum: 100000
        ci_level:
          type: number
          description: >-
            The confidence interval level (between 0 and 1) to use for all
            confidence intervals computed
          minimum: 0
          maximum: 1
        min_support:
          type: integer
          minimum: 1
          description: >-
            Used for TEXT models to specify a minimum support (number of times a
            specific work was present in the sample data) to retrieve top words.
            Default to 15.
    PrecomputeFeatureImportanceRequestBody:
      type: object
      required:
        - model_id
        - env_id
        - env_type
      properties:
        model_id:
          type: string
          format: uuid
        env_id:
          type: string
          format: uuid
        env_type:
          type: string
        num_refs:
          type: integer
          description: Number of reference points used in the explanations
          minimum: 1
          maximum: 1000000
        num_iterations:
          type: integer
          description: The maximum number of ablated model inferences *per feature*
          minimum: 1
          maximum: 100000
        ci_level:
          type: number
          description: >-
            The confidence interval level (between 0 and 1) to use for all
            confidence intervals computed
          minimum: 0
          maximum: 1
    PrecomputePredictionsRequestBody:
      type: object
      required:
        - model_id
        - env_id
      properties:
        model_id:
          type: string
          format: uuid
        env_id:
          type: string
          format: uuid
        batch_size:
          type: integer
          description: Batch size for predictions
          minimum: 1
          maximum: 50000
    PredictRequestBody:
      type: object
      required:
        - model_id
        - data
      properties:
        model_id:
          type: string
          format: uuid
        chunk_size:
          type: integer
        data:
          type: array
          items:
            type: object
            example:
              CreditScore: 619
              Geography: France
              Gender: Female
              Age: 42
              Tenure: 2
              Balance: 0
              NumOfProducts: 1
              HasCrCard: 'Yes'
              IsActiveMember: 'Yes'
              EstimatedSalary: 101348.88
    PredictResponse:
      type: object
      properties:
        predictions:
          type: array
          items:
            type: object
            example:
              probability_christian: 0.706
    TimeFilter:
      type: object
      properties:
        start_time:
          type: string
          example: '2023-12-12T00:00:00'
          description: Start time string.
        end_time:
          type: string
          example: '2024-01-15T23:59:59'
          description: End time string.
        time_zone:
          type: string
          example: UTC
          description: Time zone.
    AnalyticMetricsRequestBody:
      type: object
      required:
        - model_id
        - metrics
        - env_type
      properties:
        model_id:
          type: string
          format: uuid
        metrics:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: >-
                  Unique id of the metric or unique uuid of the saved custom
                  metric
                example: jsd
              column:
                type: string
                example: Country
              category:
                oneOf:
                  - type: string
                  - type: integer
                  - type: number
                  - type: boolean
                example: Italy
              baseline_id:
                type: string
                format: uuid
              binary_threshold:
                type: number
                description: binary classification threshold used for performance metrics
              top_k:
                type: integer
                description: Top k for ranking models performance metrics
          required:
            - id
        env_type:
          type: string
          enum:
            - PRE_PRODUCTION
            - PRODUCTION
          description: Type of data to use for analysis
        env_id:
          type: string
          format: uuid
        time_range:
          $ref: '#/components/schemas/TimeRange'
        segment_definition:
          type: string
        segment_id:
          type: string
          format: uuid
    AnalyticMetricsResponse:
      type: array
      items:
        type: number
    TimeRange:
      type: object
      properties:
        start_time:
          type: string
          format: date-time
          example: '2023-12-12T00:00:00'
        end_time:
          type: string
          format: date-time
          example: '2024-01-15T23:59:59'
    ColumnsDataTypeEnum:
      type: string
      description: Data type of the column
      enum:
        - int
        - float
        - str
        - bool
        - category
        - timestamp
        - vector
    DataIntegrityFilter:
      type: object
      description: Specify which violation to show examples from for given columns.
      properties:
        column_names:
          type: array
          items:
            type: string
          example:
            - Salary
            - Age
        violation_types:
          type: array
          items:
            $ref: '#/components/schemas/DataIntegrityEnum'
    DataIntegrityEnum:
      type: string
      description: Data Integrity type
      enum:
        - MISSING_VALUE
        - TYPE_VIOLATION
        - RANGE_VIOLATION
        - ANY_INTEGRITY_VIOLATION
    DataIntegrityResult:
      type: object
      description: Data Integrity type associated to a column
      properties:
        column_name:
          type: string
          example: Salary
        violation_type:
          $ref: '#/components/schemas/DataIntegrityEnum'
    FetchTracesRequestBody:
      type: object
      required:
        - application_id
        - filters
        - time_filter
        - offset
        - page_size
      properties:
        application_id:
          type: string
          format: uuid
          description: Unique identifier of an application
        time_filter:
          $ref: '#/components/schemas/RCAQueryTimeFilter'
        filters:
          $ref: '#/components/schemas/LLMQueryFilters'
        endtime_timestamp:
          type: string
          format: date-time
          description: >-
            end time (in UTC) to fetch data to avoid new data showing up after
            that time during pagination
        metric_scope:
          type: string
          description: the scope of the metric to fetch
        offset:
          type: integer
          description: number of rows to skip
          minimum: 0
        page_size:
          type: integer
          description: the maximum number of rows for the page
          default: 10
          minimum: 1
        ordering:
          description: >-
            Allows you to order results by any field. For desc order prefix
            field name with `-` and provide comman separated values for multiple
            fields
          type: string
    FetchTracesResponse:
      properties:
        column_details:
          $ref: '#/components/schemas/ColumnDetails'
        rows:
          description: Rows of data
          type: array
          items:
            type: array
            items:
              oneOf:
                - type: string
                  format: uuid
                - type: string
                - type: integer
                - type: number
                - type: boolean
                - type: string
                  format: date-time
    ColumnDetails:
      type: array
      description: The columns headers of the data
      items:
        type: object
        properties:
          type:
            description: Type of column (metadata, evaluator, attribute)
            type: string
            enum:
              - METADATA
              - EVALUATOR
              - ATTRIBUTE
          name:
            description: >-
              Name of the column (for type EVALUATOR it correspond to the
              evaluator_rule_name__output_name)
            type: string
          title:
            description: Only for type EVALUATOR, name of the evaluator rule
            type: string
          subtitle:
            description: >-
              Only for type EVALUATOR, name of the output corresponding to the
              evaluator rule name
            type: string
          data_type:
            description: Data type for the values in this column
            type: string
        required:
          - type
          - name
          - data_type
    RCAQueryTimeFilter:
      type: object
      description: The time filter for the query
      properties:
        start_time:
          type: string
          format: date-time
          description: Start bin time string.
        end_time:
          type: string
          format: date-time
          description: End bin time string.
    FileId:
      type: string
      format: uuid
      description: Unique file identifier
    PartNumber:
      type: integer
      description: Part number of the file in multi-part upload process.
      maximum: 1000
      minimum: 1
    FileName:
      type: string
      description: Name of the file uploaded by the user.
    FileBinary:
      type: string
      format: binary
      description: Binary file object
    FileUploadRequest:
      type: object
      required:
        - file
      properties:
        file:
          $ref: '#/components/schemas/FileBinary'
    FileResponse:
      required:
        - id
        - filename
        - type
        - status
        - created_at
        - updated_at
        - created_by
        - updated_by
      allOf:
        - type: object
          properties:
            id:
              $ref: '#/components/schemas/FileId'
            filename:
              $ref: '#/components/schemas/FileName'
            type:
              type: string
              description: File type
              enum:
                - CSV
                - PARQUET
                - TAR_GZ
            status:
              type: string
              description: Status of the file upload process
              enum:
                - INITIATED
                - SUCCESSFUL
                - FAILED
            created_by:
              $ref: '#/components/schemas/UserCompact'
            updated_by:
              $ref: '#/components/schemas/UserCompact'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    FileUploadResponse:
      $ref: '#/components/schemas/FileResponse'
    MultiPartInitRequest:
      type: object
      required:
        - filename
      properties:
        filename:
          $ref: '#/components/schemas/FileName'
    MultiPartInitResponse:
      $ref: '#/components/schemas/FileResponse'
    PartUploadRequest:
      type: object
      required:
        - file
        - file_id
        - part_number
      properties:
        file:
          $ref: '#/components/schemas/FileBinary'
        file_id:
          $ref: '#/components/schemas/FileId'
        part_number:
          $ref: '#/components/schemas/PartNumber'
    MultiPartUploadResponse:
      type: object
      required:
        - part_id
      properties:
        part_id:
          $ref: '#/components/schemas/PartNumber'
    Part:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the part
        number:
          $ref: '#/components/schemas/PartNumber'
    MultiPartCompleteRequest:
      type: object
      properties:
        file_id:
          $ref: '#/components/schemas/FileId'
        parts:
          type: array
          items:
            $ref: '#/components/schemas/Part'
    MultiPartCompleteResponse:
      $ref: '#/components/schemas/FileResponse'
    FqlExpressionsResponse:
      type: object
      description: >
        Response containing the list of available FQL functions for GenAI custom
        metrics. The top-level structure is extensible — future versions may add
        additional keys (e.g., `keywords`, `fields`) without breaking existing
        consumers.
      required:
        - functions
      properties:
        functions:
          type: array
          description: >
            Ordered list of FQL functions available for building custom metric
            expressions. Includes aggregate functions (e.g., count, sum),
            row-level functions (e.g., if, match), and the `attribute` construct
            for referencing GenAI span/session attributes.
          items:
            $ref: '#/components/schemas/FqlFunction'
    FqlFunction:
      type: object
      description: >
        Describes a single FQL function, including its name, category, parameter
        signature, and return type. Used by the frontend to render autocomplete
        suggestions and signature hints.
      required:
        - name
        - category
        - grouping
        - description
        - parameters
        - return_type
      properties:
        name:
          type: string
          description: >
            FQL function name. This is the identifier the user types in the FQL
            editor (e.g., `count`, `if`, `attribute`).
          example: count
        category:
          type: string
          enum:
            - aggregate
            - row
          description: >
            Function category. `aggregate` functions operate over multiple rows
            to produce a single value (e.g., count, sum, average). `row`
            functions operate on individual rows and return a per-row value
            (e.g., if, match, attribute).
          example: aggregate
        grouping:
          type: string
          enum:
            - aggregation
            - logical
            - math
            - string
            - attribute
          description: >
            Finer-grained grouping within a category, used by the frontend to
            stratify functions in the autocomplete menu. Aggregate-category
            functions use `aggregation`. Row-category functions are split into
            `logical`, `math`, `string` and `attribute`
          example: aggregation
        description:
          type: string
          description: >
            Human-readable explanation of what the function does. Intended for
            display as a tooltip or documentation panel in the FQL editor.
          example: Returns the number of non-null rows of a column or row expression
        parameters:
          type: array
          description: >
            Ordered list of parameters the function accepts. Positional
            parameters come first, followed by keyword parameters. This order
            matches the FQL calling convention.
          items:
            $ref: '#/components/schemas/FqlParameter'
        return_type:
          type: string
          enum:
            - number
            - string
            - boolean
            - any
          description: >
            Data type the function evaluates to. Informational — the backend
            validates type correctness when the FQL expression is submitted. The
            frontend does not need to replicate type-checking logic.
          example: number
    FqlParameter:
      type: object
      description: >
        Describes a single parameter of an FQL function. Parameters are either
        positional (passed as bare expressions in order) or keyword (passed as
        name=value pairs).
      required:
        - name
        - type
        - is_required
        - kind
      properties:
        name:
          type: string
          description: >
            Parameter label. For positional parameters: `expr` (single) or
            `expr1`, `expr2`, ... (multiple). For keyword parameters: the actual
            keyword name the user types in FQL (e.g., `level`, `scope`, `name`).
          example: expr
        type:
          type: string
          enum:
            - number
            - string
            - boolean
            - any
          description: >
            Expected data type of the parameter. Uses lowercase values aligned
            with JSON Schema and TypeScript conventions. `any` means any type is
            accepted.
          example: any
        is_required:
          type: boolean
          description: >
            Whether the parameter must be provided. Optional parameters may have
            a `default` value.
          example: true
        kind:
          type: string
          enum:
            - positional
            - keyword
          description: >
            How the parameter is passed in FQL syntax. `positional`: the user
            passes a bare expression in order (e.g., `count(revenue)`).
            `keyword`: the user types `name=value` (e.g., `level=0.75`,
            `scope='span'`).
          example: positional
        default:
          description: >
            Default value if the parameter is omitted. Only present on optional
            parameters.
          example: 0.5
        allowed_values:
          type: array
          nullable: true
          description: >
            Fixed set of valid values for this parameter. Only present when the
            parameter accepts a constrained set of values (e.g., `scope` only
            accepts `["span"]`).
          items: {}
          example:
            - span
    IntervalEnum:
      type: integer
      description: Interval in seconds (3600 = 1 hour, 86400 = 1 day)
      enum:
        - 3600
        - 86400
    ThresholdTypeEnum:
      type: string
      description: Type of threshold
      enum:
        - ABSOLUTE
    ThresholdConditionEnum:
      type: string
      description: Condition for threshold comparison
      enum:
        - ABOVE
        - BELOW
    NotificationTypeEnum:
      type: string
      description: Type of notification
      enum:
        - EMAIL
    QueryScopeEnum:
      type: string
      description: Scope of query processing
      enum:
        - SPAN
        - SESSION
    GenAIAlertRuleListItem:
      type: object
      description: Simplified GenAI Alert Rule object for list responses
      required:
        - id
        - project
        - application
        - name
        - metric_source
        - metric_name
        - metric_display_name
        - interval
        - aggregation
        - aggregation_display_name
        - threshold_type
        - threshold_condition
        - critical_threshold
        - created_at
        - query_scope
        - metric_details
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the GenAI Alert Rule
        project:
          $ref: '#/components/schemas/ProjectCompact'
        application:
          $ref: '#/components/schemas/ApplicationCompact'
        name:
          type: string
          description: Name of the alert rule
        metric_source:
          $ref: '#/components/schemas/GenAIMetricSourceEnum'
        metric_name:
          type: string
          description: >-
            Name of the metric (e.g., "traffic", "token_count", "attribute",
            "latency", or an evaluator type)
        metric_display_name:
          type: string
          description: >-
            Human-readable display name of the metric (e.g., "Traffic", "Token
            Count", "Attribute", "Latency", "Sentiment Analysis")
        interval:
          $ref: '#/components/schemas/IntervalEnum'
        aggregation:
          $ref: '#/components/schemas/GenAIAggregationEnum'
        metric_unit:
          $ref: '#/components/schemas/GenAIMetricUnitEnum'
        aggregation_display_name:
          type: string
          description: >-
            Human-readable display name of the aggregation (e.g., "Sum",
            "Average", "P50 (Median)", "P75", "P90", "P95", "P99", "Count")
        threshold_type:
          $ref: '#/components/schemas/ThresholdTypeEnum'
        threshold_condition:
          $ref: '#/components/schemas/ThresholdConditionEnum'
        critical_threshold:
          type: number
          format: float
          description: Threshold value for triggering a critical alert
        warning_threshold:
          type: number
          format: float
          nullable: true
          description: Threshold value for triggering a warning alert
        token_type_display_name:
          type: string
          nullable: true
          description: >-
            Human-readable display name of the token type (e.g.,
            "gen_ai.usage.input_tokens", "gen_ai.usage.output_tokens",
            "gen_ai.usage.total_tokens") - only for token_count metrics
        attribute_display_name:
          type: string
          nullable: true
          description: >-
            Human-readable display name of the attribute (e.g., "llm.name",
            "llm.model") - only for attribute metrics
        attribute_value:
          type: string
          nullable: true
          description: >-
            Value of the attribute being monitored (e.g., "gpt-4", "claude-3") -
            only for attribute metrics
        evaluator_rule_name:
          type: string
          nullable: true
          description: Name of the evaluator rule (only for evaluator metrics)
        evaluator_output_name:
          type: string
          nullable: true
          description: >-
            Name of the evaluator output being monitored (only for evaluator
            metrics)
        evaluator_output_value:
          type: string
          nullable: true
          description: >-
            Value of the evaluator output being filtered on (only for evaluator
            metrics with count aggregation)
        created_at:
          type: string
          format: date-time
          description: Timestamp indicating when the GenAI Alert Rule was created
        query_scope:
          $ref: '#/components/schemas/QueryScopeEnum'
        metric_details:
          description: Details about the metric used in the alert rule
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Unique identifier for the metadata item
              name:
                type: string
                description: Name of the metadata item
              value:
                type: string
                description: Value of the metadata item
            required:
              - id
              - name
              - value
    CreateGenAIAlertRuleRequest:
      type: object
      required:
        - project_id
        - application_id
        - name
        - metric_source
        - metric_name
        - interval
        - aggregation
        - threshold_type
        - threshold_condition
        - critical_threshold
        - notification_settings
        - query_scope
      properties:
        project_id:
          type: string
          format: uuid
          description: UUID of the project
        application_id:
          type: string
          format: uuid
          description: UUID of the application
        name:
          type: string
          description: Name of the alert rule
        metric_source:
          $ref: '#/components/schemas/GenAIMetricSourceEnum'
        metric_name:
          type: string
          description: >-
            Name of the metric (e.g., "traffic", "token_count", "attribute",
            "latency", or an evaluator type)
        interval:
          $ref: '#/components/schemas/IntervalEnum'
        aggregation:
          $ref: '#/components/schemas/GenAIAggregationEnum'
        metric_unit:
          $ref: '#/components/schemas/GenAIMetricUnitEnum'
        threshold_type:
          $ref: '#/components/schemas/ThresholdTypeEnum'
        threshold_condition:
          $ref: '#/components/schemas/ThresholdConditionEnum'
        critical_threshold:
          type: number
          format: float
          description: Threshold value for triggering a critical alert
        warning_threshold:
          type: number
          format: float
          nullable: true
          description: Threshold value for triggering a warning alert (optional)
        notification_settings:
          type: array
          items:
            $ref: '#/components/schemas/NotificationSetting'
          description: List of notification settings for the alert rule
        query_scope:
          $ref: '#/components/schemas/QueryScopeEnum'
        token_type_id:
          type: string
          nullable: true
          description: >-
            Token type identifier (required for token_count metrics). In V1, a
            Postgres UUID; in V2, a bare OTel attribute name (e.g.
            gen_ai.usage.input_tokens).
        attribute_id:
          type: string
          nullable: true
          description: >-
            Attribute identifier (required for attribute metrics). In V1, a
            Postgres UUID; in V2, a bare OTel attribute name (e.g.
            gen_ai.usage.total_tokens).
        attribute_value:
          type: string
          nullable: true
          description: >-
            Attribute value for the metric attribute (only for attribute metrics
            with count aggregation)
        semantic_name:
          nullable: true
          description: >-
            Semantic concept name (e.g. input_tokens, model_name). When set, the
            alert queries by semantic concept rather than a specific attribute
            key, making it SDK-agnostic. Mutually exclusive with token_type_id
            and attribute_id.
          allOf:
            - $ref: '#/components/schemas/SemanticConcept'
        evaluator_rule_id:
          type: string
          format: uuid
          nullable: true
          description: Evaluator rule ID (required for evaluator metrics)
        evaluator_output_name:
          type: string
          nullable: true
          description: >-
            Name of the evaluator output to monitor (required for evaluator
            metrics)
        evaluator_output_value:
          type: string
          nullable: true
          description: >-
            Value of the evaluator output to filter on (only for evaluator
            metrics with count aggregation)
    NotificationSetting:
      type: object
      required:
        - type
        - config
      properties:
        type:
          $ref: '#/components/schemas/NotificationTypeEnum'
        config:
          type: object
          properties:
            recipients:
              type: array
              items:
                type: string
                format: email
              description: List of email recipients
          required:
            - recipients
    TestNotificationResult:
      type: object
      description: Result of sending test notifications
      required:
        - results
      properties:
        results:
          type: array
          description: Status of each notification channel attempted
          items:
            type: object
            properties:
              notification_type:
                $ref: '#/components/schemas/NotificationTypeEnum'
              status:
                type: string
                enum:
                  - success
                  - failure
                description: Whether the notification was successfully sent
              message:
                type: string
                description: Human-readable details about the notification result
            required:
              - notification_type
              - status
              - message
    GenAIAlertRule:
      type: object
      required:
        - id
        - name
        - metric_source
        - metric_name
        - interval
        - aggregation
        - threshold_type
        - threshold_condition
        - critical_threshold
        - query_scope
        - organization
        - project
        - application
        - notification_settings
        - created_at
        - updated_at
        - created_by
        - updated_by
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the GenAI Alert Rule
        name:
          type: string
          description: Name of the GenAI Alert Rule
        metric_source:
          $ref: '#/components/schemas/GenAIMetricSourceEnum'
        metric_name:
          type: string
          description: >-
            Name of the metric (e.g., "traffic", "token_count", "attribute",
            "latency", or an evaluator type)
        interval:
          $ref: '#/components/schemas/IntervalEnum'
        aggregation:
          $ref: '#/components/schemas/GenAIAggregationEnum'
        metric_unit:
          $ref: '#/components/schemas/GenAIMetricUnitEnum'
        threshold_type:
          $ref: '#/components/schemas/ThresholdTypeEnum'
        threshold_condition:
          $ref: '#/components/schemas/ThresholdConditionEnum'
        critical_threshold:
          type: number
          format: float
          description: Threshold value for triggering a critical alert
        warning_threshold:
          type: number
          format: float
          nullable: true
          description: Threshold value for triggering a warning alert
        query_scope:
          $ref: '#/components/schemas/QueryScopeEnum'
        token_type:
          type: string
          nullable: true
          description: Token type for the metric token_count
        semantic_name:
          type: string
          nullable: true
          description: >-
            Semantic concept name used for SDK-agnostic token count alerts (e.g.
            input_tokens). Set in V2; null in V1.
        attribute_name:
          type: string
          nullable: true
          description: Attribute name for the metric attribute
        attribute_value:
          type: string
          nullable: true
          description: Attribute value for the metric attribute
        evaluator_rule_name:
          type: string
          nullable: true
          description: Name of the evaluator rule (only for evaluator metrics)
        evaluator_output_name:
          type: string
          nullable: true
          description: >-
            Name of the evaluator output being monitored (only for evaluator
            metrics)
        evaluator_output_value:
          type: string
          nullable: true
          description: >-
            Value of the evaluator output being filtered on (only for evaluator
            metrics with count aggregation)
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        application:
          $ref: '#/components/schemas/ApplicationCompact'
        notification_settings:
          type: array
          items:
            $ref: '#/components/schemas/NotificationSetting'
        created_at:
          type: string
          format: date-time
          description: Timestamp indicating when the GenAI Alert Rule was created
        updated_at:
          type: string
          format: date-time
          description: Timestamp indicating when the GenAI Alert Rule was last updated
        created_by:
          $ref: '#/components/schemas/UserCompact'
        updated_by:
          $ref: '#/components/schemas/UserCompact'
    CreateGenaiCustomMetricRequest:
      type: object
      required:
        - name
        - definition
      properties:
        name:
          type: string
          description: Name of the GenAI custom metric
        definition:
          type: string
          description: FQL definition of the custom metric
        project_id:
          type: string
          format: uuid
          nullable: true
          description: >
            If this is a project specific metric, the UUID of the project this
            custom metric belongs to. If this metric is global, then set to null
        description:
          type: string
          nullable: true
          description: Description of the custom metric
    GenaiCustomMetric:
      type: object
      required:
        - id
        - name
        - definition
        - organization
        - created_by
        - updated_by
        - created_at
        - updated_at
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: Unique identifier for the GenAI custom metric
            name:
              type: string
              description: Name of the GenAI custom metric
            definition:
              type: string
              description: FQL definition of the custom metric
            description:
              type: string
              nullable: true
              description: Description of the custom metric
            project:
              nullable: true
              description: >
                Compact project object if the metric is project-scoped, or null
                if the metric is global (org-wide).
              allOf:
                - $ref: '#/components/schemas/ProjectCompact'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            created_by:
              $ref: '#/components/schemas/UserCompact'
            updated_by:
              $ref: '#/components/schemas/UserCompact'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    GenaiCustomMetricDeletionJob:
      type: object
      description: Job object for GenAI custom metric deletion
      required:
        - job
      properties:
        job:
          $ref: '#/components/schemas/JobCompact'
    GenAIDashboardMetricSource:
      type: string
      description: >
        Source table the metric was aggregated from.

        Distinct from `GenAIMetricSourceEnum` (used by GenAI charts/alerts),
        which

        enumerates a different domain (`raw_data`, `attribute`, `evaluator`,
        `custom`).


        `alert` is a planned extension (not yet implemented); the endpoint will
        return

        400 for `metric_source=alert` until the alert MV branch ships.
      enum:
        - trace
        - evaluator
        - alert
    GenAIDashboardMetricName:
      type: string
      description: |
        Metric name produced by the GenAI metrics materialized view.
        Valid combinations per source:
          `trace` → `traffic`, `traces`, `sessions`, `token_count`, `latency`, `errors`
          `evaluator` → `answer_relevance`, `context_relevance`, `faithfulness`, `prompt_safety`, `pii_detection`
          `alert` *(planned)* → `breaches`
      enum:
        - traffic
        - traces
        - sessions
        - token_count
        - latency
        - errors
        - answer_relevance
        - context_relevance
        - faithfulness
        - prompt_safety
        - pii_detection
        - breaches
    GenAIDashboardMetricRow:
      type: object
      description: >-
        A single pre-aggregated metric row keyed by application, bucket, and EKV
        metric coordinates.
      required:
        - app_id
        - bucket
        - metric_source
        - metric_name
        - aggregation
        - dimension
        - value
      properties:
        app_id:
          type: string
          format: uuid
          description: UUID of the GenAI application this row belongs to.
        bucket:
          type: string
          format: date-time
          description: Hourly bucket start in UTC, ISO 8601 with trailing `Z`.
          example: '2026-05-12T00:00:00Z'
        metric_source:
          $ref: '#/components/schemas/GenAIDashboardMetricSource'
        metric_name:
          $ref: '#/components/schemas/GenAIDashboardMetricName'
        aggregation:
          type: string
          description: >-
            Aggregation function applied (e.g. `count`, `sum`, `average`,
            `uniq`, `rate`, `p50`, `p99`).
          example: count
        dimension:
          type: string
          description: >-
            Metric dimension. Empty string for scalar metrics; otherwise e.g.
            `total`, `input`, `output`, `max_risk_prob`.
          example: ''
        value:
          type: number
          format: double
          description: >-
            Aggregated numeric value for the (app_id, bucket, metric_source,
            metric_name, aggregation, dimension) coordinate.
    GenAIDashboardMetricsResponse:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          description: >-
            Metric rows ordered by app_id_hash, bucket. May be empty when the
            caller has no authorized applications or no data exists in the
            requested window.
          items:
            $ref: '#/components/schemas/GenAIDashboardMetricRow'
    TimeBinSizeEnum:
      type: string
      enum:
        - day
        - hour
    ModelNameEnum:
      type: string
      enum:
        - ftl_safety
        - ftl_response_faithfulness
    GuardrailsUsageResponse:
      type: object
      required:
        - bin_size
        - model_usage
      properties:
        bin_size:
          $ref: '#/components/schemas/TimeBinSizeEnum'
        model_usage:
          type: array
          description: Usage counts for each model in the time range
          items:
            type: object
            required:
              - model_name
              - usage
            properties:
              model_name:
                $ref: '#/components/schemas/ModelNameEnum'
              usage:
                type: array
                description: Usage count for the model in the time range
                items:
                  type: object
                  required:
                    - timestamp
                    - count
                  properties:
                    timestamp:
                      type: string
                      format: date-time
                      description: Timestamp of the usage
                      example: '2025-01-01T05:00:00+00:00'
                    count:
                      type: integer
                      description: Usage count
                      minimum: 0
                      example: 42
    EventId:
      type: string
      format: uuid
    EventsSource:
      type: object
      properties:
        type:
          type: string
          enum:
            - EVENTS
        events:
          type: array
          maxLength: 1000
          items:
            oneOf:
              - type: object
    EventsResponse:
      type: object
      properties:
        source_type:
          type: string
          enum:
            - EVENTS
        event_ids:
          type: array
          items:
            $ref: '#/components/schemas/EventId'
    FileSource:
      type: object
      properties:
        type:
          type: string
          enum:
            - FILE
        file_id:
          type: string
          format: uuid
    InjestionFileResponse:
      type: object
      properties:
        source_type:
          type: string
          enum:
            - FILE
        job:
          $ref: '#/components/schemas/JobCompact'
    PublishEventsRequest:
      type: object
      required:
        - model_id
        - env_type
        - source
      properties:
        model_id:
          type: string
          format: uuid
        env_type:
          type: string
          enum:
            - PRODUCTION
            - PRE_PRODUCTION
        env_name:
          type: string
          nullable: true
        source:
          anyOf:
            - $ref: '#/components/schemas/EventsSource'
            - $ref: '#/components/schemas/FileSource'
    PublishEventsResponse:
      anyOf:
        - $ref: '#/components/schemas/EventsResponse'
        - $ref: '#/components/schemas/InjestionFileResponse'
    DeleteEventsRequest:
      type: object
      required:
        - model_id
      properties:
        model_id:
          type: string
          format: uuid
        time_range:
          type: object
          properties:
            start_time:
              type: string
              format: date-time
              example: 2025-11-17T01:00:00.000Z
              description: Hourly bin start time in UTC in YYYY-MM-DD HH:00:00Z format
            end_time:
              type: string
              format: date-time
              example: 2025-11-17T02:00:00.000Z
              description: Hourly bin end time in UTC in YYYY-MM-DD HH:00:00Z format
          nullable: true
          required:
            - start_time
            - end_time
        event_ids:
          type: array
          items:
            type: string
          nullable: true
          minItems: 1
          maxItems: 10000
        update_metrics:
          type: boolean
    DeleteEventsResponse:
      type: object
      properties:
        job:
          $ref: '#/components/schemas/JobCompact'
    CancelEventPublishRequest:
      type: object
      required:
        - batch_id
      properties:
        batch_id:
          type: string
          format: uuid
          description: The batch/job UUID of the ingestion job to cancel
        terminate:
          type: boolean
          default: true
          description: >
            If true (default), send SIGTERM to worker processes currently
            executing tasks for this batch. Set to false for a graceful cancel
            that only prevents future task execution.
    IntercomIdVerificationResponse:
      type: object
      properties:
        user_uuid:
          type: string
          example: 824171f9-a4d3-4a6f-bbe4-e0756f9e32b4
          description: Intercom user UUID.
        user_hash:
          type: string
          example: 4500b5f4412b3f60e72fe2300b0c4a5830868745e434fc9af82f1dc84badd6d6
          description: Intercom identity verification hash.
    CompactResourceObject:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
    Info:
      type: object
      title: Info
      description: ''
      required:
        - resource_type
        - resource_name
        - project_name
      properties:
        resource_type:
          $ref: '#/components/schemas/AsyncJobResourceType'
        resource_name:
          type: string
          description: Name of the resource
        project_name:
          type: string
          description: Name of the project
        resource:
          $ref: '#/components/schemas/CompactResourceObject'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        model:
          $ref: '#/components/schemas/ModelCompact'
      additionalProperties: true
    AsyncJobResourceType:
      type: string
      description: Resource type of a job
      enum:
        - DATASET
        - EVENT
        - MODEL
        - DATA
        - APPLICATION
    Job:
      type: object
      title: Job
      required:
        - name
        - id
        - info
        - status
        - progress
        - error_message
        - error_reason
      properties:
        name:
          type: string
          description: A name describing the job
        id:
          type: string
          format: uuid
          description: A unique identifier for the job
        info:
          $ref: '#/components/schemas/Info'
        status:
          $ref: '#/components/schemas/AsyncJobStatus'
        progress:
          type: number
          minimum: 0
          maximum: 100
          description: Job progress -> (num tasks completed / total tasks)
        error_message:
          type: string
          description: Error message from a failed task in the job
          nullable: true
        error_reason:
          type: string
          description: Error reason for a job failure
          example: DeploymentTimeout
          nullable: true
        extras:
          type: object
          description: Provides detailed information of the async job
          nullable: true
    JobsListObject:
      type: object
      title: JobsListObject
      required:
        - name
        - id
        - info
        - status
        - created_at
        - updated_at
        - started_at
        - completed_at
      properties:
        name:
          type: string
          description: A name describing the job
        id:
          type: string
          format: uuid
        info:
          $ref: '#/components/schemas/Info'
        status:
          $ref: '#/components/schemas/AsyncJobStatus'
        created_at:
          type: string
          format: date-time
          description: Job createad at time
        updated_at:
          type: string
          format: date-time
          description: Job last updated at time
        started_at:
          type: string
          format: date-time
          description: Job execution start time
          nullable: true
        completed_at:
          type: string
          format: date-time
          description: Job execution completion time
          nullable: true
    Jobs:
      type: array
      items:
        $ref: '#/components/schemas/JobsListObject'
    InProgressJob:
      allOf:
        - $ref: '#/components/schemas/JobsListObject'
        - type: object
          properties:
            progress:
              description: Job progress -> (num tasks completed / total tasks)
              type: number
              minimum: 0
              maximum: 100
            error_message:
              type: string
              description: Error message from a failed task in the job
              nullable: true
            error_reason:
              type: string
              description: Error reason for jobs failure
              nullable: true
          required:
            - progress
            - error_message
            - error_reason
    LLMProviderRequest:
      type: object
      title: LLM Provider Request
      description: Request body for creating an LLM provider
      required:
        - provider
        - credentials
        - models
      properties:
        provider:
          description: Name of the LLM provider
          type: string
          example: OpenAI
        api_base:
          description: >-
            Custom API base URL. Required for some providers (e.g., Databricks),
            optional for others (e.g., Bedrock VPC endpoints). Must use HTTPS.
          type: string
          maxLength: 512
          nullable: true
          example: https://adb-xxx.azuredatabricks.net/serving-endpoints
        credentials:
          description: List of credentials for the provider
          type: array
          items:
            $ref: '#/components/schemas/CredentialRequest'
        models:
          description: List of models supported by this provider
          type: array
          items:
            $ref: '#/components/schemas/ModelCompactRequest'
    UpdateLLMProviderRequest:
      type: object
      title: Update LLM Provider Request
      description: >-
        Request body for updating an LLM provider. This is a replace operation
        where you specify the complete desired state. Omitted fields will be
        removed.
      required:
        - provider
      properties:
        provider:
          description: Name of the LLM provider
          type: string
        api_base:
          description: >-
            Custom API base URL. Required for some providers (e.g., Databricks),
            optional for others (e.g., Bedrock VPC endpoints). Must use HTTPS.
          type: string
          maxLength: 512
          nullable: true
        models:
          description: >-
            Complete list of models to support. This replaces all existing
            models.
          type: array
          items:
            $ref: '#/components/schemas/ModelCompactRequest'
        credentials:
          description: >-
            Complete list of credentials. Include existing ones (name/uuid) to
            keep them, add new ones (name/credential_config) to create them.
            Omitted credentials will be removed.
          type: array
          items:
            $ref: '#/components/schemas/CredentialUpdate'
    CredentialRequest:
      type: object
      title: Credential Request
      description: Request body for creating a credential
      required:
        - name
        - credential_config
      properties:
        name:
          description: Human-readable name for the credential
          type: string
          example: Production Key
        credential_config:
          oneOf:
            - $ref: '#/components/schemas/APIKeyConfig'
            - $ref: '#/components/schemas/IAMConfig'
            - $ref: '#/components/schemas/GCPServiceAccountConfig'
            - $ref: '#/components/schemas/EntraIDConfig'
            - $ref: '#/components/schemas/AWSAccessKeyConfig'
            - $ref: '#/components/schemas/OAuth2ClientCredentialsConfig'
          discriminator:
            propertyName: credential_type
            mapping:
              api_key: '#/components/schemas/APIKeyConfig'
              iam: '#/components/schemas/IAMConfig'
              gcp_service_account: '#/components/schemas/GCPServiceAccountConfig'
              entra_id: '#/components/schemas/EntraIDConfig'
              aws_access_key: '#/components/schemas/AWSAccessKeyConfig'
              oauth2_client_credentials: '#/components/schemas/OAuth2ClientCredentialsConfig'
    ModelCompactRequest:
      type: object
      title: Model Compact Request
      description: Request body for a model
      required:
        - name
      properties:
        name:
          description: Human-readable name for this model
          type: string
          maxLength: 128
        uuid:
          description: UUID for existing model
          type: string
          format: uuid
          nullable: true
    CredentialUpdate:
      type: object
      title: Credential Update
      description: >-
        Request body for updating a credential. Use name/uuid to keep existing
        credential, or name/credential_config to create a new one.
      properties:
        name:
          description: Human-readable name for the credential
          type: string
        uuid:
          description: UUID of existing credential to update
          type: string
          format: uuid
        credential_config:
          oneOf:
            - $ref: '#/components/schemas/APIKeyConfig'
            - $ref: '#/components/schemas/IAMConfig'
            - $ref: '#/components/schemas/GCPServiceAccountConfig'
            - $ref: '#/components/schemas/EntraIDConfig'
            - $ref: '#/components/schemas/AWSAccessKeyConfig'
            - $ref: '#/components/schemas/OAuth2ClientCredentialsConfig'
          discriminator:
            propertyName: credential_type
            mapping:
              api_key: '#/components/schemas/APIKeyConfig'
              iam: '#/components/schemas/IAMConfig'
              gcp_service_account: '#/components/schemas/GCPServiceAccountConfig'
              entra_id: '#/components/schemas/EntraIDConfig'
              aws_access_key: '#/components/schemas/AWSAccessKeyConfig'
              oauth2_client_credentials: '#/components/schemas/OAuth2ClientCredentialsConfig'
    APIKeyConfig:
      type: object
      title: API Key Configuration
      description: Configuration for API key-based authentication
      required:
        - credential_type
        - api_key
      properties:
        credential_type:
          description: Type of credential configuration
          type: string
          enum:
            - api_key
          example: api_key
        api_key:
          description: API key for the provider
          type: string
          format: password
          writeOnly: true
          maxLength: 4096
          example: sk-...
    IAMConfig:
      type: object
      title: IAM Configuration
      description: Configuration for AWS cross-account role-based authentication
      required:
        - credential_type
        - cross_account_role_arn
        - external_id
        - region
      properties:
        credential_type:
          description: Type of credential configuration
          type: string
          enum:
            - iam
          example: iam
        cross_account_role_arn:
          description: ARN of the cross-account role
          type: string
          example: arn:aws:iam::CUSTOMER-ACCOUNT:role/BedrockAccessRole
        external_id:
          description: Unique external ID for the customer
          type: string
          format: password
          writeOnly: true
          example: unique-external-id-for-customer-123
        region:
          description: AWS region for the service
          type: string
          example: us-east-1
    GCPServiceAccountConfig:
      type: object
      title: GCP Service Account Configuration
      description: Configuration for GCP service account authentication (Vertex AI)
      required:
        - credential_type
        - service_account_json
        - vertex_project
        - vertex_location
      properties:
        credential_type:
          description: Type of credential configuration
          type: string
          enum:
            - gcp_service_account
          example: gcp_service_account
        service_account_json:
          description: GCP service account key JSON (used for authentication)
          type: string
          format: password
          writeOnly: true
          maxLength: 65536
          example: '{"type":"service_account","project_id":"my-project"}'
        vertex_project:
          description: Target GCP project for Vertex AI requests (e.g., my-project-123)
          type: string
          maxLength: 256
          example: my-project-123
        vertex_location:
          description: >-
            Target Vertex AI region for requests (e.g., us-central1,
            europe-west1)
          type: string
          maxLength: 64
          example: us-central1
    EntraIDConfig:
      type: object
      title: Microsoft Entra ID Configuration
      description: >-
        Configuration for Microsoft Entra ID client credentials authentication
        (Azure OpenAI / Azure AI)
      required:
        - credential_type
        - tenant_id
        - client_id
        - client_secret
      properties:
        credential_type:
          description: Type of credential configuration
          type: string
          enum:
            - entra_id
          example: entra_id
        tenant_id:
          description: Microsoft Entra ID tenant ID (directory ID)
          type: string
          maxLength: 256
          example: 00000000-0000-0000-0000-000000000000
        client_id:
          description: Microsoft Entra ID application (client) ID
          type: string
          maxLength: 256
          example: 00000000-0000-0000-0000-000000000000
        client_secret:
          description: Microsoft Entra ID client secret value
          type: string
          format: password
          writeOnly: true
          maxLength: 512
    AWSAccessKeyConfig:
      type: object
      title: AWS Access Key Configuration
      description: Configuration for static AWS access key authentication (Bedrock)
      required:
        - credential_type
        - aws_access_key_id
        - aws_secret_access_key
        - region
      properties:
        credential_type:
          description: Type of credential configuration
          type: string
          enum:
            - aws_access_key
          example: aws_access_key
        aws_access_key_id:
          description: AWS access key ID
          type: string
          maxLength: 256
          example: AKIAIOSFODNN7EXAMPLE
        aws_secret_access_key:
          description: AWS secret access key
          type: string
          format: password
          writeOnly: true
          maxLength: 256
        region:
          description: AWS region (e.g., us-east-1)
          type: string
          maxLength: 32
          example: us-east-1
    OAuth2ClientCredentialsConfig:
      type: object
      title: OAuth2 Client Credentials Configuration
      description: >-
        Generic, provider-agnostic OAuth2 client-credentials (M2M)
        configuration. The gateway exchanges client_id/client_secret for a
        short-lived bearer token at token_url and sends it as an Authorization
        Bearer header. Works for any standard OAuth2 client-credentials provider
        (Databricks, etc. for now) — only the field values differ per provider,
        not the schema. The example values below are for a Databricks service
        principal (token_url = {workspace-host}/oidc/v1/token, scope =
        all-apis).
      required:
        - credential_type
        - token_url
        - client_id
        - client_secret
        - scope
      properties:
        credential_type:
          description: Type of credential configuration
          type: string
          enum:
            - oauth2_client_credentials
          example: oauth2_client_credentials
        token_url:
          description: >-
            OAuth2 token endpoint (e.g., Databricks
            {workspace-host}/oidc/v1/token). Must use HTTPS.
          type: string
          maxLength: 512
          example: https://adb-xxx.azuredatabricks.net/oidc/v1/token
        client_id:
          description: OAuth2 client ID (service principal application ID)
          type: string
          maxLength: 256
          example: 00000000-0000-0000-0000-000000000000
        client_secret:
          description: OAuth2 client secret value
          type: string
          format: password
          writeOnly: true
          maxLength: 512
        scope:
          description: OAuth2 scope to request (e.g., Databricks 'all-apis')
          type: string
          maxLength: 512
          example: all-apis
    UUIDAndNameCompactResponse:
      type: object
      title: UUID and Name Compact Response
      description: Compact representation of an entity with UUID and name
      required:
        - uuid
        - name
      properties:
        uuid:
          description: Unique identifier for this entity
          type: string
          format: uuid
        name:
          description: Human-readable name for this entity
          type: string
          maxLength: 128
    CredentialCompactResponse:
      title: Credential Compact Response
      description: Compact credential representation that includes the credential type
      allOf:
        - $ref: '#/components/schemas/UUIDAndNameCompactResponse'
        - type: object
          properties:
            credential_type:
              description: >-
                Credential type (e.g., api_key, gcp_service_account, iam,
                entra_id, aws_access_key, oauth2_client_credentials)
              type: string
              enum:
                - api_key
                - iam
                - gcp_service_account
                - entra_id
                - aws_access_key
                - oauth2_client_credentials
              maxLength: 64
          required:
            - credential_type
    LLMProviders:
      type: array
      description: List of LLM providers
      items:
        $ref: '#/components/schemas/LLMProvider'
    LLMProvider:
      type: object
      description: Details of an LLM provider
      required:
        - id
        - uuid
        - provider
        - credentials
        - models
        - created_by
        - created_at
        - updated_at
      allOf:
        - type: object
          properties:
            id:
              description: Unique identifier of the provider
              type: integer
              example: 1
            uuid:
              description: UUID of the provider
              type: string
              format: uuid
              example: 550e8400-e29b-41d4-a716-446655440000
            provider:
              description: Name of the provider
              type: string
              example: OpenAI
            api_base:
              description: >-
                Custom API base URL for providers with customer-specific
                endpoints
              type: string
              maxLength: 512
              nullable: true
            credentials:
              description: List of credentials for this provider
              type: array
              items:
                $ref: '#/components/schemas/CredentialCompactResponse'
            models:
              description: List of models supported by this provider
              type: array
              items:
                $ref: '#/components/schemas/UUIDAndNameCompactResponse'
            created_by:
              $ref: '#/components/schemas/UserCompact'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    ProviderOptions:
      type: array
      description: Available models for each supported provider
      items:
        type: object
        properties:
          provider:
            type: string
            description: The provider identifier
          display_name:
            type: string
            description: The human-readable name for the provider
          credential_types:
            type: array
            items:
              type: string
            description: >-
              Allowed credential types for this provider (e.g., api_key,
              gcp_service_account, iam)
          models:
            type: array
            items:
              type: string
            description: List of available models for this provider
        required:
          - provider
          - display_name
          - credential_types
          - models
    LLMGatewayTestRequest:
      type: object
      title: LLM Gateway Test Request
      description: Request body for testing an LLM Gateway connection
      required:
        - model_id
        - credential_uuid
      properties:
        model_id:
          description: Provider/model string (e.g. 'openai/gpt-4o')
          type: string
          example: openai/gpt-4o
        credential_uuid:
          description: UUID of the credential to use for the test
          type: string
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440001
    LLMGatewayTestResponse:
      type: object
      title: LLM Gateway Test Response
      description: Result of an LLM Gateway connection test
      required:
        - success
        - model
        - message
        - response_time_ms
      properties:
        success:
          description: Whether the LLM call succeeded
          type: boolean
        model:
          description: The model that was tested
          type: string
        message:
          description: >-
            Human-readable result message ('Connection successful' or error
            details)
          type: string
        response_time_ms:
          description: Time taken for the full completion call in milliseconds
          type: integer
    LoginURL:
      type: object
      properties:
        url:
          type: string
    LoginCallbackRequest:
      type: object
      required:
        - code
        - state
      properties:
        code:
          type: string
        state:
          type: string
        redirect_uri:
          type: string
    LoginCallbackResponse:
      type: object
      properties:
        target_path:
          type: string
          description: >-
            Optional target path to redirect user after authentication to a
            specific URL
        session:
          type: object
          properties:
            expires:
              type: integer
        user:
          $ref: '#/components/schemas/UserInfo'
        config:
          type: object
          properties:
            enable_service_provider_authn:
              type: boolean
              example: false
    LogoutURLRequest:
      type: object
      properties:
        redirect_uri:
          type: string
          description: Optional redirect URI to return to after logout
    LogoutURL:
      type: object
      properties:
        url:
          type: string
    MetricInfo:
      type: object
      required:
        - id
        - name
        - type
        - columns
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
        columns:
          type: array
          items:
            type: string
        requires_baseline:
          type: boolean
        requires_categories:
          type: boolean
        is_percentage_comparison:
          type: boolean
        requires_threshold:
          type: boolean
        requires_top_k:
          type: boolean
    MetricColumnInfo:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
        group:
          type: string
        data_type:
          type: string
    MetricTypeOption:
      type: object
      required:
        - key
        - name
      properties:
        key:
          type: string
        name:
          type: string
    ModelMetricsDetailsResponse:
      type: object
      required:
        - organization
        - project
        - model
        - metrics
        - columns
        - metric_types
      properties:
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        model:
          $ref: '#/components/schemas/ModelCompact'
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/MetricInfo'
        columns:
          type: array
          items:
            $ref: '#/components/schemas/MetricColumnInfo'
        metric_types:
          type: array
          items:
            $ref: '#/components/schemas/MetricTypeOption'
    UploadIdCompact:
      type: object
      title: UploadIdCompact
      description: >-
        Compact version of upload id which can be included in the response of
        relevant APIs
      required:
        - upload_id
      properties:
        upload_id:
          type: string
    ModelFactoryRequest:
      type: object
      required:
        - file_id
      properties:
        file_id:
          type: string
          format: uuid
        spec:
          $ref: '#/components/schemas/ModelSpecObject'
        max_cardinality:
          type: integer
          minimum: 1
          maximum: 100000
          default: 1000
        sample_size:
          type: integer
          minimum: 10000
          maximum: 100000
          default: 10000
    ModelFactoryResponse:
      type: object
      properties:
        schema:
          $ref: '#/components/schemas/ModelSchemaObjectResponse'
        spec:
          $ref: '#/components/schemas/ModelSpecObject'
    XaiParams:
      type: object
      description: XAI parameters set for a model
      properties:
        custom_explain_methods:
          type: array
          description: >-
            User-defined explain_custom method of the model object defined in
            package.py
          items:
            type: string
        default_explain_method:
          type: string
          description: Default explanation method
    ModelColumnsDataTypeEnum:
      type: string
      description: Data type of the column
      enum:
        - int
        - float
        - str
        - bool
        - category
        - timestamp
        - vector
    ModelTaskParams:
      type: object
      properties:
        binary_classification_threshold:
          type: number
          description: Threshold for labels.
        target_class_order:
          type: array
          description: >-
            If target is categorical, used to map the categories to a scale of
            relevance
          items:
            anyOf:
              - type: string
              - type: number
              - type: boolean
        group_by:
          type: string
          description: Query/session id column for ranking models.
        top_k:
          type: integer
          description: Top k results to consider when computing ranking metrics.
        class_weights:
          type: array
          description: Weight of each class.
          items:
            type: number
        weighted_ref_histograms:
          description: >-
            Whether baseline histograms must be weighted or not when calculating
            drift metrics.
          type: boolean
    ModelSpecObject:
      type: object
      properties:
        schema_version:
          type: integer
          description: Schema version. Internally used. Leave empty.
          default: 1
        inputs:
          type: array
          description: List of input columns
          items:
            type: string
        outputs:
          type: array
          description: List of output columns
          items:
            type: string
        targets:
          type: array
          description: List of target columns
          items:
            type: string
        decisions:
          type: array
          description: List of decision columns
          items:
            type: string
        metadata:
          type: array
          description: List of metadata columns
          items:
            type: string
        custom_features:
          type: array
          description: List of custom feature columns
          items:
            $ref: '#/components/schemas/CustomFeature'
    CustomFeature:
      type: object
      required:
        - name
      properties:
        type:
          type: string
          enum:
            - FROM_COLUMNS
            - FROM_VECTOR
            - FROM_TEXT_EMBEDDING
            - FROM_IMAGE_EMBEDDING
            - ENRICHMENT
        name:
          description: Name of the custom feature
          type: string
        columns:
          type: array
          items:
            type: string
        centroids:
          type: array
          items:
            type: number
        tf_idf:
          type: array
          items:
            type: object
        n_clusters:
          type: integer
        monitor_components:
          type: boolean
    ModelSchemaColumnObject:
      type: object
      description: A model column representation
      required:
        - name
        - data_type
      properties:
        name:
          type: string
          description: Column name
        data_type:
          $ref: '#/components/schemas/ModelColumnsDataTypeEnum'
        min:
          type: number
          description: Min value of integer/float column
        max:
          type: number
          description: Max value of integer/float column
        categories:
          type: array
          description: List of unique values of a categorical column
          items:
            anyOf:
              - type: string
              - type: number
              - type: boolean
        bins:
          type: array
          description: >-
            Bin boundary values for integer/float column histograms. Must be a
            strictly increasing array of numbers spanning [min, max]. If
            omitted, uniform bins are auto-generated from min and max. Minimum 2
            and maximum 16 boundary values (1 to 15 bins).
          items:
            type: number
          maxItems: 16
          minItems: 2
        replace_with_nulls:
          type: array
          description: Replace the list of given values to null if found in the events data
          items:
            anyOf:
              - type: string
              - type: number
        n_dimensions:
          type: integer
          description: Number of dimensions of a vector column
    ModelSchemaColumnObjectResponse:
      allOf:
        - $ref: '#/components/schemas/ModelSchemaColumnObject'
        - type: object
          properties:
            id:
              type: string
              description: Internal column identifier
          required:
            - id
    ModelColumns:
      type: array
      description: List of ModelSchemaColumn
      items:
        $ref: '#/components/schemas/ModelSchemaColumnObjectResponse'
    ModelSchemaObjectRequest:
      type: object
      description: Model schema with the details of each column
      properties:
        schema_version:
          type: integer
          description: Schema version
          default: 1
        columns:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/ModelSchemaColumnObject'
              - type: object
                properties:
                  id:
                    type: string
                    description: Internal column identifier
    ModelSchemaObjectResponse:
      type: object
      description: Model schema with the details of each column
      properties:
        schema_version:
          type: integer
          description: Schema version
          default: 1
        columns:
          type: array
          items:
            $ref: '#/components/schemas/ModelSchemaColumnObjectResponse'
    ModelArtifactsResponse:
      type: object
      required:
        - name
        - size
        - modified
      properties:
        name:
          type: string
        size:
          type: integer
        modified:
          type: string
          format: date-time
    ModelFilesObject:
      type: array
      items:
        $ref: '#/components/schemas/ModelArtifactsResponse'
    ModelDetailResponse:
      required:
        - id
        - name
        - input_type
        - task
        - organization
        - project
        - created_at
        - updated_at
        - status
      allOf:
        - $ref: '#/components/schemas/ModelObject'
        - type: object
          properties:
            task_params:
              $ref: '#/components/schemas/ModelTaskParams'
            schema:
              $ref: '#/components/schemas/ModelSchemaObjectResponse'
            spec:
              $ref: '#/components/schemas/ModelSpecObject'
            event_id_col:
              type: string
              description: Event id column to be found in published data for the model
            event_ts_col:
              type: string
              description: Timestamp column to be found in published data for the model
            event_ts_format:
              type: string
              description: Format of the timestamp like datetime, epoch time etc.
            xai_params:
              $ref: '#/components/schemas/XaiParams'
            artifact_files:
              $ref: '#/components/schemas/ModelFilesObject'
            is_binary_ranking_model:
              type: boolean
    UpdateModelRequest:
      type: object
      properties:
        status:
          type: string
          enum:
            - LIVE
            - DRAFT
          default: LIVE
        version:
          type: string
          minLength: 1
          maxLength: 64
          default: v1
          description: Version of the model
        input_type:
          $ref: '#/components/schemas/ModelInputTypeEnum'
        task:
          $ref: '#/components/schemas/ModelTaskEnum'
        schema:
          $ref: '#/components/schemas/ModelSchemaObjectRequest'
        spec:
          $ref: '#/components/schemas/ModelSpecObject'
        task_params:
          $ref: '#/components/schemas/ModelTaskParams'
        xai_params:
          $ref: '#/components/schemas/XaiParams'
        description:
          type: string
          nullable: true
          description: Description of the model
        owner_id:
          type: string
          nullable: true
          description: User ID for the owner of the model
        deployment_date:
          type: string
          format: date-time
          nullable: true
          description: Date the model was deployed on
        algorithm:
          type: string
          nullable: true
          description: Model algorithm
        framework:
          type: string
          nullable: true
          description: >-
            A string providing information about the software library and
            version used to train and run this model
        event_id_col:
          type: string
          nullable: true
          description: Event id column to be found in published data for the model
        event_ts_col:
          type: string
          nullable: true
          description: Timestamp column to be found in published data for the model
        event_ts_format:
          type: string
          nullable: true
          description: Format of the timestamp like datetime, epoch time etc.
    DebugUpdateModelRequest:
      type: object
      required:
        - reason
      properties:
        name:
          type: string
          description: Name of the model (optional for debug updates)
        version:
          type: string
          minLength: 1
          maxLength: 64
          description: Version of the model (optional for debug updates)
        status:
          type: string
          enum:
            - LIVE
            - DRAFT
          description: Status of the model (optional for debug updates)
        input_type:
          $ref: '#/components/schemas/ModelInputTypeEnum'
        task:
          $ref: '#/components/schemas/ModelTaskEnum'
        schema:
          $ref: '#/components/schemas/ModelSchemaObjectRequest'
        spec:
          $ref: '#/components/schemas/ModelSpecObject'
        task_params:
          $ref: '#/components/schemas/ModelTaskParams'
        xai_params:
          $ref: '#/components/schemas/XaiParams'
        description:
          type: string
          nullable: true
          description: Description of the model (optional for debug updates)
        algorithm:
          type: string
          nullable: true
          description: Model algorithm (optional for debug updates)
        framework:
          type: string
          nullable: true
          description: >-
            Software library and version used to train and run this model
            (optional for debug updates)
        event_id_col:
          type: string
          nullable: true
          description: >-
            Event id column to be found in published data for the model
            (optional for debug updates)
        event_ts_col:
          type: string
          nullable: true
          description: >-
            Timestamp column to be found in published data for the model
            (optional for debug updates)
        event_ts_format:
          type: string
          nullable: true
          description: >-
            Format of the timestamp like datetime, epoch time etc. (optional for
            debug updates)
        deployment_date:
          type: string
          format: date-time
          nullable: true
          description: Date the model was deployed on (optional for debug updates)
        reason:
          type: string
          minLength: 1
          maxLength: 500
          description: Reason for the debug update (required for audit trail)
    AddModelRequestBody:
      type: object
      required:
        - name
        - project_id
        - input_type
        - task
        - schema
        - spec
      properties:
        name:
          type: string
          description: Name of the model
        version:
          type: string
          minLength: 1
          maxLength: 64
          default: v1
          description: Version of the model
        project_id:
          type: string
          format: uuid
          description: UUID format unique identifier for the project the model is added in
        status:
          type: string
          enum:
            - LIVE
            - DRAFT
          default: LIVE
        input_type:
          $ref: '#/components/schemas/ModelInputTypeEnum'
        task:
          $ref: '#/components/schemas/ModelTaskEnum'
        schema:
          $ref: '#/components/schemas/ModelSchemaObjectRequest'
        spec:
          $ref: '#/components/schemas/ModelSpecObject'
        task_params:
          $ref: '#/components/schemas/ModelTaskParams'
        xai_params:
          $ref: '#/components/schemas/XaiParams'
        description:
          type: string
          nullable: true
          description: Description of the model
        owner_id:
          type: string
          nullable: true
          description: User ID for the owner of the model
        deployment_date:
          type: string
          format: date-time
          nullable: true
          description: Date the model was deployed on
        algorithm:
          type: string
          nullable: true
          description: Model algorithm
        framework:
          type: string
          nullable: true
          description: >-
            A string providing information about the software library and
            version used to train and run this model
        event_id_col:
          type: string
          nullable: true
          description: Event id column to be found in published data for the model
        event_ts_col:
          type: string
          nullable: true
          description: Timestamp column to be found in published data for the model
        event_ts_format:
          type: string
          nullable: true
          description: Format of the timestamp like datetime, epoch time etc.
    GridProps:
      type: object
      title: GridProps
      required:
        - position_x
        - position_y
        - width
        - height
      properties:
        position_x:
          type: number
        position_y:
          type: number
        width:
          type: number
        height:
          type: number
      additionalProperties: false
    DashboardLayout:
      type: object
      title: DashboardLayout
      required:
        - chart_uuid
        - grid_props
      properties:
        chart_uuid:
          type: string
          format: uuid
        grid_props:
          $ref: '#/components/schemas/GridProps'
        options:
          type: object
    _DeploymentParams:
      type: object
      properties:
        deployment_type:
          type: string
          enum:
            - BASE_CONTAINER
          description: Model deployment type
        image_uri:
          type: string
          description: Model deployment docker image uri
        replicas:
          type: integer
          description: Number of model deployment pods to be active
          example: 2
          minimum: 1
          maximum: 10
          default: 1
        cpu:
          type: integer
          description: Amount of millicpus to allocate per replica
          example: 500
          minimum: 1
          maximum: 4000
          default: 1
        memory:
          type: integer
          description: Amount of MiBs to allocate per replica
          example: 512
          minimum: 150
          maximum: 16384
          default: 150
    _SurrogateDeploymentParams:
      description: Additoinal paramteres specified to deploy surrogate model
      allOf:
        - type: object
          properties:
            artifact_type:
              description: Type of the artifact
              type: string
              enum:
                - SURROGATE
        - $ref: '#/components/schemas/_DeploymentParams'
    DeploySurrogateRequest:
      type: object
      description: Request payload for to deploy a surrogate model
      required:
        - env_id
        - deployment_params
      properties:
        env_id:
          type: string
          format: uuid
          description: Unique identifier of the environment associated to the model
        deployment_params:
          $ref: '#/components/schemas/_SurrogateDeploymentParams'
    ListModelResponse:
      type: array
      items:
        $ref: '#/components/schemas/ModelObject'
    DeleteModelResponse:
      type: object
      properties:
        job:
          $ref: '#/components/schemas/JobCompact'
    ModelDeploymentResponse:
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
            model:
              $ref: '#/components/schemas/ModelCompact'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            project:
              $ref: '#/components/schemas/ProjectCompact'
            artifact_type:
              $ref: '#/components/schemas/ArtifactTypeEnum'
            deployment_type:
              type: string
              enum:
                - BASE_CONTAINER
            active:
              type: boolean
            image_uri:
              type: string
            replicas:
              type: integer
            cpu:
              type: integer
              description: In millcpu
            memory:
              type: integer
              description: In mebibytes
        - $ref: '#/components/schemas/CreateAndUpdateMetaDetails'
    ModelDeploymentUpdateRequest:
      type: object
      properties:
        active:
          type: boolean
        replicas:
          type: integer
          minimum: 1
          maximum: 10
        cpu:
          type: integer
          description: In millcpu
          minimum: 10
          maximum: 4000
        memory:
          type: integer
          description: In mebibytes
          minimum: 150
          maximum: 16384
    ModelDeploymentUpdateResponse:
      allOf:
        - $ref: '#/components/schemas/ModelDeploymentResponse'
        - type: object
          properties:
            job:
              $ref: '#/components/schemas/JobCompact'
    Metrics:
      type: object
      required:
        - traffic_count
        - triggered_alerts
      properties:
        traffic_count:
          type: integer
        triggered_alerts:
          type: integer
    MonitoringSummaryObject:
      type: object
      required:
        - project
        - model
        - default_dashboard_id
        - last_event_time
        - metrics
      properties:
        project:
          $ref: '#/components/schemas/ProjectCompact'
        model:
          allOf:
            - $ref: '#/components/schemas/ModelCompact'
            - type: object
              properties:
                created_at:
                  type: string
                  format: date-time
              required:
                - created_at
        default_dashboard_id:
          type: string
          format: uuid
        last_event_time:
          type: string
          format: date-time
        metrics:
          $ref: '#/components/schemas/Metrics'
    MonitoringSummaryResponse:
      type: object
      required:
        - last_cached_time
        - summary
      properties:
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        last_cached_time:
          type: string
          format: date-time
        summary:
          type: array
          items:
            $ref: '#/components/schemas/MonitoringSummaryObject'
    HistogramRequestPayload:
      type: object
      required:
        - baseline_id
        - start_time
        - bin_size
        - column_id
      properties:
        baseline_id:
          type: string
          format: uuid
        segment_id:
          type: string
          format: uuid
        start_time:
          type: string
          format: date-time
        bin_size:
          type: string
          enum:
            - Hour
            - Day
            - Week
            - Month
            - Quarter
        time_zone:
          type: string
          default: Etc/GMT
        column_id:
          type: string
        max_bins:
          type: number
          format: int
        normalize:
          type: boolean
    HistogramObject:
      type: object
      required:
        - organization
        - project
        - model
        - baseline
        - column_id
        - bins
        - baseline_histogram
        - production_histogram
        - num_actual_bins
      properties:
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        model:
          $ref: '#/components/schemas/ModelCompact'
        baseline:
          $ref: '#/components/schemas/BaselineCompact'
        segment:
          $ref: '#/components/schemas/SegmentCompact'
        column_id:
          type: string
        bins:
          type: array
          items:
            type: string
        baseline_histogram:
          type: array
          items:
            type: number
            format: float
        production_histogram:
          type: array
          items:
            type: number
            format: float
        num_actual_bins:
          type: number
          format: int
    ModelHealthResponse:
      type: object
      required:
        - last_cached_time
        - summary
      properties:
        last_cached_time:
          description: Date time of the last time data was cached
          type: string
          format: date-time
        summary:
          $ref: '#/components/schemas/ModelHealthSummary'
    ModelHealthSummary:
      type: array
      description: List of summary data for each model
      items:
        $ref: '#/components/schemas/ModelHealthObject'
    ModelHealthObject:
      type: object
      description: Model Health details for a given model
      required:
        - model
        - project
        - traffic
      properties:
        type:
          $ref: '#/components/schemas/ModelHealthType'
        model:
          allOf:
            - $ref: '#/components/schemas/ModelCompact'
            - $ref: '#/components/schemas/ModelProperties'
        project:
          $ref: '#/components/schemas/ProjectCompact'
        traffic:
          $ref: '#/components/schemas/ModelHealthTraffic'
        health_state:
          $ref: '#/components/schemas/ModelAlertState'
    ModelHealthType:
      type: string
      description: Enum describing the state of the model
      enum:
        - Monitored
        - Active
        - Onboarded
        - Inactive
    ModelProperties:
      type: object
      description: Properties about the model
      required:
        - version
        - task
        - column_count
        - created_at
      properties:
        version:
          description: Model version - always using the latest one
          type: string
        task:
          $ref: '#/components/schemas/ModelTaskEnum'
        column_count:
          description: Number of columns for this model (all column types)
          type: integer
        created_at:
          description: Date model was created in Fiddler
          type: string
          format: date-time
        deployment_date:
          description: Date model was deployed
          type: string
          format: date-time
        description:
          description: Free form text to describe the model
          type: string
        default_dashboard_id:
          type: string
          format: uuid
        owner:
          description: owner of the model
          type: object
          properties:
            id:
              description: user id
              type: string
            full_name:
              description: full name
              type: string
          required:
            - id
    ModelHealthTraffic:
      type: object
      description: Traffic details for a model
      required:
        - last_event_time
        - current_window_count
        - previous_window_percent_change
      properties:
        current_window_count:
          description: Traffic for the desired window ( for example past 7 days)
          type: integer
        last_event_time:
          description: datetime of the last occurred at event
          type: string
          format: date-time
        previous_window_percent_change:
          description: >-
            Percentage change in traffic compared to previous window (for
            example previous 7 days)
          type: number
        current_window_distribution:
          $ref: '#/components/schemas/TrafficDistribution'
    TrafficDistribution:
      type: object
      description: Distribution of traffic per day
      required:
        - date
        - count
      properties:
        date:
          description: list of dates
          type: array
          items:
            type: string
            format: date-time
        count:
          description: list of traffic corresponding to the dates
          type: array
          items:
            type: integer
    ModelAlertState:
      type: object
      description: Metric details for triggered alerts per metric type
      properties:
        traffic:
          $ref: '#/components/schemas/ModelAlertSummaryForMetric'
        data_drift:
          $ref: '#/components/schemas/ModelAlertSummaryForMetric'
        prediction_drift:
          $ref: '#/components/schemas/ModelAlertSummaryForMetric'
        data_integrity:
          $ref: '#/components/schemas/ModelAlertSummaryForMetric'
        performance:
          $ref: '#/components/schemas/ModelAlertSummaryForMetric'
    ModelAlertSummaryForMetric:
      type: object
      description: Metric details (global status and triggered alert details) for a model
      required:
        - status
        - triggered_alert_count
      properties:
        status:
          $ref: '#/components/schemas/ModelHealthStatus'
        triggered_alert_count:
          type: integer
        triggered_alerts:
          $ref: '#/components/schemas/TriggeredAlertSummary'
    ModelHealthStatus:
      type: string
      description: Global model health status
      enum:
        - critical
        - warning
        - passing
        - no_label
        - no_outputs
        - no_valid_data
        - no_alert
    TriggeredAlertSummary:
      type: object
      description: Details of each issue type (triggered alerts)
      properties:
        critical:
          oneOf:
            - $ref: '#/components/schemas/TriggeredAlertCount'
            - $ref: '#/components/schemas/TriggeredAlertCountDataIntegrity'
        warning:
          oneOf:
            - $ref: '#/components/schemas/TriggeredAlertCount'
            - $ref: '#/components/schemas/TriggeredAlertCountDataIntegrity'
    TriggeredAlertCount:
      type: object
      description: Count of alerts and columns with triggered alerts
      required:
        - response_type
      properties:
        response_type:
          description: Response type for data drift, traffic and performance
          type: string
          enum:
            - base
        triggered_alert_count:
          description: Number of alert for a given issue severity
          type: integer
        column_count:
          description: Number of columns with alerts
          type: integer
    TriggeredAlertCountDataIntegrity:
      type: object
      description: Triggered Alert details per DI category
      required:
        - response_type
      properties:
        response_type:
          description: Response type for data integrity
          type: string
          enum:
            - data_integrity
        missing_violation:
          $ref: '#/components/schemas/TriggeredAlertCount'
        range_violation:
          $ref: '#/components/schemas/TriggeredAlertCount'
        type_violation:
          $ref: '#/components/schemas/TriggeredAlertCount'
    UserOrgRoleRequestBody:
      type: object
      required:
        - role_name
      properties:
        role_name:
          type: string
          enum:
            - Org Member
            - Org Admin
            - Org Viewer
            - Deactivated
    UserOrgRoleInfo:
      type: object
      required:
        - user
        - organization
        - role
      properties:
        id:
          type: string
          format: uuid
        role_name:
          type: string
          enum:
            - Org Member
            - Org Admin
            - Org Viewer
            - Deactivated
        user:
          allOf:
            - $ref: '#/components/schemas/UserCompact'
            - type: object
              properties:
                username:
                  type: string
        organization:
          allOf:
            - $ref: '#/components/schemas/OrganizationCompact'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    OrganizationSettingsRequestBody:
      type: object
      properties:
        emailService:
          type: object
          properties:
            host:
              type: string
            port:
              type: string
            user:
              type: string
            password:
              type: string
        activeEmailService:
          type: string
        emailTimeZone:
          type: string
    OrganizationSettings:
      type: object
      properties:
        emailService:
          type: object
          properties:
            host:
              type: string
            port:
              type: string
            user:
              type: string
            password:
              type: string
        activeEmailService:
          type: string
        emailTimeZone:
          type: string
    PagerdutyService:
      type: object
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            key:
              type: string
            created_at:
              type: string
              format: date-time
              description: Timestamp indicating when the Pagerduty Service was created.
            updated_at:
              type: string
              format: date-time
              description: >-
                Timestamp indicating when the Pagerduty Service was last
                updated.
            created_by:
              $ref: '#/components/schemas/UserCompact'
            updated_by:
              $ref: '#/components/schemas/UserCompact'
          required:
            - id
            - name
            - key
            - created_at
            - updated_at
            - created_by
            - updated_by
    CreatePagerdutyService:
      type: object
      allOf:
        - type: object
          properties:
            name:
              type: string
              pattern: ^\S(.*\S)?$
              nullable: false
            key:
              type: string
              pattern: ^\S(.*\S)?$
              nullable: false
          required:
            - name
            - key
    UpdatePagerdutyService:
      type: object
      minProperties: 1
      properties:
        name:
          type: string
          pattern: ^\S(.*\S)?$
          nullable: false
        key:
          type: string
          pattern: ^\S(.*\S)?$
          nullable: false
    ProjectRequest:
      type: object
      title: ProjectRequest
      description: Request body for creating a project
      required:
        - name
        - asset_type
      properties:
        name:
          description: Name of the project
          type: string
        asset_type:
          $ref: '#/components/schemas/AssetsType'
    Projects:
      type: array
      description: List of projects
      items:
        $ref: '#/components/schemas/Project'
    Project:
      type: object
      description: Details of the project
      required:
        - id
        - name
        - asset_type
        - organization
        - created_at
        - updated_at
      allOf:
        - type: object
          properties:
            id:
              description: Unique identifier of the project
              type: string
              format: uuid
            name:
              description: Name of the project
              type: string
            asset_type:
              $ref: '#/components/schemas/AssetsType'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
            asset_count:
              type: integer
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    AssetsType:
      type: string
      description: Type of project
      enum:
        - ML_MODEL
        - GEN_AI_APP
    ProjectRoleCreateRequestV3:
      title: ProjectRoleCreateRequestV3
      description: >
        Request body for assigning a project role to a user or team. Exactly one
        of `user_id` or `team_id` must be provided; supplying both or neither is
        a validation error.
      oneOf:
        - $ref: '#/components/schemas/ProjectRoleCreateUserV3'
        - $ref: '#/components/schemas/ProjectRoleCreateTeamV3'
    ProjectRoleCreateUserV3:
      type: object
      title: ProjectRoleCreateUserV3
      description: Assign a project role to a user.
      required:
        - project_id
        - user_id
        - role
      properties:
        project_id:
          type: string
          format: uuid
          description: UUID of the project.
        user_id:
          type: string
          format: uuid
          description: UUID of the user to assign the role to.
        role:
          $ref: '#/components/schemas/ProjectRoleEnum'
    ProjectRoleCreateTeamV3:
      type: object
      title: ProjectRoleCreateTeamV3
      description: Assign a project role to a team.
      required:
        - project_id
        - team_id
        - role
      properties:
        project_id:
          type: string
          format: uuid
          description: UUID of the project.
        team_id:
          type: string
          format: uuid
          description: UUID of the team to assign the role to.
        role:
          $ref: '#/components/schemas/ProjectRoleEnum'
    ProjectRoleUpdateRequestV3:
      type: object
      title: ProjectRoleUpdateRequestV3
      description: >-
        Request body for updating the role on an existing project role
        assignment.
      required:
        - role
      properties:
        role:
          $ref: '#/components/schemas/ProjectRoleEnum'
    AssignableUser:
      type: object
      title: AssignableUser
      description: >
        A user who can be assigned an explicit project role. Includes the user's
        organization role for display context (e.g., to show "Org Member" or
        "Org Viewer" next to each name in the assignment dropdown).
      allOf:
        - $ref: '#/components/schemas/UserCompact'
        - type: object
          properties:
            username:
              type: string
              description: Username of the user.
            org_role:
              allOf:
                - $ref: '#/components/schemas/OrgRoleEnum'
              description: >
                The user's current organization-level role. Org Admins are not
                returned by this endpoint when
                ENABLE_ORG_ADMIN_IMPLICIT_PROJECT_ADMIN is enabled, since they
                have implicit Project Admin access.
          required:
            - org_role
    AssignableTeam:
      type: object
      title: AssignableTeam
      description: |
        A team that can be assigned an explicit project role.
      allOf:
        - $ref: '#/components/schemas/TeamCompact'
    ScoreResponse:
      type: object
      description: Score resource returned by all read endpoints.
      properties:
        id:
          type: string
          format: uuid
          description: Unique score identifier
        application_id:
          type: string
          format: uuid
          description: Application this score belongs to
        name:
          type: string
          description: Score name (e.g. "correctness", "relevance")
        config_name:
          type: string
          nullable: true
          description: Configuration name. Defaults to name if not provided.
        config_id:
          type: integer
          nullable: true
          description: Configuration ID. Reserved for future use — currently always 0.
        score_level:
          type: string
          enum:
            - span
            - trace
            - session
          description: Target level inferred from which target ID was provided
        score_type:
          type: string
          enum:
            - numeric
            - boolean
            - categorical
            - text
            - vector
          description: >
            Type of score value. Determines which value field is populated. For
            vector-typed scores (created by evaluators, not via this API),
            value, label, and text are all null — the underlying vector data is
            not exposed through this endpoint. Consumers can filter these out
            using the score_type query parameter on the list endpoint.
        span_id:
          type: string
          nullable: true
          description: Target span ID (set when score_level is span)
        trace_id:
          type: string
          nullable: true
          description: Target trace ID (set when score_level is trace)
        session_id:
          type: string
          nullable: true
          description: Target session ID (set when score_level is session)
        source:
          type: string
          enum:
            - evaluator
            - human
            - llm
            - code
          description: Origin of this score
        annotator_id:
          type: string
          nullable: true
          description: >
            Annotator identifier. For source=human, populated from auth token.
            For source=llm or source=code, set from request.
        value:
          type: number
          format: double
          nullable: true
          description: Numeric value (set for numeric and boolean score types)
        label:
          type: string
          nullable: true
          description: Categorical label (set for categorical score type)
        text:
          type: string
          nullable: true
          description: Text value (set for text score type)
        reasoning:
          type: string
          nullable: true
          description: Optional reasoning or explanation for the score
        metadata:
          type: object
          additionalProperties:
            type: string
          nullable: true
          description: Arbitrary key-value metadata (string to string map)
        status:
          type: string
          nullable: true
          description: Evaluator execution status (evaluator scores only)
        error_reason:
          type: string
          nullable: true
          description: Error classification (evaluator scores only)
        error_message:
          type: string
          nullable: true
          description: Error details (evaluator scores only)
        created_at:
          type: string
          format: date-time
          description: Timestamp when the score was created
        updated_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of the most recent update
        timestamp:
          type: string
          format: date-time
          description: >
            Event timestamp — when the underlying span/trace/session occurred.
            Distinct from created_at (when this score record was written).
            Filterable via start_time/end_time; sortable via ordering=timestamp.
    BaseScoreFields:
      type: object
      description: >
        Common fields shared by CreateScoreRequest and BulkScoreItem. Not used
        directly — referenced via allOf composition.
      properties:
        id:
          type: string
          format: uuid
          description: >
            Optional client-provided score ID for upsert. If not provided, a
            deterministic UUID v5 is generated from (application_id, target_id,
            name, annotator_id).
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: Score name (e.g. "correctness")
        span_id:
          type: string
          description: >-
            Target span ID. Exactly one of span_id, trace_id, or session_id is
            required.
        trace_id:
          type: string
          description: >-
            Target trace ID. Exactly one of span_id, trace_id, or session_id is
            required.
        session_id:
          type: string
          description: >-
            Target session ID. Exactly one of span_id, trace_id, or session_id
            is required.
        score_type:
          type: string
          enum:
            - numeric
            - boolean
            - categorical
            - text
          description: >
            Score type. Determines which value field is required. Vector type is
            not accepted on create (used by evaluators only).
        value:
          type: number
          format: double
          description: >
            Numeric value. Required for numeric type. For boolean type, must be
            exactly 1.0 or 0.0 (runtime-validated; out-of-range values return
            422).
        label:
          type: string
          description: Categorical label. Required for categorical type.
        text:
          type: string
          maxLength: 65536
          description: Text content. Required for text type.
        source:
          type: string
          enum:
            - human
            - llm
            - code
          description: >
            Score source. Evaluator is not accepted (evaluator scores are
            created by the enrichment worker, not via this API).
        annotator_id:
          type: string
          description: >
            Annotator identifier. Required for source=llm and source=code.
            Ignored for source=human (backend populates from auth token).
        reasoning:
          type: string
          description: Optional reasoning or explanation
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Arbitrary key-value metadata (string to string map)
        config_name:
          type: string
          description: Configuration name. Defaults to name if not provided.
    CreateScoreRequest:
      allOf:
        - $ref: '#/components/schemas/BaseScoreFields'
        - type: object
          description: Request body for creating a score.
          required:
            - application_id
            - name
            - score_type
            - source
          properties:
            application_id:
              type: string
              format: uuid
              description: Application UUID
    UpdateScoreRequest:
      type: object
      description: >
        Request body for partially updating a score. Only provided fields are
        updated. Identity and structural fields (name, score_type, source,
        targets, annotator_id) cannot be changed — annotator_id is immutable
        after creation; create a new score to reassign.
      properties:
        value:
          type: number
          format: double
          nullable: true
          description: Updated numeric value
        label:
          type: string
          nullable: true
          description: Updated categorical label
        text:
          type: string
          nullable: true
          maxLength: 65536
          description: Updated text content
        reasoning:
          type: string
          nullable: true
          description: Updated reasoning
        metadata:
          type: object
          additionalProperties:
            type: string
          nullable: true
          description: Updated metadata (replaces entire map)
      additionalProperties: false
    BulkCreateScoresRequest:
      type: object
      description: Request body for bulk score creation.
      required:
        - application_id
        - scores
      properties:
        application_id:
          type: string
          format: uuid
          description: Application UUID (shared across all items)
        scores:
          type: array
          minItems: 1
          maxItems: 100
          description: List of scores to create (max 100)
          items:
            $ref: '#/components/schemas/BulkScoreItem'
      additionalProperties: false
    BulkScoreItem:
      allOf:
        - $ref: '#/components/schemas/BaseScoreFields'
        - type: object
          description: >
            Single item in a bulk create request. Same fields as
            CreateScoreRequest except application_id (provided at top level).
          required:
            - name
            - score_type
            - source
    BulkCreateScoresResponse:
      type: object
      description: Response from bulk score creation.
      properties:
        created:
          type: integer
          description: Number of scores successfully created
        errors:
          type: array
          description: Per-item validation errors (empty when all items succeed)
          items:
            $ref: '#/components/schemas/BulkScoreError'
    BulkScoreError:
      type: object
      description: Error detail for a single item in a bulk request.
      properties:
        index:
          type: integer
          description: Zero-based index of the failed item in the request array
        message:
          type: string
          description: Human-readable error message
    SearchableTextKey:
      type: object
      required:
        - attribute_key
      properties:
        attribute_key:
          type: string
          maxLength: 256
          description: >-
            OTel attribute key whose values are indexed for full-text search
            (e.g. `gen_ai.prompt`, `input.value`).
    AttributeKeyList:
      type: object
      required:
        - attribute_keys
      properties:
        attribute_keys:
          type: array
          minItems: 1
          maxItems: 50
          items:
            type: string
            maxLength: 256
          description: List of OTel attribute keys.
    CreateSegmentRequest:
      type: object
      required:
        - model_id
        - name
        - definition
      properties:
        model_id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        definition:
          type: string
    SemanticMapping:
      type: object
      required:
        - original_name
        - semantic_name
      properties:
        original_name:
          type: string
          maxLength: 256
          description: >-
            Raw OTel attribute key (e.g. `gen_ai.usage.input_tokens`,
            `input.value`).
        semantic_name:
          $ref: '#/components/schemas/SemanticConcept'
    CreateSemanticMappingRequest:
      type: object
      required:
        - mappings
      properties:
        mappings:
          type: array
          minItems: 1
          maxItems: 100
          items:
            $ref: '#/components/schemas/SemanticMapping'
    DeleteSemanticMappingRequest:
      type: object
      required:
        - original_names
      properties:
        original_names:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: string
            maxLength: 256
          description: List of original names to delete.
    ServerInfoResponse:
      type: object
      properties:
        server_version:
          type: string
          example: 23.6.0
          description: The version of the Fiddler server.
        feature_flags:
          type: object
          properties:
            fairness:
              type: boolean
              example: false
              description: Indicates if the fairness feature is enabled on the server.
            enable_rca_performance_tab_ui:
              type: boolean
              example: false
            enable_rca_analyze_tab_ui:
              type: boolean
              example: true
            enable_webhooks_ui:
              type: boolean
              example: true
            enable_unity_analyze_charts_ui:
              type: boolean
              example: false
            enable_xai_umap:
              type: boolean
              example: false
            enable_deckgl_ui:
              type: boolean
              example: false
            enable_ml_model_health_page_ui:
              type: boolean
              example: false
            enable_llm_applications_page_ui:
              type: boolean
              example: false
            enable_dashboard_markdown_ui:
              type: boolean
              example: false
            enable_deckgl_advanced_selection_ui:
              type: boolean
              example: false
            enable_evals:
              type: boolean
              example: false
            enable_evaluator_downsampling_enforcement:
              type: boolean
              example: false
            enable_llm_gateway_ui:
              type: boolean
              example: false
              description: Indicates if the LLM Gateway UI is enabled.
            enable_llm_gateway_proxy:
              type: boolean
              example: false
              description: >-
                Indicates if the LLM Gateway proxy service is enabled. When
                enabled, the proxy also provides guardrails (PII/secrets
                detection).
            enable_inference_server_v2:
              type: boolean
              example: false
              description: Indicates if the inference server v2 is enabled.
            enable_unity_monitoring_charts_ui:
              type: boolean
              example: false
            enable_model_metrics_api:
              type: boolean
              example: true
            enable_dimensionality_reduction_api:
              type: boolean
              example: false
            enable_posthog:
              type: boolean
              example: true
            enable_model_updates:
              type: boolean
              example: false
            enable_add_model_ui:
              type: boolean
              example: false
            enable_intercom_users:
              type: boolean
              example: false
            enable_freemium_guardrails:
              type: boolean
              example: false
            enable_service_provider_authn:
              type: boolean
              example: false
            enable_dashboard_viewer_access:
              type: boolean
              example: false
            enable_executive_dashboard_ui:
              type: boolean
              example: false
            enable_llm_custom_metrics_page_ui:
              type: boolean
              example: false
            enable_rca_column_filtering_ui:
              type: boolean
              example: false
            enable_org_admin_implicit_project_admin:
              type: boolean
              example: false
            enable_otel_schema_v2:
              type: boolean
              example: false
              description: >-
                Enables the v2 OTel schema for span queries and attribute
                discovery.
            enable_legacy_access_key_creation:
              type: boolean
              example: false
            enable_human_annotations_ui:
              type: boolean
              example: false
              description: >-
                Indicates if the human annotations UI (span-level scoring) is
                enabled.
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
    DeleteSessionsRequest:
      type: object
      description: Request to delete sessions by ID
      required:
        - application_id
        - session_ids
      properties:
        application_id:
          type: string
          format: uuid
          description: UUID of the application
        session_ids:
          type: array
          description: List of session IDs to delete
          items:
            $ref: '#/components/schemas/SessionId'
          minItems: 1
          maxItems: 1000
    SearchScope:
      type: string
      enum:
        - all
        - input
        - output
    SearchFilter:
      type: object
      required:
        - query
      properties:
        query:
          type: string
          description: Free-form search text. Case-insensitive substring match.
          minLength: 3
          maxLength: 64
        scope:
          $ref: '#/components/schemas/SearchScope'
    EvaluatorScore:
      type: object
      required:
        - evaluator_rule_name
        - output_name
      properties:
        evaluator_rule_name:
          type: string
          description: Name of the evaluator rule that produced this score
        output_name:
          type: string
          description: Name of the specific output within the rule
        value:
          type: number
          format: float
          nullable: true
          description: Numeric score value (float), or null for categorical outputs
        label:
          type: string
          nullable: true
          description: Categorical/string score value, or null for numeric outputs
    SpanQueryRequest:
      type: object
      required:
        - application_id
        - start_time
        - end_time
      properties:
        application_id:
          type: string
          format: uuid
        start_time:
          type: string
          format: date-time
          description: Start of the time range (inclusive, UTC).
        end_time:
          type: string
          format: date-time
          description: End of the time range (exclusive, UTC).
        filter:
          description: >-
            Optional structured filter tree. Maximum nesting depth is 3 levels
            and maximum total rule count is 10.
          allOf:
            - $ref: '#/components/schemas/QueryCondition'
        search:
          $ref: '#/components/schemas/SearchFilter'
        ordering:
          type: string
          description: Sort field with optional leading "-" for descending
          default: '-start_time'
        page_size:
          type: integer
          minimum: 1
          maximum: 200
          default: 50
        offset:
          type: integer
          minimum: 0
          maximum: 10000
          default: 0
    Span:
      type: object
      description: Canonical flat span schema returned by the span query endpoint.
      required:
        - span_id
        - trace_id
        - name
        - status_code
        - start_time
        - duration
      properties:
        span_id:
          type: string
          description: OpenTelemetry span ID (hex string)
        trace_id:
          $ref: '#/components/schemas/TraceId'
        parent_span_id:
          type: string
          description: Parent span ID, or null for root spans
          nullable: true
        session_id:
          allOf:
            - $ref: '#/components/schemas/SessionId'
          nullable: true
        name:
          type: string
          description: Human-readable span name
        span_type:
          type: string
          description: Fiddler span type (llm, tool, agent, chain)
          nullable: true
        status_code:
          type: string
          description: OpenTelemetry status code string (e.g. Ok, Error, Unset)
        status_message:
          type: string
          description: Human-readable status message
          nullable: true
        start_time:
          type: string
          format: date-time
          description: Span start time (UTC)
        duration:
          type: integer
          description: Span duration in nanoseconds
        agent_id:
          type: string
          description: Fiddler agent ID
          nullable: true
        agent_name:
          type: string
          description: Fiddler agent name
          nullable: true
        input:
          type: string
          description: LLM/tool input content
          nullable: true
        output:
          type: string
          description: LLM/tool output content
          nullable: true
        span_attributes:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: >-
            Key-value map of user-defined span attributes. Each value is a
            scalar string (or null when no value was recorded). The underlying
            ClickHouse groupArrayMap returns arrays; the API layer unwraps each
            to a single string before returning.
        evaluators:
          type: array
          items:
            $ref: '#/components/schemas/EvaluatorScore'
        resource_attributes:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: OTel resource attributes (e.g. service.name, deployment.environment)
        service_name:
          type: string
          nullable: true
          description: OTel service name from resource attributes
        span_kind:
          type: string
          nullable: true
          description: OTel span kind (INTERNAL, CLIENT, SERVER, PRODUCER, CONSUMER)
        events:
          type: array
          items:
            $ref: '#/components/schemas/SpanEvent'
          description: Span events (e.g. exceptions, log entries)
        links:
          type: array
          items:
            $ref: '#/components/schemas/SpanLink'
          description: Links to related spans in the same or different trace
        semantic_mapping:
          type: object
          additionalProperties:
            type: string
          description: >-
            Lookup table mapping semantic concept names to the attribute key
            that carries that concept's value for this span. Use with
            span_attributes: span_attributes[semantic_mapping["input_tokens"]]
            gives the input token count. First match per concept when multiple
            keys map to the same concept. Only populated by the V2 code path.
    SpanEvent:
      type: object
      description: A single event recorded during a span's lifetime.
      required:
        - timestamp
        - name
      properties:
        timestamp:
          type: string
          format: date-time
          description: Event timestamp (UTC)
        name:
          type: string
          description: Event name (e.g. exception, gen_ai.content.prompt)
        attributes:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: Event attributes
    SpanLink:
      type: object
      description: A link from this span to another span.
      required:
        - trace_id
        - span_id
      properties:
        trace_id:
          type: string
          description: Linked span's trace ID
        span_id:
          type: string
          description: Linked span's span ID
        trace_state:
          type: string
          nullable: true
          description: W3C trace state of the linked span
        attributes:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: Link attributes
    SpanQueryResponseItems:
      type: array
      items:
        $ref: '#/components/schemas/Span'
    SpanFieldsRequest:
      type: object
      required:
        - application_id
        - start_time
        - end_time
      properties:
        application_id:
          type: string
          format: uuid
          description: UUID of the GenAI application to query spans from
        start_time:
          type: string
          format: date-time
          description: Start of the time range (inclusive, UTC).
        end_time:
          type: string
          format: date-time
          description: End of the time range (exclusive, UTC).
        filter:
          description: >-
            Optional structured filter tree. Uses the same DSL as POST
            /spans/query. Maximum nesting depth is 3 levels and maximum total
            rule count is 10.
          allOf:
            - $ref: '#/components/schemas/QueryCondition'
        search:
          $ref: '#/components/schemas/SearchFilter'
    SpanAttributeCoverage:
      type: object
      required:
        - key
        - count
      properties:
        key:
          type: string
          description: Span attribute key (e.g. "system.gen_ai.usage.input_tokens")
        count:
          type: integer
          description: >-
            Number of spans (within the sample) that have this attribute key.
            Divide by total_spans to get the coverage ratio.
    EvaluatorOutputCoverage:
      type: object
      required:
        - rule_name
        - output_name
        - count
      properties:
        rule_name:
          type: string
          description: Name of the evaluator rule
        output_name:
          type: string
          description: Name of the specific output within the rule
        count:
          type: integer
          description: >-
            Number of spans (within the sample) that have a score for this
            evaluator output.
    SpanFieldsResponse:
      type: object
      required:
        - total_spans
        - sampled
        - span_attributes
        - evaluator_outputs
      properties:
        total_spans:
          type: integer
          description: >-
            Number of spans used to compute coverage. Capped at 10,000. When
            sampled is true this is 10,000 and counts are approximate; when
            sampled is false this is the exact number of matching spans.
        sampled:
          type: boolean
          description: >-
            True when the result is based on a 10,000-span sample of a larger
            result set. Counts are approximate in this case.
        span_attributes:
          type: array
          items:
            $ref: '#/components/schemas/SpanAttributeCoverage'
          description: >-
            Span attribute keys found across the sampled spans, each with a
            coverage count.
        evaluator_outputs:
          type: array
          items:
            $ref: '#/components/schemas/EvaluatorOutputCoverage'
          description: >-
            Evaluator rule/output pairs found across the sampled spans, each
            with a coverage count.
    TeamRoleRequest:
      type: object
      title: TeamRole Request
      description: Request body for create team roles
      required:
        - user_id
        - team_id
      properties:
        user_id:
          type: string
          format: uuid
        team_id:
          type: string
          format: uuid
    TeamRole:
      type: object
      title: TeamRole
      description: >-
        Team Role response object. Every team role entry indicates which user
        belongs to which team.
      required:
        - role
        - uuid
        - user
        - team
        - created_at
        - updated_at
      allOf:
        - type: object
          properties:
            role:
              type: string
            uuid:
              type: string
              format: uuid
            user:
              $ref: '#/components/schemas/UserCompact'
            team:
              $ref: '#/components/schemas/TeamCompact'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    TeamRequest:
      type: object
      title: TeamRequest
      description: Request body for create team
      required:
        - name
      properties:
        name:
          type: string
    Teams:
      type: array
      items:
        $ref: '#/components/schemas/Team'
    Team:
      type: object
      required:
        - id
        - name
        - members
        - organization
        - created_at
        - updated_at
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            members:
              $ref: '#/components/schemas/TeamMembers'
            organization:
              $ref: '#/components/schemas/OrganizationCompact'
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
    TeamMembers:
      type: array
      items:
        $ref: '#/components/schemas/TeamMember'
    TeamMember:
      type: object
      properties:
        id:
          description: Team membership(user to team mapping) uuid
          type: string
          format: uuid
        role:
          type: string
          enum:
            - MEMBER
        user:
          $ref: '#/components/schemas/TeamMemberUserSchema'
    TeamMemberUserSchema:
      type: object
      properties:
        id:
          type: string
          format: uuid
        email:
          type: string
          format: email
    ListSessionsRequestBody:
      type: object
      required:
        - application_id
        - filters
        - time_range
      properties:
        application_id:
          type: string
          format: uuid
        time_range:
          type: object
          properties:
            start_time:
              type: string
              format: date-time
            end_time:
              type: string
              format: date-time
          required:
            - start_time
            - end_time
        endtime_timestamp:
          type: string
          format: date-time
          description: >-
            end time (in UTC) to fetch data to avoid new sessions showing up
            after that time
        filters:
          $ref: '#/components/schemas/LLMQueryFilters'
        limit:
          type: integer
          default: 10
        offset:
          type: integer
          default: 0
    ListNestedSpanResponse:
      type: object
      properties:
        session:
          $ref: '#/components/schemas/SessionInstance'
        spans:
          type: array
          items:
            $ref: '#/components/schemas/SpanInstance'
    SessionInstance:
      type: object
      required:
        - id
        - session_attributes
      properties:
        id:
          type: string
          format: uuid
        session_attributes:
          type: object
    SpanInstance:
      type: object
      required:
        - instance_id
        - trace_id
        - node_type
        - name
        - start_time
        - duration
        - span_type
        - span_attributes
      properties:
        instance_id:
          description: Unique identifier of the span
          type: string
          format: uuid
        trace_id:
          $ref: '#/components/schemas/TraceId'
        parent_instance_id:
          description: Instance ID of the parent span. Null for root spans.
          type: string
          nullable: true
        node_type:
          description: >
            Structural role of the span in the trace tree.

            - `normal`: A root span or a child whose parent was resolved.

            - `orphan`: A span whose declared parent is missing from the trace
            data.
          type: string
          enum:
            - normal
            - orphan
        name:
          description: Name of the span type
          type: string
          example: buy
        start_time:
          description: Start time of the agent
          type: string
          format: date-time
          example: '2025-01-01T00:00:00Z'
        duration:
          description: Duration of the agent in nanoseconds
          type: integer
          example: 1000
        span_type:
          description: Type of the span
          type: string
          example: llm
        span_attributes:
          description: Attributes of the span
          type: object
        agent_id:
          description: Agent identifier
          type: string
          nullable: true
        agent_name:
          description: Agent name
          type: string
          nullable: true
        evaluators:
          type: array
          items:
            $ref: '#/components/schemas/EvaluatorInstance'
        events:
          description: >-
            Span events (e.g. exceptions, log entries, gen_ai.content.prompt
            events). Empty array if none.
          type: array
          items:
            $ref: '#/components/schemas/SpanEventInstance'
        links:
          description: >-
            Links to related spans in the same or different trace. Empty array
            if none.
          type: array
          items:
            $ref: '#/components/schemas/SpanLinkInstance'
        status_code:
          description: OTel status code (Unset, Ok, Error)
          type: string
          example: Unset
        status_message:
          description: Status message, typically set for Error status
          type: string
          nullable: true
        resource_attributes:
          description: OTel resource-level attributes (SDK info, service metadata)
          type: object
          additionalProperties:
            type: string
            nullable: true
        service_name:
          description: Service name from OTel resource attributes
          type: string
          nullable: true
        span_kind:
          description: OTel span kind (CLIENT, SERVER, INTERNAL, PRODUCER, CONSUMER)
          type: string
          nullable: true
        children:
          type: array
          items:
            $ref: '#/components/schemas/SpanInstance'
          maxItems: 100
    EvaluatorInstance:
      type: object
      required:
        - evaluator_rule_name
        - output_name
        - value
      properties:
        evaluator_rule_name:
          description: Name of the evaluator rule
          type: string
          example: Allowable Input Fields
        output_name:
          description: Name of the output
          type: string
        value:
          description: value for the output
          oneOf:
            - type: number
            - type: boolean
            - type: string
            - type: array
              items:
                type: number
    SpanEventInstance:
      type: object
      description: A timestamped event recorded during span execution.
      required:
        - timestamp
        - name
      properties:
        timestamp:
          description: Event timestamp (nanosecond precision)
          type: string
          format: date-time
        name:
          description: Event name (e.g. "exception", "gen_ai.content.prompt")
          type: string
        attributes:
          description: Key-value map of event attributes
          type: object
          additionalProperties:
            type: string
            nullable: true
    SpanLinkInstance:
      type: object
      description: A link to a related span in the same or different trace.
      required:
        - trace_id
        - span_id
      properties:
        trace_id:
          description: Linked span's trace ID
          type: string
        span_id:
          description: Linked span's span ID
          type: string
        trace_state:
          description: W3C trace state of the linked span
          type: string
          nullable: true
        attributes:
          description: Key-value map of link attributes
          type: object
          additionalProperties:
            type: string
            nullable: true
    DeleteTracesRequest:
      type: object
      description: Request to delete traces by ID
      required:
        - application_id
        - trace_ids
      properties:
        application_id:
          type: string
          format: uuid
          description: UUID of the application
        trace_ids:
          type: array
          description: List of OpenTelemetry trace IDs (hex strings) to delete
          items:
            $ref: '#/components/schemas/TraceId'
          minItems: 1
          maxItems: 1000
    UserAccessKeyId:
      type: string
      description: >
        Public API key identifier (e.g. fkh_a1b2c3D4). Composed of the prefix
        (e.g. "fkh_") followed by a base64url-encoded random suffix containing
        uppercase and lowercase letters, digits, hyphens, and underscores. Used
        for lookups, deletion, and updates.
      maxLength: 16
      minLength: 12
      pattern: ^[a-z0-9]+_[A-Za-z0-9_-]+$
    UserAccessKeyName:
      type: string
      description: >
        User-assigned label for the API key. Must be unique per user per
        organization. Must start with a letter (A-Z or a-z). After that,
        letters, digits, spaces, hyphens, and underscores are allowed. Leading
        and trailing whitespace is stripped by the server before saving.
      maxLength: 128
      minLength: 1
      pattern: ^[A-Za-z][A-Za-z0-9_ -]*$
    UserAccessKeyCreateRequestBody:
      type: object
      required:
        - name
      properties:
        name:
          $ref: '#/components/schemas/UserAccessKeyName'
        expires_at:
          type: string
          format: date-time
          description: >
            Expiration timestamp for the API key. Must be a future timestamp and
            cannot exceed 100 years from now. If not provided, defaults to 10
            years from creation time.
    UserAccessKeyUpdateRequestBody:
      type: object
      description: >
        At least one field must be provided. Only the fields included in the
        request are updated.
      minProperties: 1
      properties:
        name:
          $ref: '#/components/schemas/UserAccessKeyName'
        expires_at:
          type: string
          format: date-time
          description: >
            New expiration timestamp for the API key. Must be a future timestamp
            (greater than current time) and cannot exceed 100 years from now.
    UserAccessKeySingleResponseBody:
      type: object
      description: |
        API key metadata. Never includes secrets or hashes.
      required:
        - key_id
        - name
        - key_suffix
        - created_at
        - updated_at
        - expires_at
        - user
        - organization
      properties:
        key_id:
          $ref: '#/components/schemas/UserAccessKeyId'
        name:
          $ref: '#/components/schemas/UserAccessKeyName'
        key_suffix:
          type: string
          description: |
            Last 6 characters of the secret, for UI display (e.g. "abc123").
          minLength: 6
          maxLength: 6
          example: abc123
        created_at:
          type: string
          format: date-time
          description: Timestamp when the API key was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the API key was last updated.
        expires_at:
          type: string
          format: date-time
          description: Expiration timestamp for the API key.
        last_used_at:
          type: string
          format: date-time
          description: >
            Timestamp when the API key was last used for authentication, or null
            if never used. Reserved for future use — always null in Phase 1.
          nullable: true
        user:
          $ref: '#/components/schemas/UserCompact'
        organization:
          $ref: '#/components/schemas/OrganizationCompact'
    UserAccessKeyTokenResponseBody:
      description: >
        Response body for API key creation. Includes the full composite token
        which is shown only once.
      allOf:
        - $ref: '#/components/schemas/UserAccessKeySingleResponseBody'
        - type: object
          required:
            - token
          properties:
            token:
              type: string
              description: >
                Full composite API key (key_id.secret). Shown once at creation —
                cannot be retrieved again. Store securely.
              example: fkh_EXMPL001.EXAMPLE_SECRET_DO_NOT_USE_xxxxxxxxxxxxxxxxx
    UserAccessKeyListResponseBody:
      type: array
      items:
        $ref: '#/components/schemas/UserAccessKeySingleResponseBody'
    UserInviteRequest:
      type: object
      required:
        - email
      properties:
        email:
          type: string
          format: email
          example: user@example.com
        first_name:
          type: string
          example: Jane
        last_name:
          type: string
          example: Doe
    UserInviteResponse:
      type: object
      required:
        - signup_link
        - invite_code
      properties:
        signup_link:
          type: string
          description: URL for the invited user to complete sign-up
        invite_code:
          type: string
          description: Invite code for the invited user
    Users:
      type: array
      items:
        $ref: '#/components/schemas/User'
    User:
      type: object
      allOf:
        - type: object
          required:
            - id
            - username
            - org
            - projects
          properties:
            id:
              type: string
              format: uuid
            first_name:
              type: string
            last_name:
              type: string
            email:
              type: string
            username:
              type: string
            org:
              type: object
              properties:
                name:
                  type: string
                role:
                  type: string
            projects:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  role:
                    type: string
            activity:
              type: object
              properties:
                last_login_time:
                  type: string
                  format: date-time
    UserInfoResponse:
      type: object
      properties:
        session:
          type: object
          properties:
            expires:
              type: integer
        user:
          $ref: '#/components/schemas/UserInfo'
        config:
          type: object
          properties:
            enable_service_provider_authn:
              type: boolean
              example: false
    TestWebhookUrlRequest:
      type: object
      title: TestWebhookUrlRequest
      required:
        - url
        - provider
      properties:
        url:
          type: string
        provider:
          type: string
          enum:
            - SLACK
            - MS_TEAMS
            - OTHER
    TestWebhookUrlResponse:
      type: object
      title: TestWebhookUrlResponse
      required:
        - is_valid
        - status_code
        - message
      properties:
        is_valid:
          type: boolean
          example: true
        status_code:
          type: number
          example: 200
        message:
          type: string
          example: Invalid URL
  responses:
    '200':
      description: Success
      content: {}
    '202':
      description: >-
        The request has been accepted for processing, but the processing has not
        been completed. The request might or might not be eventually acted upon,
        and may be disallowed when processing occurs.
      content: {}
    '204':
      description: >-
        The server successfully processed the request, and is not returning any
        content
      content: {}
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '404':
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '409':
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '410':
      description: Gone - the requested resource is no longer available on this server
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '422':
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '429':
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying
        X-RateLimit-Limit:
          schema:
            type: string
          description: Rate limit policy
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Remaining requests in current window
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix timestamp when the rate limit resets
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '501':
      description: Server does not support this action
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '503':
      description: Upstream connect error or disconnect/reset before headers
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  parameters:
    project_id_query:
      name: project_id
      in: query
      description: project id query parameter
      required: false
      schema:
        type: string
        format: uuid
    project_id_query_required:
      name: project_id
      in: query
      description: project id query parameter
      required: true
      schema:
        type: string
        format: uuid
    model_id:
      name: model_id
      in: path
      description: model id path parameter
      required: true
      schema:
        type: string
        format: uuid
    trace_id:
      name: trace_id
      in: path
      description: OpenTelemetry trace ID (hex string)
      required: true
      schema:
        $ref: '#/components/schemas/TraceId'
    span_id:
      name: span_id
      in: path
      description: span id path parameter
      required: true
      schema:
        type: string
        format: uuid
    model_id_query_required:
      name: model_id
      in: query
      description: model id parameter in uuid format
      required: true
      schema:
        type: string
        format: uuid
    model_id_query:
      name: model_id
      in: query
      description: model id query parameter
      required: false
      schema:
        type: string
        format: uuid
    agent_id_query:
      name: agent_id
      in: query
      description: agent id query parameter
      required: true
      schema:
        type: string
        format: uuid
    name:
      name: name
      in: query
      description: Entity's name
      required: false
      schema:
        type: string
    baseline_name:
      name: baseline_name
      in: query
      description: baseline_name in query parameter
      required: true
      schema:
        type: string
    baseline_name_optional:
      name: baseline_name
      in: query
      description: baseline_name in query parameter
      required: false
      schema:
        type: string
    limit:
      name: limit
      in: query
      description: Limit for the pagination
      required: false
      schema:
        type: integer
    offset:
      name: offset
      in: query
      description: Offset for the pagination
      required: false
      schema:
        type: integer
    organization_name:
      name: organization_name
      in: query
      description: organization_name query parameter
      required: true
      schema:
        type: string
    client_version:
      name: client_version
      in: query
      description: fiddler-client version query parameter
      required: true
      schema:
        type: string
    client_name:
      name: client_name
      in: query
      description: client_name query parameter
      required: true
      schema:
        type: string
    filter:
      name: filter
      in: query
      description: Allows you to filter by any field.
      required: false
      schema:
        type: string
    organization_name_path:
      name: organization_name
      in: path
      description: organization_name path parameter
      required: true
      schema:
        type: string
    project_name:
      name: project_name
      in: query
      description: project_name query parameter
      required: true
      schema:
        type: string
    project_name_query_optional:
      name: project_name
      in: query
      description: project_name query parameter
      required: false
      schema:
        type: string
    project_name_path:
      name: project_name
      in: path
      description: project_name path parameter
      required: true
      schema:
        type: string
    dataset_name:
      name: dataset_name
      in: query
      description: dataset_name query parameter
      required: true
      schema:
        type: string
    dataset_name_path:
      name: dataset_name
      in: path
      description: dataset_name path parameter
      required: true
      schema:
        type: string
    model_name:
      name: model_name
      in: query
      description: model_name query parameter
      required: true
      schema:
        type: string
    model_name_optional:
      name: model_name
      in: query
      description: model_name query parameter
      required: false
      schema:
        type: string
    model_name_path:
      name: model_name
      in: path
      description: model_name path parameter
      required: true
      schema:
        type: string
    project_role_id_path:
      name: id
      in: path
      description: Id of the project role
      required: true
      schema:
        type: integer
    segment_name:
      name: segment_name
      in: query
      description: segment_name query parameter
      required: true
      schema:
        type: string
    ordering:
      name: ordering
      in: query
      description: >-
        Allows you to order results by any field. For desc order prefix field
        name with `-` and provide comman separated values for multiple fields
      required: false
      schema:
        type: string
    search:
      name: search
      in: query
      description: Allows you to search by any field.
      required: false
      schema:
        type: string
    invitation_id_path:
      name: invitation_id
      in: path
      description: unique identifier
      required: true
      schema:
        type: integer
    user_data_id_path:
      name: user_data_id
      in: path
      description: unique identifier
      required: true
      schema:
        type: integer
    user_id_path:
      name: user_id
      in: path
      description: unique identifier
      required: true
      schema:
        type: integer
    start_time:
      name: start_time
      in: query
      description: requested start time
      required: true
      schema:
        type: string
        format: date-time
    end_time:
      name: end_time
      in: query
      description: requested end time
      required: true
      schema:
        type: string
        format: date-time
    start_time_optional:
      name: start_time
      in: query
      description: requested start time
      required: false
      schema:
        type: string
        format: date-time
    end_time_optional:
      name: end_time
      in: query
      description: requested end time
      required: false
      schema:
        type: string
        format: date-time
    uuid_path:
      name: uuid
      in: path
      description: uuid path parameter
      required: true
      schema:
        type: string
        format: uuid
    id_path:
      name: id
      in: path
      description: id path parameter
      required: true
      schema:
        type: string
        format: uuid
    alert_type:
      name: alert_type
      in: query
      description: Alert Type
      required: false
      schema:
        type: string
        enum:
          - DRIFT
          - DATA_INTEGRITY
          - PERFORMANCE
          - SERVICE_METRICS
    metric:
      name: metric
      in: query
      description: metric
      required: false
      schema:
        type: string
        enum:
          - JSD
          - PSI
          - ACCURACY
          - TPR
          - RECALL
          - FPR
          - PRECISION
          - AUC
          - F1 SCORE
          - R2
          - MSE
          - MAE
          - MAPE
          - WMAPE
          - LOG LOSS
          - MISSING VALUE
          - RANGE VIOLATION
          - TYPE VIOLATION
          - TRAFFIC
          - LATENCY
          - ERROR
    feature_name:
      name: feature_name
      in: query
      description: Name of the Feature
      required: false
      schema:
        type: string
    list_alert_config_uuid:
      name: alert_config_uuid_list
      in: query
      description: list of all uuid for the alert configs loaded in that page
      required: true
      schema:
        type: array
        items:
          type: string
          format: uuid
    deployment_params:
      name: deployment_params
      in: query
      description: JSON encoded Deployment Params
      schema:
        type: string
        properties:
          deployment_type:
            type: string
            enum:
              - BASE_CONTAINER
            description: Model deployment type
          image_uri:
            type: string
            description: Model deployment docker image uri
          replicas:
            type: integer
            description: Number of model deployment pods to be active
            example: 2
            minimum: 1
            maximum: 10
          cpu:
            type: integer
            description: Amount of millicpus to allocate per replica
            example: 500
            minimum: 1
            maximum: 4000
          memory:
            type: integer
            description: Amount of MiBs to allocate per replica
            example: 512
            minimum: 150
            maximum: 16384
    upload_id:
      name: upload_id
      in: query
      description: ID for the upload
      required: true
      schema:
        type: string
    parts:
      name: parts
      in: query
      description: List of parts
      required: true
      schema:
        type: array
        items:
          $ref: '#/components/schemas/PartCompact'
    part_number:
      name: part_number
      in: query
      description: Part number of the upload
      required: true
      schema:
        type: integer
    fiddler_version_header:
      name: X-Fiddler-Client-Version
      in: header
      description: Fiddler Client Version
      required: true
      schema:
        type: string
    no_cache_optional:
      name: no_cache
      in: query
      description: If true, then it will not use the cached data
      required: false
      schema:
        type: boolean
    verbose:
      name: verbose
      in: query
      description: flag for extras in response
      required: false
      schema:
        type: boolean
    bin_size:
      name: bin_size
      in: query
      required: true
      schema:
        type: string
        default: Hour
        enum:
          - Hour
          - Day
          - Week
          - Month
          - Quarter
    time_zone:
      name: time_zone
      in: query
      required: true
      schema:
        type: string
        default: Etc/GMT
    column_id:
      name: column_id
      in: path
      description: column_id path parameter
      required: true
      schema:
        type: string
    column_id_query_required:
      name: column_id
      in: query
      description: column_id parameter
      required: true
      schema:
        type: string
    baseline:
      name: baseline
      in: query
      required: true
      schema:
        type: string
    max_bins:
      name: max_bins
      in: query
      required: false
      schema:
        type: number
        format: int
    application_id_query:
      name: application_id
      in: query
      description: application id query parameter
      required: true
      schema:
        type: string
        format: uuid
    application_id_path_required:
      name: application_id
      in: path
      description: application id path parameter
      required: true
      schema:
        type: string
        format: uuid
    agent_instance_id_query:
      name: agent_instance_id
      in: query
      description: agent instance id query parameter
      required: false
      schema:
        type: string
        format: uuid
    session_id_query:
      name: session_id
      in: query
      description: session id query parameter
      required: false
      schema:
        $ref: '#/components/schemas/SessionId'
    redirect_uri_query:
      name: redirect_uri
      in: query
      description: Optional redirect URI to use after authentication
      required: false
      schema:
        type: string
    return_span_count:
      name: return_span_count
      in: query
      description: >-
        Whether span type count should be computed for each agent or not.
        Default to False
      required: false
      schema:
        type: boolean
    alert_id:
      name: alert_id
      in: path
      description: alert id path parameter
      required: true
      schema:
        type: string
        format: uuid
    alert_time_bucket:
      name: alert_time_bucket
      in: query
      description: Timestamp(in milliseconds) pointing to the start of the time bin
      required: true
      schema:
        type: number
        format: integer
    application_id:
      name: application_id
      in: path
      description: Path parameter for unique identifier of an application
      required: true
      schema:
        type: string
        format: uuid
    baseline_id:
      name: baseline_id
      in: path
      description: baseline id path parameter
      required: true
      schema:
        type: string
        format: uuid
    chart_id:
      name: chart_id
      in: path
      description: chart id path parameter
      required: true
      schema:
        type: string
        format: uuid
    configuration_id:
      name: configuration_id
      in: path
      description: configuration id path parameter
      required: true
      schema:
        type: string
        format: uuid
    env_id:
      name: env_id
      in: path
      description: environment id path parameter
      required: true
      schema:
        type: string
        format: uuid
    type:
      name: type
      in: query
      description: type of environment
      required: false
      schema:
        type: string
        enum:
          - PRE_PRODUCTION
          - PRODUCTION
    evaluator_rule_id:
      name: evaluator_rule_id
      in: path
      description: Path parameter for unique identifier of a Rule evaluator
      required: true
      schema:
        type: string
        format: uuid
    experiment_id:
      name: experiment_id
      in: path
      description: Path parameter for unique identifier of an experiment
      required: true
      schema:
        type: string
        format: uuid
    alert_rule_id:
      name: alert_rule_id
      in: path
      description: GenAI alert rule id path parameter
      required: true
      schema:
        type: string
        format: uuid
    custom_metric_id:
      name: custom_metric_id
      in: path
      description: Unique identifier of the GenAI custom metric
      required: true
      schema:
        type: string
        format: uuid
    organization_id:
      name: organization_id
      in: query
      description: |
        UUID of the caller's active organization. Used to scope the RBAC check
        and ClickHouse query. Required — the endpoint returns an empty
        `items` array when omitted, regardless of auth mode (cookie or bearer).
      required: true
      schema:
        type: string
        format: uuid
    metric_source:
      name: metric_source
      in: query
      description: Source table the metric was aggregated from.
      required: true
      schema:
        $ref: '#/components/schemas/GenAIDashboardMetricSource'
      example: trace
    metric_name:
      name: metric_name
      in: query
      description: Metric to retrieve. Must be valid for the chosen `metric_source`.
      required: true
      schema:
        $ref: '#/components/schemas/GenAIDashboardMetricName'
      example: traffic
    aggregation:
      name: aggregation
      in: query
      description: >
        Optional filter on the aggregation type emitted by the materialized
        view.

        Common values include `count`, `sum`, `average`, `uniq`, `rate`, `p50`,
        `p99`.

        Omit to receive every aggregation produced for the metric.
      required: false
      schema:
        type: string
      example: average
    dimension:
      name: dimension
      in: query
      description: >
        Optional filter on the metric dimension. Use empty string to match
        scalar metrics.

        Examples: `total`, `input`, `output` for `token_count`; `max_risk_prob`
        for `prompt_safety`.

        Omit to receive every dimension produced for the metric.
      required: false
      schema:
        type: string
      example: total
    time_bin_size:
      name: bin_size
      in: query
      description: The bin size for grouping usage data
      required: true
      schema:
        $ref: '#/components/schemas/TimeBinSizeEnum'
      example: day
    job_id:
      name: job_id
      in: path
      description: job id path parameter
      required: true
      schema:
        type: string
        format: uuid
    provider:
      name: provider
      in: path
      description: Name of the LLM provider (e.g., OpenAI, Anthropic)
      required: true
      schema:
        type: string
    target_path_query:
      name: target_path
      in: query
      description: >-
        Optional target path to redirect user after authentication to a specific
        URL
      required: false
      schema:
        type: string
    latest_only:
      name: latest_only
      in: query
      description: >-
        Whether to send only latest version of each model or all version. False
        by default
      required: false
      schema:
        type: boolean
    user_id:
      name: user_id
      in: path
      description: user id path parameter
      required: true
      schema:
        type: string
        format: uuid
    pagerduty_service_id:
      name: pagerduty_service_id
      in: path
      description: >-
        The unique identifier of the Pagerduty service to be retrieved, updated,
        or deleted.
      required: true
      schema:
        type: string
        format: uuid
    project_id:
      name: project_id
      in: path
      description: Path parameter for unique identifier of a project
      required: true
      schema:
        type: string
        format: uuid
    with_asset_count:
      name: with_asset_count
      in: query
      description: whether to return asset count of the project or not
      required: false
      schema:
        type: boolean
    project_role_id:
      name: project_role_id
      in: path
      description: Project role assignment UUID path parameter
      required: true
      schema:
        type: string
        format: uuid
    team_role_id:
      name: team_role_id
      in: path
      description: team role id path parameter
      required: true
      schema:
        type: string
        format: uuid
    team_id:
      name: team_id
      in: path
      description: team id path parameter
      required: true
      schema:
        type: string
        format: uuid
    key_id:
      name: key_id
      in: path
      description: >
        The public API key identifier (e.g. fkh_a1b2c3d4). Used for lookups,
        deletion, and updates.
      required: true
      schema:
        $ref: '#/components/schemas/UserAccessKeyId'
  examples:
    ApplicationDeletionJobResponse:
      value:
        api_version: '3.0'
        kind: NORMAL
        data:
          job:
            id: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
            name: Application deletion
    JobGet_Ex_1:
      value:
        api_version: '3.0'
        kind: NORMAL
        data:
          name: Ingestion dataset Upload
          info:
            resource_type: DATASET
            resource_name: bank_churn
            project_name: bank_churn
            resource:
              id: c97cd455-1e64-4e79-bd86-7bd399505678
              name: bank_churn
            model:
              id: c97cd455-1e64-4e79-bd86-7bd399505678
              name: bank_churn
              version: v1
            project:
              id: e3a4d78e-f294-4d5c-b28a-129164588a32
              name: bank_churn
          id: e9a2a782-1db4-4bb8-8db0-3fa5a278c068
          status: SUCCESS
          progress: 100
          error_message: null
          error_reason: null
          extras:
            3f5025e5-1d2f-4b0f-a955-b8cd4e43d2e8:
              status: SUCCESS
              result:
                result:
                  __org: s3bucket
                  s3_key: >-
                    s3bucket//s3bucket/first_project/bank_churn/small_dataset.csv
                  __dataset: bank_churn
                  __project: first_project
                  file_type: .csv
                  s3_bucket: fiddler-bucket-staging
                  cleaned_s3_key: >-
                    s3bucket//s3bucket/first_project/bank_churn/cleaned/small_dataset.csv
                  cleaned_ch_table: s3bucket_first_project__dataset__bank_churn
                  violations_s3_key: >-
                    s3bucket//s3bucket/first_project/bank_churn/violations/small_dataset.csv
                  violations_ch_table: null
              error_message: null
            e36d1cf2-766f-4705-8269-b6f93bf1ca14:
              status: SUCCESS
              result:
                result: Success
              error_message: null
    ModelMetricsDetails:
      value:
        api_version: '3.0'
        kind: NORMAL
        data:
          organization:
            id: ae880011-0694-467e-b487-dd020bd67bf7
            name: fiddler
          project:
            id: 5c6ebb6c-769d-42b6-9fb5-2dfb99a85b82
            name: bank_churn
          model:
            id: 87926272-96aa-4693-89d3-5db4d9c1d4b2
            name: binary_classification
            version: v1
          metrics:
            - id: jsd
              name: JSD
              type: Data Drift
              columns:
                - age
                - output
                - custom_feature_1
              requires_baseline: true
            - id: missing_value
              name: Missing Value Violation
              type: Data Integrity
              columns:
                - __ANY__
                - age
              requires_baseline: false
            - id: traffic
              name: Traffic
              type: Traffic
              requires_baseline: false
              columns:
                - age
          columns:
            - id: age
              name: Age
              group: Inputs
              data_type: integer
            - id: output
              name: Output
              group: Predictions
              data_type: float
            - id: custom_feature_1
              name: Custom Feature 1
              group: Metadata
              data_type: custom feature
            - id: __ANY__
              name: All Columns
          metric_types:
            - key: performance
              name: Performance
            - key: drift
              name: Data Drift
            - key: data_integrity
              name: Data Integrity
            - key: service_metrics
              name: Traffic
            - key: statistic
              name: Statistic
    TracesHeadSpans:
      value:
        api_version: '3.0'
        kind: NORMAL
        data:
          session:
            id: 123e4567-e89b-12d3-a456-426614174000
            session_attributes:
              attr_1: val_1
          spans:
            - instance_id: 123e4567-e89b-12d3-a456-426614174000
              trace_id: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
              parent_instance_id: null
              node_type: normal
              name: buy
              start_time: '2025-01-01T00:00:00Z'
              duration: 1000
              span_type: llm
              span_attributes:
                span.type: llm
                attributes.gen_ai.agent.name: Trader
              evaluators:
                - evaluator_rule_name: FTL Prompt Safety
                  output_name: Is Violent
                  value: false
            - instance_id: 123e4567-e89b-12d3-a456-426614174001
              trace_id: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
              parent_instance_id: null
              node_type: normal
              name: volatility
              start_time: '2025-01-01T00:01:00Z'
              duration: 1000
              span_type: llm
              span_attributes:
                span.type: llm
                attributes.gen_ai.agent.name: Trader
              evaluators:
                - evaluator_rule_name: FTL Prompt Safety
                  output_name: Is Violent
                  value: false
              children:
                - instance_id: 123e4567-e89b-12d3-a456-426614174002
                  trace_id: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
                  parent_instance_id: 123e4567-e89b-12d3-a456-426614174001
                  node_type: normal
                  name: sell
                  start_time: '2025-01-01T00:02:00Z'
                  duration: 1000
                  span_type: llm
                  span_attributes:
                    span.type: llm
                    attributes.gen_ai.agent.name: Trader
            - instance_id: 123e4567-e89b-12d3-a456-426614174003
              trace_id: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
              parent_instance_id: 00000000-0000-0000-0000-000000000000
              node_type: orphan
              name: analyze
              start_time: '2025-01-01T00:03:00Z'
              duration: 500
              span_type: llm
              span_attributes:
                span.type: llm
                attributes.gen_ai.agent.name: Trader
              evaluators: []
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
tags:
  - name: access-key
    description: CRUD operations for API keys
  - name: span-v3
  - name: aggregation-invalidation-request-v3
    description: Endpoints related to retrieving aggregation invalidation requests
  - name: alert-rules-v3
    description: CRUD for Alert Rules, Summary, and Stats APIs
  - name: application-v3
  - name: attribute-v3
  - name: auth
    description: Authentication strategies and login flows
  - name: baseline-v3
    description: CRUD for baseline
  - name: catalog-v3
    description: >-
      Entity catalog provides paginated, searchable discovery of entity names
      (attribute keys, agent names, span types, span names) and their distinct
      values. Powered by ClickHouse materialized views — no worker or PostgreSQL
      dependency.
  - name: chart-annotation-v3
    description: Endpoints related to retrieving chart annotations
  - name: chart-v3
    description: CRUD for chart
  - name: queries-v3
    description: v3 queries API
  - name: configuration-v3
    description: CRUD for configurations
  - name: custom-metrics-v3
  - name: dimensionality-reduction-v3
  - name: environment-v3
    description: Endpoints related to environment management
  - name: evals
  - name: datasets
  - name: evaluation-v3
  - name: evaluator-v3
  - name: rule-evaluators-v3
  - name: experiment-v3
  - name: explainability-v3
  - name: llm_rca-v3
  - name: file-upload
    description: Endpoints related to file uploading.
  - name: fql-expressions-v3
    description: >
      Endpoints for listing FQL (Fiddler Query Language) functions available for
      GenAI custom metrics. Used by the frontend for autocomplete and signature
      hints in the FQL editor.
  - name: genai-alert-rules-v3
    description: CRUD API for GenAI Alert Rules
  - name: genai-custom-metrics-v3
    description: API for GenAI Custom Metrics
  - name: genai-metrics-v3
    description: >-
      Endpoints for pre-aggregated GenAI metrics. All metric data is
      pre-aggregated by an hourly ClickHouse refreshable materialized view; no
      real-time aggregation is performed at request time.
  - name: guardrails-api
    description: Endpoints related to retrieving Guardrails specific data
  - name: ingestion-v3
  - name: intercom-api
    description: Endpoints related to intercom APIs
  - name: jobs-v3
  - name: llm-gateway-v3
  - name: auth-login
  - name: auth-logout
  - name: metrics-v3
    description: Metrics endpoints
  - name: model-v3
  - name: dashboard-v3
  - name: model-deployment-v3
  - name: monitoring-summary-v3
  - name: histograms-v3
  - name: organization-roles-v3
    description: Update user org role
  - name: organization-settings-v3
    description: Update organization settings such as timezone, email configuration, etc.
  - name: pagerduty-api
    description: CRUD for Pagerduty services.
  - name: project-v3
  - name: project-roles-v3
    description: Project role assignment management
  - name: scores-v3
    description: Unified CRUD for scores and annotations
  - name: searchable-text-key-v3
    description: >-
      Manage the global searchable text keys table that controls which OTel
      attribute keys are routed to the full-text-searchable `ValueContent`
      column in the unified attributes table. Changes propagate to the backing
      ClickHouse dictionary within 1-2 minutes and affect all tenants.
  - name: segments-v3
  - name: semantic-mapping-v3
    description: >-
      Manage the global semantic name mappings table that maps raw OTel
      attribute keys to canonical semantic concepts. Changes propagate to the
      backing ClickHouse dictionary within 1-2 minutes and affect all tenants.
  - name: server-info-v3
    description: Endpoints related to retrieving server information
  - name: sessions-v3
    description: v3 session APIs
  - name: team-roles-v3
  - name: team-v3
  - name: traces-v3
    description: v3 trace api for monitoring
  - name: fetch-sessions-v3
    description: v3 fetch sessions api for monitoring
  - name: user-access-key
    description: >
      CRUD operations for user API keys. All endpoints are user-scoped — each
      user can only operate on their own API keys. No one including Org admins
      have access to other users' API keys.
  - name: users-v3
  - name: version-compatibility-v3
  - name: webhooks
