{
  "openapi": "3.1.0",
  "info": {
    "title": "AccessGraph",
    "version": "0.2.0",
    "description": "Preflight a public HTTPS URL before fetching. Returns observed access restrictions and the lowest observed-cost eligible route. Does not bypass restrictions or execute transactions. Unknown evidence produces no recommendation."
  },
  "servers": [
    {
      "url": "https://accessgraph.snugguppy5.chatgpt.site"
    }
  ],
  "paths": {
    "/route": {
      "post": {
        "operationId": "route",
        "summary": "Find an evidenced access route",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "target_url",
                  "action",
                  "capabilities"
                ],
                "properties": {
                  "target_url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "read",
                      "search",
                      "ai-input",
                      "ai-train",
                      "transact"
                    ]
                  },
                  "capabilities": {
                    "type": "array",
                    "maxItems": 8,
                    "items": {
                      "type": "string",
                      "enum": [
                        "http",
                        "browser",
                        "mcp",
                        "a2a",
                        "x402"
                      ]
                    }
                  },
                  "user_agent": {
                    "type": "string",
                    "pattern": "^[A-Za-z_-]{1,64}$",
                    "default": "AccessGraphBot"
                  },
                  "budget_usd": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000,
                    "default": 0
                  }
                }
              },
              "example": {
                "target_url": "https://example.com/",
                "action": "read",
                "capabilities": [
                  "http",
                  "mcp"
                ],
                "budget_usd": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidence-backed routing decision",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "decision",
                    "recommended",
                    "evidence"
                  ],
                  "properties": {
                    "decision": {
                      "enum": [
                        "route_available",
                        "conditional",
                        "blocked",
                        "unknown"
                      ]
                    },
                    "recommended": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "evidence": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "Telemetry or quota storage unavailable"
          }
        }
      }
    },
    "/feedback": {
      "post": {
        "operationId": "reportOutcome",
        "summary": "Report one outcome using the receipt returned by /route",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "request_id",
                  "feedback_token",
                  "success"
                ],
                "properties": {
                  "request_id": {
                    "type": "string"
                  },
                  "feedback_token": {
                    "type": "string"
                  },
                  "success": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded as a client report, not independently verified"
          },
          "400": {
            "description": "Invalid receipt or duplicate"
          }
        }
      }
    },
    "/index.json": {
      "get": {
        "operationId": "accessIndex",
        "summary": "Aggregate Agent Access Index pilot observations",
        "responses": {
          "200": {
            "description": "Aggregate observed routing decisions"
          }
        }
      }
    }
  }
}