{
 "openapi": "3.0.3",
 "info": {
  "title": "AIS API: CVE intelligence + Agent Flight Recorder",
  "version": "0.3.0",
  "description": "AIS daily CVE prioritization — ranked by real exploitation (KEV + EPSS + KEV-recency), regenerated daily. https://aislabs.ai/api-docs No account needed: pay per call over x402 (HTTP 402, exact scheme, USDC on Base), or send a Gateway key (Authorization: Bearer ais_k_..., https://aislabs.ai/gateway/). Keys are scoped per building: CVE key $19 / 30 days, Flight Recorder key $19 / 30 days, campus pass $29 / 30 days or $149 / 12 months (every building). Paid once, nothing renews."
 },
 "servers": [
  {
   "url": "https://api.aislabs.ai"
  }
 ],
 "components": {
  "securitySchemes": {
   "x402": {
    "type": "apiKey",
    "in": "header",
    "name": "X-PAYMENT",
    "description": "x402 v1 payment payload (exact scheme, USDC on Base). Any x402 client builds it from the 402 challenge."
   },
   "gatewayKey": {
    "type": "http",
    "scheme": "bearer",
    "description": "AIS Gateway key (ais_k_...), scoped per building: https://aislabs.ai/gateway/"
   }
  }
 },
 "paths": {
  "/v1/brief/teaser": {
   "get": {
    "summary": "Free teaser: today's top-3, no scores",
    "security": [],
    "responses": {
     "200": {
      "description": "JSON"
     }
    }
   }
  },
  "/v1/brief/today": {
   "get": {
    "summary": "Today's full ranked CVE priorities (x402 $0.02 per call, or a CVE key ($19 / 30 days) or campus pass)",
    "security": [
     {
      "x402": []
     },
     {
      "gatewayKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "JSON payload"
     },
     "402": {
      "description": "Payment required: pay with an x402 client (x402Version 1, exact scheme, USDC on Base) or send a Gateway key"
     }
    }
   }
  },
  "/v1/kev/fresh": {
   "get": {
    "summary": "KEV additions in the last 7 days with today's ranks (x402 $0.01 per call, or a CVE key ($19 / 30 days) or campus pass)",
    "security": [
     {
      "x402": []
     },
     {
      "gatewayKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "JSON payload"
     },
     "402": {
      "description": "Payment required: pay with an x402 client (x402Version 1, exact scheme, USDC on Base) or send a Gateway key"
     }
    }
   }
  },
  "/v1/cve/{cve_id}": {
   "get": {
    "summary": "Single-CVE verdict from today's ranked set (x402 $0.005 per call, or a CVE key ($19 / 30 days) or campus pass)",
    "parameters": [
     {
      "name": "cve_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "CVE-YYYY-NNNN"
     }
    ],
    "security": [
     {
      "x402": []
     },
     {
      "gatewayKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "JSON payload"
     },
     "402": {
      "description": "Payment required: pay with an x402 client (x402Version 1, exact scheme, USDC on Base) or send a Gateway key"
     }
    }
   }
  },
  "/v1/archive/{date}": {
   "get": {
    "summary": "Historical daily brief (YYYY-MM-DD) (x402 $0.05 per call, or a CVE key ($19 / 30 days) or campus pass)",
    "parameters": [
     {
      "name": "date",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "YYYY-MM-DD (archive starts 2026-08-19)"
     }
    ],
    "security": [
     {
      "x402": []
     },
     {
      "gatewayKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "JSON payload"
     },
     "402": {
      "description": "Payment required: pay with an x402 client (x402Version 1, exact scheme, USDC on Base) or send a Gateway key"
     }
    }
   }
  },
  "/v1/recorder": {
   "get": {
    "summary": "Agent Flight Recorder: endpoint index and tiers (free)",
    "security": [],
    "responses": {
     "200": {
      "description": "JSON"
     }
    }
   }
  },
  "/v1/recorder/monitors": {
   "post": {
    "summary": "Register a monitor, returns monitor_id + secret. Free: 1 monitor per alert target, webhook alerts. With a Flight Recorder key ($19 / 30 days) or campus pass: 20 monitors, stored capsules, email alerts.",
    "security": [
     {},
     {
      "gatewayKey": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name"
        ],
        "properties": {
         "name": {
          "type": "string"
         },
         "period_minutes": {
          "type": "number"
         },
         "grace_minutes": {
          "type": "number"
         },
         "alert_webhook": {
          "type": "string"
         },
         "alert_email": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "JSON"
     }
    }
   }
  },
  "/v1/recorder/monitors/{id}": {
   "delete": {
    "summary": "Remove a monitor (its secret or the owning key)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "monitor_id (mon_...)"
     },
     {
      "name": "s",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Monitor secret from registration (not needed with the owning key)"
     }
    ],
    "security": [
     {},
     {
      "gatewayKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "JSON"
     }
    }
   }
  },
  "/v1/recorder/beat/{id}/{secret}": {
   "get": {
    "summary": "Heartbeat (?status=fail reports a failure)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "monitor_id (mon_...)"
     },
     {
      "name": "secret",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "monitor secret (ms_...)"
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "ok",
        "fail"
       ]
      },
      "description": "fail reports a failure now"
     }
    ],
    "security": [],
    "responses": {
     "200": {
      "description": "JSON"
     }
    }
   },
   "post": {
    "summary": "Heartbeat with an optional state capsule (stored for key-owned monitors)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "monitor_id (mon_...)"
     },
     {
      "name": "secret",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "monitor secret (ms_...)"
     }
    ],
    "security": [],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "capsule": {
          "type": "object"
         },
         "status": {
          "type": "string",
          "enum": [
           "ok",
           "fail"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "JSON"
     }
    }
   }
  },
  "/v1/recorder/capsule/{id}": {
   "get": {
    "summary": "Last state capsule of a key-owned monitor, to resume from where it died",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "monitor_id (mon_...)"
     },
     {
      "name": "s",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Monitor secret from registration (not needed with the owning key)"
     }
    ],
    "security": [
     {},
     {
      "gatewayKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "JSON"
     }
    }
   }
  },
  "/v1/recorder/fleet": {
   "get": {
    "summary": "Every monitor owned by the calling key (a Flight Recorder key ($19 / 30 days) or campus pass)",
    "security": [
     {
      "gatewayKey": []
     }
    ],
    "responses": {
     "200": {
      "description": "JSON"
     },
     "402": {
      "description": "needs a Flight Recorder key ($19 / 30 days) or campus pass"
     }
    }
   }
  }
 }
}