{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kdpcoloringbook-com/json-schema/kdpcoloringbook-com-generation-quote-request-schema.json",
  "title": "GenerationQuoteRequest",
  "description": "Lenient twin of GenerateRequest, used only to price a book.\n\nThe price must never be what stops a creation. POST /api/generate re-validates\neverything (moderation, plan limits, credits) before spending a single credit,\nso POST /api/generate/quote prices whatever the planner produced instead of\nanswering 422 — a 422 the UI could only show as \"Could not calculate the final\nprice, try again\", with the Create button stuck on its loading state forever.\n\nThe price depends on ``pages`` and the front-matter flags alone, so every text\nfield here drops its length bounds and the page count is clamped into the\nrange /api/generate accepts rather than rejected.",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kdpcoloringbook-com-openapi.json#/components/schemas/GenerationQuoteRequest",
  "properties": {
    "theme": {
      "type": "string",
      "title": "Theme",
      "default": ""
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    },
    "length": {
      "$ref": "#/$defs/BookLength",
      "default": "short"
    },
    "pages": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pages"
    },
    "style_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Style Id"
    },
    "custom_style": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Custom Style"
    },
    "reference_prompt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Reference Prompt"
    },
    "distribution_type": {
      "type": "string",
      "enum": [
        "progressive",
        "bold_and_easy",
        "cute_and_cozy"
      ],
      "title": "Distribution Type",
      "default": "progressive"
    },
    "character_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Character Count"
    },
    "language": {
      "type": "string",
      "enum": [
        "en",
        "es",
        "de",
        "fr",
        "it",
        "pt"
      ],
      "title": "Language",
      "default": "en"
    },
    "purpose": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "kdp",
            "gift",
            "other"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Purpose"
    },
    "style_description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Style Description"
    },
    "allow_text": {
      "type": "boolean",
      "title": "Allow Text",
      "default": false
    },
    "distribution": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/DistributionRange"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Distribution"
    },
    "user_rules": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "User Rules"
    },
    "include_copyright": {
      "type": "boolean",
      "title": "Include Copyright",
      "default": false
    },
    "include_tips": {
      "type": "boolean",
      "title": "Include Tips",
      "default": false
    },
    "include_review": {
      "type": "boolean",
      "title": "Include Review",
      "default": false
    },
    "include_test": {
      "type": "boolean",
      "title": "Include Test",
      "default": false
    }
  },
  "type": "object",
  "$defs": {
    "BookLength": {
      "type": "string",
      "enum": [
        "test",
        "short",
        "medium",
        "long"
      ],
      "title": "BookLength"
    },
    "DistributionRange": {
      "properties": {
        "start_page": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Start Page"
        },
        "end_page": {
          "type": "integer",
          "minimum": 1.0,
          "title": "End Page"
        },
        "theme": {
          "type": "string",
          "maxLength": 120,
          "minLength": 1,
          "title": "Theme"
        },
        "description": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 600
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        }
      },
      "type": "object",
      "required": [
        "start_page",
        "end_page",
        "theme"
      ],
      "title": "DistributionRange",
      "description": "One contiguous section of the book's page plan.\n\nShared contract with the frontend: ranges are contiguous and cover pages\n``1..config.pages`` exactly. ``theme`` is a short user-facing label (in the\nuser's language); ``description`` is an optional English brief that is fed\nto the page-prompt generator."
    }
  }
}