{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/yappy-biz/json-schema/yappy-biz-pricing-schema.json",
  "title": "Pricing",
  "description": "The complete cost picture: the app, the backends, and this API.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/yappy-biz-openapi.json#/components/schemas/Pricing",
  "type": "object",
  "required": [
    "object",
    "app",
    "plans",
    "api"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "pricing",
      "description": "Type discriminator."
    },
    "app": {
      "$ref": "#/$defs/Plan"
    },
    "plans": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Plan"
      },
      "description": "Every backend option and what it costs."
    },
    "api": {
      "type": "object",
      "description": "The terms of this API itself.",
      "required": [
        "price",
        "currency",
        "api_key_required"
      ],
      "properties": {
        "price": {
          "type": "number",
          "description": "Cost per call."
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 code."
        },
        "api_key_required": {
          "type": "boolean",
          "description": "Whether reads need a credential."
        },
        "rate_limit": {
          "type": "string",
          "description": "The anonymous ceiling, in words."
        }
      }
    },
    "currency": {
      "type": "string",
      "description": "Default currency for this document."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "The human pricing page."
    }
  },
  "$defs": {
    "Plan": {
      "type": "object",
      "title": "Plan",
      "description": "A way of paying — or not paying — for part of Yappy.",
      "required": [
        "object",
        "id",
        "name",
        "price",
        "currency",
        "description"
      ],
      "properties": {
        "object": {
          "type": "string",
          "const": "plan",
          "description": "Type discriminator."
        },
        "id": {
          "type": "string",
          "description": "Stable identifier."
        },
        "name": {
          "type": "string",
          "description": "Display name."
        },
        "price": {
          "type": [
            "number",
            "null"
          ],
          "description": "Price in the given currency, 0 for free, null when it is billed by a third party."
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 code."
        },
        "billing_period": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "month",
            "year",
            "usage",
            null
          ],
          "description": "How often the price recurs."
        },
        "billed_by": {
          "type": "string",
          "description": "Who charges you: 'yappy', 'nobody', or a third-party provider."
        },
        "description": {
          "type": "string",
          "description": "What this covers."
        },
        "includes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What you get."
        }
      }
    }
  }
}