> ## Documentation Index
> Fetch the complete documentation index at: https://api-reference.hyperswitch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# A/B Test Experiment Results

> ClickHouse-backed A/B test experiment results read endpoint.



## OpenAPI

````yaml decision_engine_openapi-specs.json GET /analytics/experiment/{experiment_id}/results
openapi: 3.1.0
info:
  title: Decision Engine
  description: >-
    Open-source payment gateway routing service by Juspay. Selects the optimal
    payment processor for each transaction in real-time using success-rate
    scoring, rule-based routing, and elimination logic.


    ## Authentication


    This API supports two authentication methods:


    1. **JWT Bearer Token** - For dashboard/user sessions
       - Header: `Authorization: Bearer <jwt_token>`
       - Obtain via `/auth/login` endpoint

    2. **API Key** - For service-to-service/programmatic access
       - Header: `x-api-key: DE_<64_char_hex>`
       - Create via `/api-key/create` endpoint

    Protected endpoints require one of these authentication methods.
  version: 1.4.0
  contact:
    name: Juspay
    url: https://github.com/juspay/decision-engine
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
servers:
  - url: http://localhost:8080
    description: Local development
  - url: https://sandbox.hyperswitch.io
    description: 'Hyperswitch sandbox with x-feature: decision-engine'
security: []
tags:
  - name: Health
    description: Service liveness, readiness, and diagnostics
  - name: Auth
    description: Dashboard auth and merchant selection
  - name: API Keys
    description: Service-to-service API key management
  - name: Gateway Decision
    description: Core routing decision APIs
  - name: Score Feedback
    description: Feed transaction outcomes back to improve SR scoring
  - name: Merchant Account
    description: Merchant configuration management
  - name: Routing Rules
    description: Euclid declarative routing rules engine
  - name: Rule Configuration
    description: Service-level SR/elimination config
  - name: Config
    description: Routing key and dimension metadata
  - name: Analytics
    description: ClickHouse-backed analytics and audit reads
  - name: Compatibility
    description: Legacy compatibility routes
  - name: Connector Costs
  - name: Merchant Features
  - name: Autopilot
paths:
  /analytics/experiment/{experiment_id}/results:
    get:
      tags:
        - Analytics
      summary: A/B test experiment results
      description: >-
        Statistical significance results (control vs. variant) for a routing A/B
        test experiment, with guardrail evaluation.
      operationId: analyticsExperimentResults
      parameters:
        - name: x-tenant-id
          in: header
          required: true
          description: >-
            Tenant to resolve. The shipped config files define only the "public"
            tenant. No fallback — omitting this fails with TE_03.
          schema:
            type: string
            default: public
        - name: experiment_id
          in: path
          required: true
          schema:
            type: string
        - name: start_ms
          in: query
          required: false
          schema:
            type: integer
        - name: end_ms
          in: query
          required: false
          schema:
            type: integer
        - name: min_sample_size
          in: query
          required: false
          schema:
            type: integer
        - name: guardrail_threshold_pp
          in: query
          required: false
          schema:
            type: number
        - name: evaluation_margin
          in: query
          required: false
          schema:
            type: number
        - name: merchant_id
          in: query
          required: true
          schema:
            type: string
        - name: range
          in: query
          required: false
          schema:
            type: string
            enum:
              - M15
              - H1
              - H12
              - D1
              - W1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExperimentResultsResponse'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    ExperimentResultsResponse:
      type: object
      properties:
        experiment_id:
          type: string
        merchant_id:
          type: string
        control:
          $ref: '#/components/schemas/ExperimentArmMetrics'
        variant:
          $ref: '#/components/schemas/ExperimentArmMetrics'
        delta_pp:
          type: number
          format: double
        p_value:
          type: number
          format: double
          nullable: true
        confidence_interval:
          type: array
          items:
            type: number
          nullable: true
        verdict:
          $ref: '#/components/schemas/ExperimentVerdict'
        min_sample_size:
          type: integer
          format: int32
        net_delta_bps:
          type: number
          format: double
          nullable: true
        evaluation_margin:
          type: number
          format: double
    ExperimentArmMetrics:
      type: object
      properties:
        arm:
          type: string
        transaction_count:
          type: integer
          format: int64
        success_count:
          type: integer
          format: int64
        failure_count:
          type: integer
          format: int64
        auth_rate:
          type: number
          format: double
        first_attempt_auth_rate:
          type: number
          format: double
        total_cost_saved:
          type: number
          format: double
          nullable: true
        avg_latency_ms:
          type: number
          format: double
          nullable: true
        avg_chosen_cost_bps:
          type: number
          format: double
          nullable: true
        avg_cost_saved_bps:
          type: number
          format: double
          nullable: true
        net_ev_bps:
          type: number
          format: double
          nullable: true
    ExperimentVerdict:
      type: string
      enum:
        - CollectingData
        - NotSignificant
        - VariantWins
        - VariantLoses
        - GuardrailBreached
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token obtained from /auth/login
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key created via /api-key/create

````