# Contract Risk API — Smart Contract & Token Safety Scanner

> Contract Risk API — Smart Contract & Token Safety Scanner is a paid API for AI agents from smartcontractrisk.0xhodhod.xyz, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-20).

Performs pre-trade safety checks on a given EVM smart contract or token address, returning a risk level and numeric risk score.

## Facts

- Endpoint: POST https://smartcontractrisk.0xhodhod.xyz/v1/scan?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/contract-risk-api-smart-contract-token-safety-scanner-aeff4861
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IOFD1fLErFGl2mOVrgWTE

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability contract-risk-api-smart-contract-token-safety-scanner-aeff4861 -d '<json body>'
```

Example prompt: Can you scan the contract at 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 on Base and tell me if it's safe to trade — what's the risk level and score?

## When to prefer this

Choose this endpoint when an AI agent needs a fast, cheap ($0.02), automated pre-trade safety signal for an EVM contract on Base or Ethereum — especially in DeFi automation, portfolio bots, or any workflow where interacting with an unverified contract is a risk. It is ideal for gating trades or alerting users before on-chain actions.

## Known failure modes

- Invalid or non-checksummed contract address returns a 4xx error
- Unsupported chain value (not 'base' or 'ethereum') causes a validation error
- Contract address not found on the specified chain may return an unknown risk result
- Payment failure or insufficient USDC balance on Base triggers a 402 response
- Network timeout or upstream blockchain node unavailability causes a 5xx error

## How this service works

Pre-trade safety checks for smart contracts and tokens. All paid routes use the x402 'exact' scheme settling in USDC on Base (eip155:8453). Every 402 carries a signed offer and every 200 a signed receipt (EIP-712) — see /.well-known/x402 -> signing.

## Output

Returns a JSON object with the queried chain, contract address, a categorical risk level (e.g. 'low', 'medium', 'high'), and a numeric risk score — enabling agents to programmatically gate or warn before executing trades or interactions with the contract.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "enum": [
    "base",
    "ethereum"
   ],
   "type": "string",
   "description": "Chain to query (default: base)"
  },
  "address": {
   "type": "string",
   "description": "0x-prefixed EVM contract address to scan"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chain": "base",
  "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "riskLevel": "low",
  "riskScore": 0
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/contract-risk-api-smart-contract-token-safety-scanner-aeff4861/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from smartcontractrisk.0xhodhod.xyz](https://www.zero.xyz/host/smartcontractrisk.0xhodhod.xyz/llms.txt)
