{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-cognitive-services/json-schema/microsoft-cognitive-services-calculate-model-capacity-parameter-schema.json",
  "title": "CalculateModelCapacityParameter",
  "description": "Calculate Model Capacity parameter.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-cognitive-services-cognitiveservicesaccounts-api-openapi.yml#/components/schemas/CalculateModelCapacityParameter",
  "type": "object",
  "properties": {
    "model": {
      "$ref": "#/$defs/DeploymentModel",
      "description": "Properties of Cognitive Services account deployment model."
    },
    "skuName": {
      "type": "string",
      "description": "The name of SKU."
    },
    "workloads": {
      "type": "array",
      "description": "List of Model Capacity Calculator Workload.",
      "items": {
        "$ref": "#/$defs/ModelCapacityCalculatorWorkload"
      },
      "x-ms-identifiers": []
    }
  },
  "$defs": {
    "CallRateLimit": {
      "type": "object",
      "description": "The call rate limit Cognitive Services account.",
      "properties": {
        "count": {
          "type": "number",
          "format": "float",
          "description": "The count value of Call Rate Limit."
        },
        "renewalPeriod": {
          "type": "number",
          "format": "float",
          "description": "The renewal period in seconds of Call Rate Limit."
        },
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ThrottlingRule"
          },
          "x-ms-identifiers": [
            "key"
          ]
        }
      }
    },
    "DeploymentModel": {
      "type": "object",
      "description": "Properties of Cognitive Services account deployment model.",
      "properties": {
        "publisher": {
          "type": "string",
          "description": "Deployment model publisher."
        },
        "format": {
          "type": "string",
          "description": "Deployment model format."
        },
        "name": {
          "type": "string",
          "description": "Deployment model name."
        },
        "version": {
          "type": "string",
          "description": "Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API."
        },
        "source": {
          "type": "string",
          "description": "Optional. Deployment model source ARM resource ID."
        },
        "sourceAccount": {
          "type": "string",
          "format": "arm-id",
          "description": "Optional. Source of the model, another Microsoft.CognitiveServices accounts ARM resource ID.",
          "x-ms-arm-id-details": {
            "allowedResources": [
              {
                "type": "Microsoft.CognitiveServices/accounts"
              }
            ]
          }
        },
        "callRateLimit": {
          "$ref": "#/$defs/CallRateLimit",
          "description": "The call rate limit Cognitive Services account.",
          "readOnly": true
        }
      }
    },
    "ModelCapacityCalculatorWorkload": {
      "type": "object",
      "description": "Model Capacity Calculator Workload.",
      "properties": {
        "requestPerMinute": {
          "type": "integer",
          "format": "int64",
          "description": "Request per minute."
        },
        "requestParameters": {
          "$ref": "#/$defs/ModelCapacityCalculatorWorkloadRequestParam",
          "description": "Dictionary, Model Capacity Calculator Workload Parameters."
        }
      }
    },
    "ModelCapacityCalculatorWorkloadRequestParam": {
      "type": "object",
      "description": "Dictionary, Model Capacity Calculator Workload Parameters.",
      "properties": {
        "avgPromptTokens": {
          "type": "integer",
          "format": "int64",
          "description": "Average prompt tokens."
        },
        "avgGeneratedTokens": {
          "type": "integer",
          "format": "int64",
          "description": "Average generated tokens."
        }
      }
    },
    "RequestMatchPattern": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        },
        "method": {
          "type": "string"
        }
      }
    },
    "ThrottlingRule": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "renewalPeriod": {
          "type": "number",
          "format": "float"
        },
        "count": {
          "type": "number",
          "format": "float"
        },
        "minCount": {
          "type": "number",
          "format": "float"
        },
        "dynamicThrottlingEnabled": {
          "type": "boolean"
        },
        "matchPatterns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RequestMatchPattern"
          },
          "x-ms-identifiers": [
            "path",
            "method"
          ]
        }
      }
    }
  }
}