{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudinary/json-schema/cloudinary-billing-usage-response-schema.json",
  "title": "BillingUsageResponse",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudinary-provisioning-openapi.yml#/components/schemas/BillingUsageResponse",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "plan_name": {
        "type": "string",
        "description": "The name of the plan (e.g., \"Pro PAYG\", \"Advanced PAYG\")."
      },
      "metric_usage": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "metric": {
              "type": "string",
              "description": "The type of metric being measured (e.g., \"credit\")."
            },
            "limit": {
              "type": "number",
              "description": "The limit for this metric in the plan."
            },
            "cycles": {
              "type": "array",
              "description": "Full usage details per billing cycle (monthly or annual, depending on plan).",
              "items": {
                "type": "object",
                "properties": {
                  "from_day": {
                    "type": "string",
                    "format": "date",
                    "description": "The start date of the billing cycle."
                  },
                  "to_day": {
                    "type": "string",
                    "format": "date",
                    "description": "The end date of the billing cycle."
                  },
                  "usage": {
                    "type": "number",
                    "description": "Total usage for this cycle."
                  },
                  "breakdown": {
                    "type": "object",
                    "description": "Usage breakdown by asset type and operation.",
                    "properties": {
                      "storage_image": {
                        "type": "number",
                        "description": "Storage usage for images."
                      },
                      "storage_video": {
                        "type": "number",
                        "description": "Storage usage for videos."
                      },
                      "storage_raw": {
                        "type": "number",
                        "description": "Storage usage for raw files."
                      },
                      "transformations_image": {
                        "type": "number",
                        "description": "Transformation usage for images."
                      },
                      "transformations_video": {
                        "type": "number",
                        "description": "Transformation usage for videos."
                      },
                      "bandwidth_image": {
                        "type": "number",
                        "description": "Bandwidth usage for images."
                      },
                      "bandwidth_video": {
                        "type": "number",
                        "description": "Bandwidth usage for videos."
                      },
                      "bandwidth_raw": {
                        "type": "number",
                        "description": "Bandwidth usage for raw files."
                      },
                      "image_impressions": {
                        "type": "number",
                        "description": "Number of times images were delivered (impressions)."
                      },
                      "video_seconds": {
                        "type": "number",
                        "description": "Video delivery usage measured in billing seconds (actual viewed duration multiplied by a resolution-based ratio)."
                      }
                    },
                    "additionalProperties": false
                  },
                  "product_environment_breakdown": {
                    "type": "array",
                    "description": "Optional breakdown by product environment. May not be present in all responses.",
                    "items": {
                      "$ref": "#/$defs/CloudAssetTypeBreakdown"
                    }
                  }
                }
              }
            },
            "monthly_cycles": {
              "type": "array",
              "description": "Monthly-level breakdown within a single annual cycle.",
              "items": {
                "type": "object",
                "properties": {
                  "from_day": {
                    "type": "string",
                    "format": "date",
                    "description": "The start date of the monthly billing cycle."
                  },
                  "to_day": {
                    "type": "string",
                    "format": "date",
                    "description": "The end date of the monthly billing cycle."
                  },
                  "usage": {
                    "type": "number",
                    "description": "Total usage for this monthly cycle."
                  },
                  "breakdown": {
                    "type": "object",
                    "description": "Usage breakdown by asset type and operation for the monthly cycle.",
                    "properties": {
                      "storage_image": {
                        "type": "number",
                        "description": "Storage usage for images."
                      },
                      "storage_video": {
                        "type": "number",
                        "description": "Storage usage for videos."
                      },
                      "storage_raw": {
                        "type": "number",
                        "description": "Storage usage for raw files."
                      },
                      "transformations_image": {
                        "type": "number",
                        "description": "Transformation usage for images."
                      },
                      "transformations_video": {
                        "type": "number",
                        "description": "Transformation usage for videos."
                      },
                      "bandwidth_image": {
                        "type": "number",
                        "description": "Bandwidth usage for images."
                      },
                      "bandwidth_video": {
                        "type": "number",
                        "description": "Bandwidth usage for videos."
                      },
                      "bandwidth_raw": {
                        "type": "number",
                        "description": "Bandwidth usage for raw files."
                      },
                      "image_impressions": {
                        "type": "number",
                        "description": "Number of times images were delivered (impressions)."
                      },
                      "video_seconds": {
                        "type": "number",
                        "description": "Video delivery usage measured in billing seconds (actual viewed duration multiplied by a resolution-based ratio)."
                      }
                    },
                    "additionalProperties": false
                  },
                  "product_environment_breakdown": {
                    "type": "array",
                    "description": "Optional breakdown by product environment for the monthly cycle. May not be present in all responses.",
                    "items": {
                      "$ref": "#/$defs/CloudAssetTypeBreakdown"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "$defs": {
    "CloudAssetTypeBreakdown": {
      "type": "object",
      "properties": {
        "storage_image": {
          "type": "number",
          "description": "Storage usage for images in this product environment."
        },
        "storage_video": {
          "type": "number",
          "description": "Storage usage for videos in this product environment."
        },
        "storage_raw": {
          "type": "number",
          "description": "Storage usage for raw files in this product environment."
        },
        "transformations_image": {
          "type": "number",
          "description": "Transformation usage for images in this product environment."
        },
        "transformations_video": {
          "type": "number",
          "description": "Transformation usage for videos in this product environment."
        },
        "bandwidth_image": {
          "type": "number",
          "description": "Bandwidth usage for images in this product environment."
        },
        "bandwidth_video": {
          "type": "number",
          "description": "Bandwidth usage for videos in this product environment."
        },
        "bandwidth_raw": {
          "type": "number",
          "description": "Bandwidth usage for raw files in this product environment."
        },
        "image_impressions": {
          "type": "number",
          "description": "Number of times images were delivered (impressions) in this product environment."
        },
        "video_seconds": {
          "type": "number",
          "description": "Video delivery usage measured in billing seconds (actual viewed duration multiplied by a resolution-based ratio)."
        },
        "cloud_name": {
          "type": "string",
          "description": "The name of the product environment."
        }
      }
    }
  }
}