{
 "openapi": "3.1.0",
 "info": {
  "title": "Agent Field Kit Catalog API",
  "version": "0.2.0",
  "description": "Catalog, search and Stripe-hosted checkout for agentfieldkit.com. Checkout returns 503 checkout_not_open until launch. Creating a checkout never charges; payment happens on the returned Stripe page.",
  "x-logo": {
   "url": "https://agentfieldkit.com/brand/logo-512.png",
   "altText": "Agent Field Kit",
   "backgroundColor": "#14140f"
  },
  "contact": {
   "name": "Agent Field Kit",
   "email": "support@agentfieldkit.com",
   "url": "https://agentfieldkit.com/contact"
  }
 },
 "servers": [
  {
   "url": "https://agentfieldkit.com"
  }
 ],
 "paths": {
  "/api/catalog": {
   "get": {
    "operationId": "getCatalog",
    "summary": "Full catalog, or one product by id",
    "parameters": [
     {
      "name": "id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "cost-roi-calculator",
        "eval-test-plan",
        "incident-runbooks",
        "vendor-security-questionnaire",
        "afk-cyber-bundle-pro-year",
        "cyber-defense-bundle",
        "mcp-tool-access-review",
        "prompt-injection-test-pack",
        "agent-observability-starter",
        "agent-security-audit-kit",
        "realtime-agent-monitoring-kit",
        "ai-slop-editing-kit",
        "secrets-rotation-kit",
        "approval-gates-kit",
        "eu-ai-act-transparency-kit",
        "mcp-server-auth-kit",
        "agent-skill-authoring-kit",
        "ai-supply-chain-defense-kit",
        "inference-key-abuse-kit",
        "ci-registry-credential-kit",
        "oauth-grant-revocation-kit",
        "cyber-defense-dashboard-kit",
        "full-kit",
        "team-license"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Catalog or product",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "Unknown id"
     }
    }
   }
  },
  "/api/search": {
   "get": {
    "operationId": "searchProducts",
    "summary": "Keyword search over products",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "schema": {
       "type": "string",
       "maxLength": 200
      }
     },
     {
      "name": "type",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "template",
        "bundle",
        "license"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 20,
       "default": 10
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Ranked results",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "query": {
           "type": "string"
          },
          "purchasable": {
           "type": "boolean"
          },
          "count": {
           "type": "integer"
          },
          "results": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Product"
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/checkout": {
   "post": {
    "operationId": "createCheckout",
    "summary": "Create a Stripe-hosted Checkout Session; returns checkout_url (does not charge)",
    "parameters": [
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "product_id"
        ],
        "properties": {
         "product_id": {
          "type": "string",
          "enum": [
           "cost-roi-calculator",
           "eval-test-plan",
           "incident-runbooks",
           "vendor-security-questionnaire",
           "afk-cyber-bundle-pro-year",
           "cyber-defense-bundle",
           "mcp-tool-access-review",
           "prompt-injection-test-pack",
           "agent-observability-starter",
           "agent-security-audit-kit",
           "realtime-agent-monitoring-kit",
           "ai-slop-editing-kit",
           "secrets-rotation-kit",
           "approval-gates-kit",
           "eu-ai-act-transparency-kit",
           "mcp-server-auth-kit",
           "agent-skill-authoring-kit",
           "ai-supply-chain-defense-kit",
           "inference-key-abuse-kit",
           "ci-registry-credential-kit",
           "oauth-grant-revocation-kit",
           "cyber-defense-dashboard-kit",
           "full-kit",
           "team-license"
          ]
         },
         "email": {
          "type": "string",
          "format": "email"
         },
         "agent_name": {
          "type": "string",
          "maxLength": 100
         },
         "client_reference_id": {
          "type": "string",
          "maxLength": 200
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Checkout created",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "checkout_url": {
           "type": "string",
           "format": "uri"
          },
          "session_id": {
           "type": "string"
          },
          "expires_at": {
           "type": "string"
          },
          "amount": {
           "type": "integer"
          },
          "currency": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad input"
     },
     "429": {
      "description": "Rate limited (10/hour/IP)"
     },
     "503": {
      "description": "checkout_not_open"
     }
    }
   }
  },
  "/api/order": {
   "get": {
    "operationId": "getOrder",
    "summary": "After payment: order details and signed download links (72h, 5 downloads/file)",
    "parameters": [
     {
      "name": "session_id",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "format",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "json"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Order with files[]"
     },
     "402": {
      "description": "Not paid"
     },
     "410": {
      "description": "Download window expired"
     }
    }
   }
  },
  "/api/kit-request": {
   "get": {
    "operationId": "listKitRequestTopics",
    "summary": "Topic ids and fields for kit requests",
    "responses": {
     "200": {
      "description": "Topics and tiers"
     }
    }
   },
   "post": {
    "operationId": "requestKit",
    "summary": "Request a new kit (what you would buy next). Email optional and used only to notify when a matching kit ships.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "topics": {
          "type": "array",
          "items": {
           "type": "string",
           "enum": [
            "eu-ai-act-readiness",
            "agent-privacy-dpia",
            "rag-quality-eval",
            "human-escalation-design",
            "multi-agent-testing",
            "model-selection-scorecard",
            "agent-slo-sla",
            "support-agent-playbook",
            "agent-cost-chargeback",
            "other"
           ]
          }
         },
         "idea": {
          "type": "string",
          "maxLength": 1000
         },
         "tier": {
          "type": "string",
          "enum": [
           "29",
           "79",
           "199",
           "not_sure"
          ]
         },
         "email": {
          "type": "string",
          "format": "email"
         },
         "notify": {
          "type": "boolean"
         },
         "agent_name": {
          "type": "string",
          "maxLength": 100
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Stored"
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited (5/hour/IP)"
     }
    }
   }
  },
  "/api/poll": {
   "get": {
    "operationId": "getAgentPoll",
    "summary": "Poll question and option ids. ?results=1 returns live results only after you have voted (afk_poll_voted cookie).",
    "parameters": [
     {
      "name": "results",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "1"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Question and options, or results"
     },
     "403": {
      "description": "Vote first to see results"
     }
    }
   },
   "post": {
    "operationId": "voteAgentPoll",
    "summary": "Vote in 'Which AI agent platforms do you use regularly?' Multi-select. Only with the person's consent and their real answer.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "choices"
        ],
        "properties": {
         "choices": {
          "type": "array",
          "minItems": 1,
          "items": {
           "type": "string",
           "enum": [
            "openclaw",
            "grok-bot",
            "chatgpt-dots",
            "muse",
            "instinct",
            "claude-cowork",
            "gemini-spark",
            "microsoft-copilot",
            "manus",
            "other",
            "none"
           ]
          }
         },
         "other": {
          "type": "string",
          "maxLength": 80
         },
         "agent_name": {
          "type": "string",
          "maxLength": 100
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Stored; returns live results"
     },
     "400": {
      "description": "Invalid input"
     },
     "429": {
      "description": "Rate limited (3/day)"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Product": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "type": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "format": {
      "type": "string"
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "tags": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "price": {
      "type": "object",
      "description": "amount in USD, one-time"
     }
    }
   }
  }
 }
}