{
  "openapi": "3.1.0",
  "info": {
    "title": "GeoMacro Global Risk Gate API",
    "version": "1.0.0",
    "description": "Explainable, fail-closed Pre-Execution Risk Gate for AI agents and USDC workflows across Geopolitics, Macro / FX, and Critical Minerals. Ed25519-signed advisory verdicts (execution_authorized=false).",
    "contact": {
      "name": "GeoMacro",
      "email": "contact@geomacro.live",
      "url": "https://geomacro.live"
    }
  },
  "servers": [
    {
      "url": "https://geomacro.live"
    }
  ],
  "paths": {
    "/api/v1/payments/usdc-risk-gate": {
      "get": {
        "operationId": "evaluateUsdcRiskGateGet",
        "summary": "x402 USDC Risk Gate challenge and evaluation (Base, Polygon, Arc)",
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.15",
          "currency": "USD"
        },
        "parameters": [
          {
            "name": "country_iso3",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "IND"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "GEOPOLITICS",
                "MACRO_FX",
                "CRITICAL_MINERALS"
              ],
              "default": "GEOPOLITICS"
            }
          },
          {
            "name": "tier",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "BASIC",
                "STANDARD",
                "COMPLEX"
              ],
              "default": "BASIC"
            }
          },
          {
            "name": "network",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "base",
                "polygon",
                "arc"
              ],
              "default": "base"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ed25519-signed Risk Gate verdict (execution_authorized=false)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "execution_authorized": {
                      "type": "boolean",
                      "example": false
                    },
                    "country_iso3": {
                      "type": "string",
                      "example": "IND"
                    },
                    "category": {
                      "type": "string",
                      "example": "GEOPOLITICS"
                    },
                    "tier": {
                      "type": "string",
                      "example": "BASIC"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "CONTINUE",
                        "REDUCE_LIMIT",
                        "REQUIRE_APPROVAL",
                        "PAUSE"
                      ]
                    },
                    "risk_score": {
                      "type": "number"
                    },
                    "confidence": {
                      "type": "number"
                    },
                    "analyst_brief": {
                      "type": "string"
                    },
                    "decision_signed_payload": {
                      "type": "object"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "key_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "x402 Payment Required"
          }
        }
      },
      "post": {
        "operationId": "evaluateUsdcRiskGatePost",
        "summary": "Pay-per-call USDC Risk Gate via x402 ($0.15 BASIC / $0.20 STANDARD / $0.30 COMPLEX)",
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.15",
          "currency": "USD"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "country_iso3": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$",
                    "default": "IND",
                    "example": "IND"
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "GEOPOLITICS",
                      "MACRO_FX",
                      "CRITICAL_MINERALS"
                    ],
                    "default": "GEOPOLITICS",
                    "example": "GEOPOLITICS"
                  },
                  "tier": {
                    "type": "string",
                    "enum": [
                      "BASIC",
                      "STANDARD",
                      "COMPLEX"
                    ],
                    "default": "BASIC",
                    "example": "BASIC"
                  },
                  "network": {
                    "type": "string",
                    "enum": [
                      "base",
                      "polygon",
                      "arc"
                    ],
                    "default": "base",
                    "example": "base"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ed25519-signed Risk Gate verdict (execution_authorized=false)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "execution_authorized": {
                      "type": "boolean",
                      "example": false
                    },
                    "country_iso3": {
                      "type": "string",
                      "example": "IND"
                    },
                    "category": {
                      "type": "string",
                      "example": "GEOPOLITICS"
                    },
                    "tier": {
                      "type": "string",
                      "example": "BASIC"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "CONTINUE",
                        "REDUCE_LIMIT",
                        "REQUIRE_APPROVAL",
                        "PAUSE"
                      ]
                    },
                    "risk_score": {
                      "type": "number"
                    },
                    "confidence": {
                      "type": "number"
                    },
                    "analyst_brief": {
                      "type": "string"
                    },
                    "decision_signed_payload": {
                      "type": "object"
                    },
                    "signature": {
                      "type": "string"
                    },
                    "key_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "x402 Payment Required"
          }
        }
      }
    },
    "/v1/risk-stream/commercial-public-key": {
      "get": {
        "operationId": "getCommercialPublicKey",
        "summary": "Ed25519 public key discovery for Risk Gate verification",
        "security": [],
        "responses": {
          "200": {
            "description": "Public verification key"
          }
        }
      }
    },
    "/api/v1/finds": {
      "get": {
        "operationId": "getPublicFinds",
        "summary": "Public unscored research Find cards",
        "security": [],
        "responses": {
          "200": {
            "description": "Find cards list"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Service health check",
        "security": [],
        "responses": {
          "200": {
            "description": "Healthy"
          }
        }
      }
    }
  }
}
