{
  "openapi": "3.1.0",
  "info": {
    "title": "NoJunk Safety Gate",
    "version": "1.0.0",
    "description": "Yes/no safety verdicts an agent runs before it acts: before sending funds (/wallet), buying a token (/token), opening a link (/site) or paying an x402 seller (/x402). Every answer has safe (true/false), verdict (ALLOW, CAUTION, BLOCK) and a one-line reason.",
    "x-guidance": "Call the matching route right before the action and proceed only if safe is true (or verdict is not BLOCK, if you accept CAUTION). POST JSON or GET with query parameters. Paid per call in USDC on Base via x402; invalid input and upstream outages are never charged."
  },
  "servers": [
    {
      "url": "https://nojunk-safety-gate.mick8511.workers.dev"
    }
  ],
  "paths": {
    "/wallet": {
      "post": {
        "operationId": "gate_wallet",
        "summary": "Is this wallet safe to send to?",
        "tags": [
          "Security",
          "Safety gate"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Wallet or contract address (0x...)"
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "base",
                      "ethereum",
                      "bsc",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche"
                    ],
                    "description": "Optional; defaults to base"
                  }
                },
                "required": [
                  "address"
                ]
              },
              "example": {
                "address": "0x098B716B8Aaf21512996dC57EB0615e2383E2f96",
                "chain": "ethereum"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "safe": {
                      "type": "boolean"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "ALLOW",
                        "CAUTION",
                        "BLOCK"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "safe",
                    "verdict",
                    "reason"
                  ]
                },
                "example": {
                  "check": "wallet",
                  "target": "0x098B716B8Aaf21512996dC57EB0615e2383E2f96",
                  "chain": "ethereum",
                  "safe": false,
                  "verdict": "BLOCK",
                  "reason": "Reported for theft/stealing attacks.",
                  "flags": [
                    {
                      "severity": "critical",
                      "flag": "stealing_attack",
                      "detail": "Reported for theft/stealing attacks."
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge in the PAYMENT-REQUIRED header)"
          }
        }
      },
      "get": {
        "operationId": "gate_wallet_get",
        "summary": "Is this wallet safe to send to?",
        "tags": [
          "Security",
          "Safety gate"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Wallet or contract address (0x...)"
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional; defaults to base"
          }
        ],
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "safe": {
                      "type": "boolean"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "ALLOW",
                        "CAUTION",
                        "BLOCK"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "safe",
                    "verdict",
                    "reason"
                  ]
                },
                "example": {
                  "check": "wallet",
                  "target": "0x098B716B8Aaf21512996dC57EB0615e2383E2f96",
                  "chain": "ethereum",
                  "safe": false,
                  "verdict": "BLOCK",
                  "reason": "Reported for theft/stealing attacks.",
                  "flags": [
                    {
                      "severity": "critical",
                      "flag": "stealing_attack",
                      "detail": "Reported for theft/stealing attacks."
                    }
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge in the PAYMENT-REQUIRED header)"
          }
        }
      }
    },
    "/token": {
      "post": {
        "operationId": "gate_token",
        "summary": "Is this token safe to buy?",
        "tags": [
          "Security",
          "Safety gate"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Token contract address (0x...) or Solana mint"
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "base",
                      "ethereum",
                      "bsc",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana"
                    ],
                    "description": "Optional; 0x addresses default to base"
                  }
                },
                "required": [
                  "token"
                ]
              },
              "example": {
                "token": "0x532f27101965dd16442E59d40670FaF5eBB142E4",
                "chain": "base"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "safe": {
                      "type": "boolean"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "ALLOW",
                        "CAUTION",
                        "BLOCK"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "safe",
                    "verdict",
                    "reason"
                  ]
                },
                "example": {
                  "check": "token",
                  "target": "0x532f27101965dd16442E59d40670FaF5eBB142E4",
                  "chain": "base",
                  "safe": true,
                  "verdict": "ALLOW",
                  "reason": "BRETT: no major red flags found.",
                  "flags": []
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge in the PAYMENT-REQUIRED header)"
          }
        }
      },
      "get": {
        "operationId": "gate_token_get",
        "summary": "Is this token safe to buy?",
        "tags": [
          "Security",
          "Safety gate"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token contract address (0x...) or Solana mint"
          },
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional; 0x addresses default to base"
          }
        ],
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "safe": {
                      "type": "boolean"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "ALLOW",
                        "CAUTION",
                        "BLOCK"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "safe",
                    "verdict",
                    "reason"
                  ]
                },
                "example": {
                  "check": "token",
                  "target": "0x532f27101965dd16442E59d40670FaF5eBB142E4",
                  "chain": "base",
                  "safe": true,
                  "verdict": "ALLOW",
                  "reason": "BRETT: no major red flags found.",
                  "flags": []
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge in the PAYMENT-REQUIRED header)"
          }
        }
      }
    },
    "/site": {
      "post": {
        "operationId": "gate_site",
        "summary": "Is this website or link safe?",
        "tags": [
          "Security",
          "Safety gate"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "URL or domain, e.g. https://example.com/login or example.com"
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://example.com/login"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "safe": {
                      "type": "boolean"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "ALLOW",
                        "CAUTION",
                        "BLOCK"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "safe",
                    "verdict",
                    "reason"
                  ]
                },
                "example": {
                  "check": "site",
                  "target": "example.com",
                  "safe": true,
                  "verdict": "ALLOW",
                  "reason": "Established domain (31 years old) with no phishing reports.",
                  "flags": []
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge in the PAYMENT-REQUIRED header)"
          }
        }
      },
      "get": {
        "operationId": "gate_site_get",
        "summary": "Is this website or link safe?",
        "tags": [
          "Security",
          "Safety gate"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL or domain, e.g. https://example.com/login or example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "safe": {
                      "type": "boolean"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "ALLOW",
                        "CAUTION",
                        "BLOCK"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "safe",
                    "verdict",
                    "reason"
                  ]
                },
                "example": {
                  "check": "site",
                  "target": "example.com",
                  "safe": true,
                  "verdict": "ALLOW",
                  "reason": "Established domain (31 years old) with no phishing reports.",
                  "flags": []
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge in the PAYMENT-REQUIRED header)"
          }
        }
      }
    },
    "/x402": {
      "post": {
        "operationId": "gate_x402",
        "summary": "Is this x402 seller safe to pay?",
        "tags": [
          "Security",
          "Safety gate"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Full https URL of the x402 paid endpoint you are about to pay"
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://2s.io/api/weather/zip?zip=94103"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "safe": {
                      "type": "boolean"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "ALLOW",
                        "CAUTION",
                        "BLOCK"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "safe",
                    "verdict",
                    "reason"
                  ]
                },
                "example": {
                  "check": "x402",
                  "target": "https://2s.io/api/weather/zip?zip=94103",
                  "safe": true,
                  "verdict": "ALLOW",
                  "reason": "Valid x402 v2 challenge: $0.003 USDC on Base to a wallet with no reports.",
                  "payable": true,
                  "x402_version": 2,
                  "price_usd": 0.003,
                  "pay_to": "0x2b6D4988Db4723E6908Db86Ab2b8dFBc51FC32C5",
                  "network": "eip155:8453",
                  "flags": []
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge in the PAYMENT-REQUIRED header)"
          }
        }
      },
      "get": {
        "operationId": "gate_x402_get",
        "summary": "Is this x402 seller safe to pay?",
        "tags": [
          "Security",
          "Safety gate"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Full https URL of the x402 paid endpoint you are about to pay"
          }
        ],
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "safe": {
                      "type": "boolean"
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "ALLOW",
                        "CAUTION",
                        "BLOCK"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "flag": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "safe",
                    "verdict",
                    "reason"
                  ]
                },
                "example": {
                  "check": "x402",
                  "target": "https://2s.io/api/weather/zip?zip=94103",
                  "safe": true,
                  "verdict": "ALLOW",
                  "reason": "Valid x402 v2 challenge: $0.003 USDC on Base to a wallet with no reports.",
                  "payable": true,
                  "x402_version": 2,
                  "price_usd": 0.003,
                  "pay_to": "0x2b6D4988Db4723E6908Db86Ab2b8dFBc51FC32C5",
                  "network": "eip155:8453",
                  "flags": []
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 v2 challenge in the PAYMENT-REQUIRED header)"
          }
        }
      }
    }
  }
}