{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-create-abtest-request-schema.json",
  "title": "CreateABTestRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-bedrock-ab-tests-api-openapi.yml#/components/schemas/CreateABTestRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the A/B test. Must be unique within your account."
    },
    "description": {
      "type": "string",
      "description": "The description of the A/B test."
    },
    "gatewayArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the gateway to use for traffic splitting."
    },
    "variants": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Variant"
      },
      "description": "The list of variants for the A/B test. Must contain exactly two variants: a control (C) and a treatment (T1), each with a configuration bundle or target reference and a traffic weight."
    },
    "gatewayFilter": {
      "$ref": "#/$defs/GatewayFilter"
    },
    "evaluationConfig": {
      "$ref": "#/$defs/ABTestEvaluationConfig"
    },
    "roleArn": {
      "type": "string",
      "description": "The IAM role ARN that grants permissions for the A/B test to access gateway and evaluation resources."
    },
    "enableOnCreate": {
      "type": "boolean",
      "description": "Whether to enable the A/B test immediately upon creation. If true, traffic splitting begins automatically."
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error."
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "A map of tag keys and values to associate with the A/B test."
    }
  },
  "required": [
    "name",
    "gatewayArn",
    "variants",
    "evaluationConfig",
    "roleArn"
  ],
  "$defs": {
    "ABTestEvaluationConfig": {
      "type": "object",
      "properties": {
        "onlineEvaluationConfigArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of a single online evaluation configuration to use for both variants."
        },
        "perVariantOnlineEvaluationConfig": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PerVariantOnlineEvaluationConfig"
          },
          "description": "Per-variant online evaluation configurations, allowing different evaluation settings for each variant."
        }
      },
      "description": "Exactly one member is set."
    },
    "ConfigurationBundleRef": {
      "type": "object",
      "properties": {
        "bundleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the configuration bundle."
        },
        "bundleVersion": {
          "type": "string",
          "description": "The version of the configuration bundle."
        }
      },
      "required": [
        "bundleArn",
        "bundleVersion"
      ]
    },
    "GatewayFilter": {
      "type": "object",
      "properties": {
        "targetPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of target path patterns to include in the A/B test."
        }
      }
    },
    "PerVariantOnlineEvaluationConfig": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the variant this evaluation configuration applies to."
        },
        "onlineEvaluationConfigArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the online evaluation configuration for this variant."
        }
      },
      "required": [
        "name",
        "onlineEvaluationConfigArn"
      ]
    },
    "TargetRef": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the gateway target."
        }
      },
      "required": [
        "name"
      ]
    },
    "Variant": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the variant. Must be C for control or T1 for treatment."
        },
        "weight": {
          "type": "integer",
          "description": "The percentage of traffic to route to this variant. Weights across all variants must sum to 100."
        },
        "variantConfiguration": {
          "$ref": "#/$defs/VariantConfiguration"
        }
      },
      "required": [
        "name",
        "weight",
        "variantConfiguration"
      ]
    },
    "VariantConfiguration": {
      "type": "object",
      "properties": {
        "configurationBundle": {
          "$ref": "#/$defs/ConfigurationBundleRef"
        },
        "target": {
          "$ref": "#/$defs/TargetRef"
        }
      }
    }
  }
}