{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-bedrock/json-schema/amazon-bedrock-create-gateway-rate-limit-request-schema.json",
  "title": "CreateGatewayRateLimitRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-bedrock-rate-limits-api-openapi.yml#/components/schemas/CreateGatewayRateLimitRequest",
  "type": "object",
  "properties": {
    "gatewayIdentifier": {
      "type": "string",
      "description": "The unique identifier of the gateway to create the rate limit for."
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency."
    },
    "rateLimitId": {
      "type": "string",
      "description": "An optional customer-defined identifier for the rate limit. If not provided, the system generates one."
    },
    "description": {
      "type": "string",
      "description": "An optional human-readable description for this rate limit. If not provided, the rate limit is created without a description."
    },
    "dimensionKeys": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The ordered list of dimension key names that define the scope of this rate limit. Must be unique per gateway—no two rate limits can share the same dimension keys."
    },
    "entries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LimitEntry"
      },
      "description": "The rule entries that map dimension values to rate configurations."
    }
  },
  "required": [
    "gatewayIdentifier",
    "dimensionKeys",
    "entries"
  ],
  "$defs": {
    "LimitEntry": {
      "type": "object",
      "properties": {
        "dimensions": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A map of dimension names to dimension values for this rule entry. Keys must match the parent rate limit's dimension keys. Values may use * as a wildcard, but only in trailing positions based on the dimension keys ordering."
        },
        "requests": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RateConfig"
          },
          "description": "The request rate limit configuration. Specifies the maximum number of requests allowed per time period."
        },
        "tokens": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RateConfig"
          },
          "description": "The token rate limit configuration. Specifies the maximum number of tokens allowed per time period."
        },
        "connections": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RateConfig"
          },
          "description": "The connection rate limit configuration. Specifies the maximum number of concurrent connections allowed."
        }
      },
      "required": [
        "dimensions"
      ]
    },
    "RateConfig": {
      "type": "object",
      "properties": {
        "rate": {
          "type": "number",
          "description": "The rate value for the limit. For request limits, this is the number of requests allowed per period. For token limits, this is the number of tokens allowed per period. For connection limits, this is the number of concurrent connections allowed."
        },
        "period": {
          "type": "string",
          "enum": [
            "second",
            "minute"
          ],
          "description": "The time period for the rate limit. Valid values: second—Measures the rate limit over a one-second window. minute—Measures the rate limit over a one-minute window."
        }
      },
      "required": [
        "rate",
        "period"
      ]
    }
  }
}