{
  "openapi": "3.1.0",
  "info": {
    "title": "Rasczak",
    "version": "0.3.0"
  },
  "servers": [
    {
      "url": "https://rasczak-agent-service.rasczak-commons.workers.dev"
    }
  ],
  "paths": {
    "/api/v1/catalog": {
      "get": {
        "operationId": "catalog",
        "responses": {
          "200": {
            "description": "Methods, packs, prices and sample URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/methods/{id}": {
      "get": {
        "operationId": "method",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "premortem",
                "ach",
                "five-whys",
                "fishbone",
                "blue-ocean",
                "five-forces",
                "business-model",
                "value-proposition",
                "ansoff",
                "assumptions"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Free method",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Unsupported method",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sample": {
      "get": {
        "operationId": "samplePack",
        "responses": {
          "200": {
            "description": "Free complete vendor evaluation pack",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "version",
                    "intended_use",
                    "methods"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "enum": [
                        "vendor-evaluation",
                        "ai-rollout",
                        "strategy-redteam"
                      ]
                    },
                    "version": {
                      "type": "string"
                    },
                    "intended_use": {
                      "type": "string"
                    },
                    "methods": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packs/{id}": {
      "get": {
        "operationId": "decisionPack",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "vendor-evaluation",
                "ai-rollout",
                "strategy-redteam"
              ]
            }
          },
          {
            "in": "header",
            "name": "PAYMENT-SIGNATURE",
            "schema": {
              "type": "string"
            },
            "description": "x402 v2 encoded authorized payment; never send without operator authorization"
          }
        ],
        "responses": {
          "200": {
            "description": "Settled versioned result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "version",
                    "intended_use",
                    "methods"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "enum": [
                        "vendor-evaluation",
                        "ai-rollout",
                        "strategy-redteam"
                      ]
                    },
                    "version": {
                      "type": "string"
                    },
                    "intended_use": {
                      "type": "string"
                    },
                    "methods": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "x402 PAYMENT-REQUIRED challenge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Unsupported pack",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Replay conflict or reconciliation required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Payments disabled or unavailable; use free sample",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/kits": {
      "get": {
        "summary": "Read versioned public metadata",
        "responses": {
          "200": {
            "description": "Public metadata"
          },
          "404": {
            "description": "Unknown resource"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "domain",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ]
      }
    },
    "/api/v2/kits/{id}": {
      "get": {
        "summary": "Read versioned public metadata",
        "responses": {
          "200": {
            "description": "Public metadata"
          },
          "404": {
            "description": "Unknown resource"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v2/research": {
      "get": {
        "summary": "Research preview only, no orders",
        "responses": {
          "200": {
            "description": "Public metadata"
          },
          "404": {
            "description": "Unknown resource"
          }
        }
      }
    },
    "/api/v2/changes": {
      "get": {
        "summary": "Read versioned public metadata",
        "responses": {
          "200": {
            "description": "Public metadata"
          },
          "404": {
            "description": "Unknown resource"
          }
        }
      }
    },
    "/api/v2/research/feedback": {
      "post": {
        "summary": "Optional general feedback; no private information, order or charge",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "client_id"
                ],
                "properties": {
                  "client_id": {
                    "type": "string",
                    "pattern": "^[a-f0-9-]{32,36}$"
                  },
                  "kind": {
                    "enum": [
                      "interest",
                      "skill-feedback"
                    ]
                  },
                  "domain": {
                    "enum": [
                      "research",
                      "strategy",
                      "operational-design",
                      "red-team",
                      "collaboration",
                      "content",
                      "other"
                    ]
                  },
                  "model": {
                    "enum": [
                      "gpt-6-astra",
                      "claude-fable-5-1",
                      "grok-4.6",
                      "recommend"
                    ]
                  },
                  "budget": {
                    "enum": [
                      "under-1",
                      "1-5",
                      "5-20",
                      "20-100",
                      "over-100",
                      "unspecified"
                    ]
                  },
                  "rating": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 5
                  },
                  "human_confirmed": {
                    "type": "boolean"
                  },
                  "comment": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Duplicate"
          },
          "201": {
            "description": "Received, no charge"
          },
          "400": {
            "description": "Invalid or private information"
          },
          "429": {
            "description": "Rate limit"
          },
          "503": {
            "description": "Unavailable"
          }
        }
      }
    }
  }
}
