{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flashdata-dev/json-schema/flashdata-dev-plan-catalog-schema.json",
  "title": "PlanCatalog",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flashdata-dev-catalog-api-openapi.yml#/components/schemas/PlanCatalog",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "data",
    "currency",
    "billingAvailability",
    "creditValueUsd"
  ],
  "properties": {
    "trialOffer": {
      "description": "Current one-time trial allowance expressed as alternative PAYG usage amounts. Eligibility and approval are required. The amounts share one balance and are not additive. Null when a reliable estimate is unavailable. This is not an account eligibility decision or a promise of immediate credit issuance.",
      "oneOf": [
        {
          "$ref": "#/$defs/PublicTrialOffer"
        },
        {
          "type": "null"
        }
      ]
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Plan"
      }
    },
    "currency": {
      "type": "string",
      "const": "USD"
    },
    "creditValueUsd": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Fixed USD value of one credit, used to preview custom top-ups. The server computes the credited amount."
    },
    "billingAvailability": {
      "type": "string",
      "enum": [
        "available",
        "unconfigured",
        "unavailable"
      ]
    },
    "billingMessage": {
      "type": [
        "string",
        "null"
      ],
      "description": "Stable, non-sensitive explanation suitable for the Pricing and Billing UI."
    }
  },
  "$defs": {
    "Plan": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "slug",
        "name",
        "description",
        "includedCredits",
        "limits",
        "prices",
        "features",
        "usagePrices"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^plan_"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "includedCredits": {
          "type": "number",
          "minimum": 0,
          "multipleOf": 0.001,
          "description": "Credits included in each paid subscription cycle; zero for Pay As You Go."
        },
        "limits": {
          "$ref": "#/$defs/PlanLimits"
        },
        "prices": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PlanPrice"
          }
        },
        "features": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "usagePrices": {
          "$ref": "#/$defs/PlanUsagePrices"
        }
      }
    },
    "PlanLimits": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "concurrency",
        "maxBatchSize",
        "maxPendingJobs"
      ],
      "properties": {
        "concurrency": {
          "type": "integer",
          "minimum": 1
        },
        "maxBatchSize": {
          "type": "integer",
          "minimum": 1
        },
        "maxPendingJobs": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "PlanPrice": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "currency",
        "unitAmount",
        "credits",
        "type",
        "interval"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^prc_"
        },
        "currency": {
          "type": "string",
          "const": "USD"
        },
        "unitAmount": {
          "type": "integer",
          "minimum": 0,
          "description": "USD cents"
        },
        "credits": {
          "type": "number",
          "minimum": 0,
          "multipleOf": 0.001,
          "description": "Credits granted by a successful one-time top-up; zero for recurring prices."
        },
        "type": {
          "type": "string",
          "enum": [
            "recurring",
            "one_time"
          ]
        },
        "interval": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "month",
            "year",
            null
          ]
        }
      }
    },
    "PlanUsagePrices": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "googlePer1kCents",
        "youtubePer1kCents",
        "downloadPerTbCents"
      ],
      "properties": {
        "googlePer1kCents": {
          "type": "integer",
          "minimum": 0,
          "description": "Google request price per 1,000 successful requests, in USD cents."
        },
        "youtubePer1kCents": {
          "type": "integer",
          "minimum": 0,
          "description": "Standard YouTube request price per 1,000 successful requests, in USD cents."
        },
        "downloadPerTbCents": {
          "type": "integer",
          "minimum": 0,
          "description": "Download price per decimal TB (1,000,000,000,000 bytes), in USD cents."
        }
      }
    },
    "PublicTrialOffer": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "googleSearchRequests",
        "youtubeDataRequests",
        "downloadGigabytes"
      ],
      "properties": {
        "maxApiRequests": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum free API calls when the entire trial grant is spent on the lowest-cost per-request API at current Pay as you go rates. Other APIs may allow fewer calls. Downloads are billed by delivered bytes and excluded from this count."
        },
        "googleSearchRequests": {
          "type": "integer",
          "minimum": 0,
          "description": "Requests if the entire grant is spent on Google sources, using the highest current source rate."
        },
        "youtubeDataRequests": {
          "type": "integer",
          "minimum": 0,
          "description": "Standard YouTube requests, excluding Extended Search, using the highest current source rate."
        },
        "downloadGigabytes": {
          "type": "number",
          "minimum": 0,
          "description": "Approximate delivered media volume in decimal GB (1 GB = 1000000000 bytes). Zero when the grant cannot cover the initial download reservation. Completion also depends on per-job reservations and settlement."
        }
      }
    }
  }
}