# SafeRoute Trade Guard

> SafeRoute Trade Guard is a paid API for AI agents from api.usesaferoute.com, paid per call via x402, $0.12/call, status unknown (last checked 2026-11-20).

Executes a protected Base DEX token swap with diagnostics and payment protection for a specified wallet and token pair

## Facts

- Endpoint: POST https://api.usesaferoute.com/v1/trade-guard?utm_source=zero.xyz
- Price: $0.12/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/saferoute-trade-guard-2b9523ad
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jdXoW1qBo3CYpycYerc3T

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 saferoute-trade-guard-2b9523ad -d '<json body>'
```

Example prompt: Use SafeRoute Trade Guard to swap 100 USDC to WETH for my wallet 0xAbCd1234...5678 — I want standard execution mode and here's my intentId: swap_abc123def456xyz.

## When to prefer this

Choose this endpoint when an AI agent needs to execute a real Base DEX token swap with built-in payment protection and x402 diagnostics, particularly when swap integrity, guarded execution, and per-trade auditability matter. Prefer it over raw DEX calls when you need structured intent tracking via intentId and agent-level attribution via sourceAgentId.

## Known failure modes

- Invalid wallet address format (must be 0x + 40 hex chars)
- intentId too short or too long (must be 16–128 alphanumeric chars)
- Unsupported token pair in from/to enum
- Amount not matching numeric pattern
- Payment of 0.12 USDC not fulfilled via x402 protocol
- referralCode outside allowed length or character set
- sourceAgentId missing or blank when required

## How this service works

Workflow automation, Stripe and API integration repair, and x402 payment diagnostics. Choose a fixed scope and review it before payment.

## Output

Returns a JSON object with a status field (e.g. 'ok') and a service identifier ('safe_trade_guard'), confirming whether the guarded swap was accepted and processed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "enum": [
    "USDC",
    "WETH",
    "EURC",
    "CBETH",
    "CBBTC",
    "VIRTUAL",
    "AERO"
   ],
   "type": "string"
  },
  "from": {
   "enum": [
    "USDC",
    "WETH",
    "EURC",
    "CBETH",
    "CBBTC",
    "VIRTUAL",
    "AERO"
   ],
   "type": "string"
  },
  "amount": {
   "type": "string",
   "pattern": "^\\d+(?:\\.\\d+)?$"
  },
  "wallet": {
   "type": "string",
   "pattern": "^0x[a-fA-F0-9]{40}$"
  },
  "intentId": {
   "type": "string",
   "pattern": "^[a-zA-Z0-9_-]+$",
   "maxLength": 128,
   "minLength": 16
  },
  "referralCode": {
   "type": "string",
   "pattern": "^[a-zA-Z0-9_-]+$",
   "maxLength": 64,
   "minLength": 3
  },
  "executionMode": {
   "type": "string",
   "const": "standard",
   "default": "standard"
  },
  "sourceAgentId": {
   "type": "string",
   "maxLength": 128,
   "minLength": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "ok",
  "service": "safe_trade_guard"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/saferoute-trade-guard-2b9523ad/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.usesaferoute.com](https://www.zero.xyz/host/api.usesaferoute.com/llms.txt)
