{
  "openapi": "3.1.0",
  "info": {
    "title": "CheapCrawler Pricing Quote & Status API",
    "version": "3.0.0",
    "description": "Public GET-only pricing quote API returning volume tiers, included perks, live USD quotes, pre-filled /buy checkout links, and health status for CheapCrawler.",
    "contact": {
      "name": "CheapCrawler Support",
      "email": "support@cheapcrawler.com",
      "url": "https://cheapcrawler.com/support/"
    }
  },
  "servers": [
    {
      "url": "https://cheapcrawler.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/agent/buy": {
      "get": {
        "operationId": "getPricingQuote",
        "summary": "Get volume pricing tiers, a live USD quote, and a pre-filled /buy checkout URL",
        "description": "Call without query parameters for the full pricing overview (volume tiers and free 20 GB cloud storage), or pass quantity (1-999), billing_mode (subscription or one_time), and email to receive a live USD quote and pre-filled /buy checkout_url. If the buyer has not shared their email or billing mode yet, ask for both so /buy pre-fills everything and the buyer only needs to click Send code, enter the 6-digit OTP, and pay via Paddle Checkout.",
        "parameters": [
          {
            "name": "quantity",
            "in": "query",
            "required": false,
            "description": "Number of licenses (1-999). Aliases: qty, licenses.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 999
            }
          },
          {
            "name": "billing_mode",
            "in": "query",
            "required": false,
            "description": "Billing frequency (subscription or one_time). Alias: mode. Ask the buyer which they prefer if unstated.",
            "schema": {
              "type": "string",
              "enum": [
                "subscription",
                "one_time"
              ],
              "default": "subscription"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Recommended: buyer email address to pre-fill on /buy for 1-click OTP verification. Ask the buyer for their email if not yet provided.",
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pricing tier overview (when quantity is omitted) or live USD quote with pre-filled checkout_url (when quantity is provided).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Edge Worker health check",
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "service",
                    "timestamp"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    },
                    "service": {
                      "type": "string",
                      "example": "cheapcrawler-edge-worker"
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
