{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flashdata-dev/json-schema/flashdata-dev-api-access-pricing-schema.json",
  "title": "ApiAccessPricing",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flashdata-dev-credits-api-openapi.yml#/components/schemas/ApiAccessPricing",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "unit",
    "plan",
    "requestCount",
    "prices",
    "note"
  ],
  "properties": {
    "unit": {
      "type": "string",
      "const": "Credits"
    },
    "plan": {
      "$ref": "#/$defs/ApiAccessPlan"
    },
    "requestCount": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000
    },
    "prices": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source",
          "available",
          "estimatedCredits"
        ],
        "properties": {
          "source": {
            "$ref": "#/$defs/ApiAccessSource"
          },
          "available": {
            "type": "boolean"
          },
          "creditsPerRequest": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "estimatedCredits": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Null for downloads or missing pricing."
          },
          "billingUnit": {
            "type": "string",
            "const": "TB"
          },
          "bytesPerUnit": {
            "type": "integer",
            "const": 1000000000000
          },
          "creditsPerTb": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "note": {
            "type": "string"
          }
        }
      }
    },
    "note": {
      "type": "string"
    }
  },
  "$defs": {
    "ApiAccessPlan": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "billingMode": {
          "type": "string"
        },
        "status": {
          "type": "string"
        }
      }
    },
    "ApiAccessSource": {
      "type": "string",
      "enum": [
        "google_search",
        "google_images",
        "google_news",
        "google_shopping",
        "google_videos",
        "google_places",
        "youtube_search",
        "youtube_search_extended",
        "youtube_metadata",
        "youtube_transcript",
        "youtube_captions",
        "youtube_trainability",
        "youtube_channel",
        "youtube_suggestions",
        "youtube_download"
      ]
    }
  }
}