# Safe Approve Builder

> Safe Approve Builder is a paid API for AI agents from 402.com.tr, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-27).

Builds precise ERC-20 approve calldata for exactly the required token amount, handling USDT-style revoke-first logic and refusing unlimited allowances by default

## Facts

- Endpoint: GET https://402.com.tr/api/x402/safe-approve?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-27
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/safe-approve-builder-95723a2d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Y1B7TnAOU6NqfEtNxBfoH

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 safe-approve-builder-95723a2d
```

Example prompt: Build me safe approve calldata to let the Uniswap v3 router (0xE592427A0AEce92De3Edee1F18E0157C05861564) spend exactly 500 USDC (token: 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48) from my wallet 0xYourWallet — don't use unlimited approval, and check if there's an existing allowance that needs to be revoked first.

## When to prefer this

Choose this endpoint when an agent needs to build ERC-20 approve transactions safely — especially when interacting with USDT-style tokens that revert on non-zero-to-non-zero approvals, or when you want to enforce minimal allowances instead of unlimited approves. It is better than constructing raw approve calldata manually because it reads live allowances, handles the revoke-first pattern automatically, and scales amounts to token decimals. Prefer this over generic transaction builders when approval safety and USDT compatibility are priorities.

## Known failure modes

- Missing required query params (token, spender, amount) returns a 400 error
- Invalid or non-checksummed contract addresses cause resolution failure
- Token contract does not expose standard decimals() — calldata cannot be scaled correctly
- amount='max' rejected unless allowUnlimited=1 is passed
- On-chain read of live allowance fails if the RPC endpoint is unavailable
- Non-ERC-20 token address returns an error or empty response

## How this service works

Unlimited allowances are the #1 drain vector, and agents reach for approve(max) on every swap. This builds ready-to-sign calldata for an approval of EXACTLY the amount you need (via the token's decimals) and refuses unlimited unless forced. Reads the live allowance and returns a revoke step first when one is already set (a non-zero→non-zero approve reverts on USDT-style tokens). Build-time prevention, not detection; we never hold keys. Not financial advice.

## Output

Returns ready-to-sign calldata for an ERC-20 approve transaction scoped to the exact requested amount (converted using live token decimals). If the wallet already has a non-zero allowance set (e.g. USDT-style tokens that revert on non-zero→non-zero), a revoke step is returned first. Unlimited allowances are refused unless the allowUnlimited flag is explicitly set.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "token",
      "spender",
      "amount"
     ],
     "properties": {
      "owner": {
       "type": "string",
       "description": "Your wallet (optional, reads live allowance)"
      },
      "token": {
       "type": "string",
       "description": "Token contract"
      },
      "amount": {
       "type": "string",
       "description": "Exact amount to approve (or 'max')"
      },
      "spender": {
       "type": "string",
       "description": "Spender (router/contract)"
      },
      "allowUnlimited": {
       "type": "string",
       "description": "Allow unlimited (1 = yes, not recommended)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/safe-approve-builder-95723a2d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402.com.tr](https://www.zero.xyz/host/402.com.tr/llms.txt)
