{
  "openapi": "3.1.0",
  "info": {
    "title": "Quack AI",
    "version": "2.0.0",
    "x-guidance": "Use GET /api/x402/agent-trust/{address} with a valid EVM address (0x…) in the URL path. Without a payment header you receive a 402 challenge — body and PAYMENT-REQUIRED response header both carry the same base64 x402 v2 challenge JSON. Pay the exact USDC amount on Base (eip155:8453) via x402 v2, then resend with a PAYMENT-SIGNATURE request header containing your base64-encoded payment payload. The paid 200 response contains ERC-8004 identity (erc8004), on-chain activity (onChainActivity), reputation, risk flags (riskFlags), a receipt ID (receipt), and the ISO timestamp paidAt.",
    "contact": {
      "email": "lynn@quackai.ai"
    },
    "description": "Agent Trust Check API — part of Q402 Connect, Quack AI's x402 suite on Base. Pay-per-call trust reports for any EVM agent address: ERC-8004 identity, on-chain activity, reputation, and risk flags. Basic check $0.02, deep report $0.49, monitoring $0.15 per address-day; settled in USDC on Base via the x402 protocol."
  },
  "paths": {
    "/api/x402/agent-trust/{address}": {
      "get": {
        "summary": "Agent Trust Check ($0.02 USDC)",
        "description": "ERC-8004 identity, on-chain activity (Base), reputation, and risk flags for an EVM agent address. Lightweight due-diligence signal at $0.02 USDC.",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$",
              "description": "EVM address to query (checksummed or lowercase)"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "402": {
            "description": "Payment Required — body and PAYMENT-REQUIRED response header both contain base64(challenge JSON)"
          },
          "200": {
            "description": "Trust data (paid)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "address",
                    "erc8004",
                    "onChainActivity",
                    "receipt",
                    "paidAt",
                    "priceUsdc"
                  ],
                  "properties": {
                    "address": {
                      "type": "string",
                      "description": "Checksummed EVM address"
                    },
                    "erc8004": {
                      "type": "object",
                      "description": "ERC-8004 identity registry lookup result",
                      "properties": {
                        "isRegistered": {
                          "type": "boolean"
                        },
                        "registrations": {
                          "type": "array"
                        },
                        "source": {
                          "type": "string"
                        }
                      }
                    },
                    "reputation": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "feedbackCount": {
                              "type": "number"
                            },
                            "summaryValue": {
                              "type": "string"
                            },
                            "valueDecimals": {
                              "type": "number"
                            },
                            "source": {
                              "type": "string"
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "onChainActivity": {
                      "type": "object",
                      "description": "Base mainnet on-chain activity (bucket only, no raw counts)",
                      "properties": {
                        "txCountBucket": {
                          "type": "string"
                        },
                        "recentActivityDetected": {
                          "type": "boolean"
                        },
                        "recentActivityWindowBlocks": {
                          "type": "number"
                        },
                        "source": {
                          "type": "string"
                        }
                      }
                    },
                    "riskFlags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "flag": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string",
                            "enum": [
                              "low",
                              "medium",
                              "high"
                            ]
                          },
                          "evidence": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "pattern": "^atx_",
                      "description": "Verifiable receipt ID for this query"
                    },
                    "paidAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "priceUsdc": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/x402/agent-trust/{address}/deep": {
      "get": {
        "summary": "Deep Report ($0.49 USDC)",
        "description": "Comprehensive Deep Report: ERC-8004 identity, reputation, risk flags (self-dealing, burst cadence, new wallet detection), and change indicators delta since last check. Premium tier for thorough agent due diligence.",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$",
              "description": "EVM address to query (checksummed or lowercase)"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.490000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "402": {
            "description": "Payment Required — body and PAYMENT-REQUIRED response header both contain base64(challenge JSON)"
          },
          "200": {
            "description": "Deep report data (paid)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "address",
                    "erc8004",
                    "onChainActivity",
                    "riskFlags",
                    "changeIndicators",
                    "receipt",
                    "paidAt",
                    "priceUsdc"
                  ],
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "erc8004": {
                      "type": "object"
                    },
                    "reputation": {
                      "oneOf": [
                        {
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "onChainActivity": {
                      "type": "object"
                    },
                    "riskFlags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "flag": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string",
                            "enum": [
                              "low",
                              "medium",
                              "high"
                            ]
                          },
                          "evidence": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "changeIndicators": {
                      "type": "object",
                      "description": "Indicators of change vs prior check snapshot",
                      "properties": {
                        "reputation_delta": {
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "new_risk_flags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "activity_delta_7d": {
                          "oneOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "identity_events": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "receipt": {
                      "type": "string",
                      "pattern": "^atx_"
                    },
                    "paidAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "priceUsdc": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/x402/agent-trust/{address}/monitor": {
      "get": {
        "summary": "Monitoring Check ($0.15 USDC)",
        "description": "Lightweight monitoring snapshot: ERC-8004 registration status and on-chain activity for continuous agent surveillance. Designed for high-frequency polling at low cost.",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$",
              "description": "EVM address to query (checksummed or lowercase)"
            }
          }
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.150000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "402": {
            "description": "Payment Required — body and PAYMENT-REQUIRED response header both contain base64(challenge JSON)"
          },
          "200": {
            "description": "Monitoring snapshot data (paid)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "address",
                    "erc8004",
                    "onChainActivity",
                    "receipt",
                    "paidAt",
                    "priceUsdc"
                  ],
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "erc8004": {
                      "type": "object"
                    },
                    "reputation": {
                      "oneOf": [
                        {
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "onChainActivity": {
                      "type": "object"
                    },
                    "receipt": {
                      "type": "string",
                      "pattern": "^atx_"
                    },
                    "paidAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "priceUsdc": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}