{
  "openapi": "3.0.3",
  "info": {
    "title": "WalletIntel Crypto Wallet Sanctions Screening API",
    "description": "Screens crypto wallet addresses against the U.S. Treasury OFAC SDN list (every digital currency address in the SDN Advanced file, about 1,050, refreshed daily at 06:00 UTC) and returns a 0-100 risk score. Ethereum, Base, Polygon and Arbitrum wallets also get balances, 30-day outbound activity and, on /investigate, transaction-graph checks and a written narrative. If the sanctions list or chain data cannot be read the API answers 503 (not billed); it never reports a wallet as clean because a source failed. Generated from packages/wallet-intel/src/handlers/api.ts and verified against the live API on Oct 12 2026.\n",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://walletintel.waltsoft.net/v1",
      "description": "WalletIntel production endpoint"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/scan": {
      "post": {
        "operationId": "screenWallet",
        "summary": "OFAC sanctions check and risk score for one wallet",
        "description": "Any address format: EVM (0x...), Bitcoin, Tron or Solana are detected; pass chain for other currencies (e.g. litecoin, monero). balances and activity_summary are filled for ethereum, base, polygon and arbitrum and null otherwise (see coverage).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressRequest"
              },
              "example": {
                "address": "0x28c6c06298d514db089934071355e5743bf21d60"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screening result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/investigate": {
      "post": {
        "operationId": "investigateWallet",
        "summary": "Full investigation of an EVM wallet",
        "description": "Everything in /scan plus transaction-graph checks over the latest 200 inbound and 200 outbound transfers (Tornado Cash contracts, known exchanges, DeFi protocols), a sanctions check of up to 5 counterparties and a risk narrative written by Amazon Nova 2 Lite. Ethereum, Base, Polygon and Arbitrum only.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressRequest"
              },
              "example": {
                "address": "0x28c6c06298d514db089934071355e5743bf21d60"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Investigation result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvestigationResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/batch": {
      "post": {
        "operationId": "screenWallets",
        "summary": "OFAC sanctions check for up to 20 wallets",
        "description": "OFAC screening and risk score per address (duplicates merged). An address that cannot be read is returned with an error; on AWS Marketplace a batch is one call.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "addresses"
                ],
                "properties": {
                  "addresses": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": {
                      "type": "string"
                    }
                  },
                  "chain": {
                    "type": "string",
                    "description": "Optional chain for every address"
                  }
                }
              },
              "example": {
                "addresses": [
                  "0x28c6c06298d514db089934071355e5743bf21d60",
                  "12aNKp2iDKuhEde2YfPdd4DFGenRUTKupL"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "screened": {
                      "type": "integer"
                    },
                    "list_updated": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "address, chain, risk_score, risk_level, flags, sanctions {ofac_match, sanctioned_entity}; or address and error",
                        "properties": {
                          "address": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "timestamp": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Your AWS Marketplace API key (starts with mp_). Authorization Bearer is also accepted."
      }
    },
    "schemas": {
      "AddressRequest": {
        "type": "object",
        "required": [
          "address"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "Wallet address"
          },
          "chain": {
            "type": "string",
            "description": "Optional: ethereum, base, polygon, arbitrum, bitcoin, tron, solana, litecoin, ..."
          }
        }
      },
      "Sanctions": {
        "type": "object",
        "properties": {
          "ofac_match": {
            "type": "boolean"
          },
          "sanctioned_entity": {
            "type": "string",
            "nullable": true,
            "description": "Listed party on a match"
          },
          "ofac_id": {
            "type": "string",
            "nullable": true,
            "description": "OFAC SDN entry ID"
          },
          "listed_currency": {
            "type": "string",
            "nullable": true,
            "description": "Currency code on the SDN entry, e.g. ETH, XBT"
          },
          "list": {
            "type": "string",
            "example": "OFAC SDN (U.S. Treasury)"
          },
          "list_updated": {
            "type": "string",
            "description": "Time the list was last refreshed"
          },
          "addresses_on_list": {
            "type": "integer"
          }
        }
      },
      "Balances": {
        "type": "object",
        "nullable": true,
        "properties": {
          "native": {
            "type": "object",
            "properties": {
              "symbol": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              },
              "usd": {
                "type": "number",
                "nullable": true
              }
            }
          },
          "tokens": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "Activity": {
        "type": "object",
        "nullable": true,
        "description": "Latest 100 outbound transfers",
        "properties": {
          "first_tx": {
            "type": "string",
            "nullable": true
          },
          "last_tx": {
            "type": "string",
            "nullable": true
          },
          "tx_count_30d": {
            "type": "integer"
          },
          "unique_counterparties_30d": {
            "type": "integer"
          }
        }
      },
      "ScanResult": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "chain": {
            "type": "string"
          },
          "risk_score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "risk_level": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ]
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sanctions": {
            "$ref": "#/components/schemas/Sanctions"
          },
          "balances": {
            "$ref": "#/components/schemas/Balances"
          },
          "activity_summary": {
            "$ref": "#/components/schemas/Activity"
          },
          "coverage": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "InvestigationResult": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "chain": {
            "type": "string"
          },
          "risk_score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "risk_level": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ]
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sanctions": {
            "$ref": "#/components/schemas/Sanctions"
          },
          "balances": {
            "$ref": "#/components/schemas/Balances"
          },
          "activity_summary": {
            "$ref": "#/components/schemas/Activity"
          },
          "graph_analysis": {
            "type": "object",
            "properties": {
              "mixer_hops": {
                "type": "integer"
              },
              "tornado_cash_exposure_pct": {
                "type": "number"
              },
              "known_entity_interactions": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "cluster_size": {
                "type": "integer"
              },
              "related_addresses": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "contract_interactions": {
            "type": "object",
            "properties": {
              "defi_protocols": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "nft_activity": {
                "type": "boolean"
              },
              "governance_participation": {
                "type": "boolean"
              },
              "suspicious_contracts": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "counterparty_risk": {
            "type": "object",
            "properties": {
              "high_risk_counterparties": {
                "type": "integer"
              },
              "sanctioned_counterparties": {
                "type": "integer"
              },
              "cex_withdrawal_pattern": {
                "type": "string"
              }
            }
          },
          "narrative": {
            "type": "string"
          },
          "recommendations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "timestamp": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Missing or invalid address, or a non-EVM address on /investigate",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unavailable": {
        "description": "Sanctions list or chain data unavailable; retry (not billed)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, invalid or inactive API key",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 401
                    },
                    "message": {
                      "type": "string",
                      "example": "Invalid or inactive API key"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
