{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/synlake-ai/json-schema/synlake-ai-query-request-schema.json",
  "title": "QueryRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/synlake-ai-openapi.json#/components/schemas/QueryRequest",
  "type": "object",
  "required": [
    "intent",
    "requirements"
  ],
  "properties": {
    "intent": {
      "type": "string",
      "enum": [
        "compute"
      ],
      "description": "Only 'compute' in v0.1"
    },
    "requirements": {
      "type": "object",
      "properties": {
        "vcpus": {
          "type": "integer",
          "description": "Minimum vCPUs"
        },
        "memory_gb": {
          "type": "number",
          "description": "Minimum memory in GB"
        },
        "storage_gb": {
          "type": "integer",
          "default": 30
        },
        "gpu": {
          "type": "boolean",
          "default": false
        },
        "region": {
          "type": "string",
          "description": "e.g. us-east-1, us-central1"
        },
        "os": {
          "type": "string",
          "enum": [
            "linux"
          ]
        },
        "architecture": {
          "type": "string",
          "enum": [
            "x86_64",
            "arm64"
          ]
        }
      }
    },
    "constraints": {
      "type": "object",
      "additionalProperties": false,
      "description": "Constraint object. Unknown keys → INVALID_REQUIREMENTS; variants of the budget key (max_monthly_budget, monthly_budget_usd, budget, budget_usd) → suggestions pointing at the canonical name. (SYN-53)",
      "properties": {
        "max_monthly_budget_usd": {
          "type": "number",
          "minimum": 0,
          "description": "Maximum monthly spend in USD. /estimate annotates within_budget per estimate + budget_met top-level (returns 200). /query enforces with 400 BUDGET_EXCEEDED."
        },
        "providers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Provider"
          }
        },
        "compliance": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "availability": {
          "type": "string",
          "enum": [
            "standard",
            "high",
            "critical"
          ]
        }
      }
    },
    "output": {
      "type": "object",
      "properties": {
        "include_terraform": {
          "type": "boolean",
          "default": true
        },
        "include_cli": {
          "type": "boolean",
          "default": true
        },
        "include_alternatives": {
          "type": "boolean",
          "default": true
        },
        "max_alternatives": {
          "type": "integer",
          "default": 3
        },
        "pricing_model": {
          "$ref": "#/$defs/PricingModel"
        }
      }
    }
  },
  "$defs": {
    "PricingModel": {
      "type": "string",
      "enum": [
        "on_demand",
        "spot",
        "reserved_1y"
      ]
    },
    "Provider": {
      "type": "string",
      "enum": [
        "aws",
        "gcp",
        "azure"
      ]
    }
  }
}