# Token Allowance & Balance Pre-flight Check

> Token Allowance & Balance Pre-flight Check is a paid API for AI agents from api.eucompliance.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Returns ERC-20 token allowance, balance, decimals, and symbol in one call, with an optional would_succeed verdict for a proposed transfer amount on Base, Ethereum, Arbitrum, Optimism, or Polygon.

## Facts

- Endpoint: GET https://api.eucompliance.tools/x402/token
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/token-allowance-balance-pre-flight-check-8f0ad1cf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eZVH15hjVlxmVXE6sULNz

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 token-allowance-balance-pre-flight-check-8f0ad1cf
```

Example prompt: Before I try to swap 500 USDC on Base, check if my wallet 0xABC...123 has enough balance and has approved 0xDEF...456 as the spender — tell me if the transaction would succeed and what's blocking it if not.

## When to prefer this

Choose this endpoint when you need to verify ERC-20 token state before executing a swap, transfer, or DeFi interaction and want to avoid wasting gas on a predictably failing transaction. It consolidates balance, allowance, decimals, and symbol into a single read call and adds an actionable verdict, making it ideal for any agent or bot that needs to pre-validate token conditions on Base, Ethereum, Arbitrum, Optimism, or Polygon before submitting a transaction.

## Known failure modes

- Invalid or non-ERC-20 contract address returns an error or zero values
- Unsupported chain value returns a validation error
- Owner or spender address malformed returns a parameter error
- Network RPC timeout causes a delayed or failed response
- Amount specified without spender omits the would_succeed verdict

## How this service works

Pre-flight check before a swap or transfer: ERC-20 allowance, balance, decimals and symbol in one call, read live from the chain at the latest block. Pass an amount and get a straight would_succeed verdict with the blocking reason and the action needed. Base, Ethereum, Arbitrum, Optimism, Polygon. A missing approval burns the gas of a failed transaction - this call costs a fraction of that.

## Output

Returns the token's balance, allowance, decimals, and symbol read live from the chain at the latest block. If an amount and spender are provided, also returns a boolean would_succeed verdict, the specific blocking reason (e.g. insufficient balance or missing approval), and the action required to fix it (e.g. approve spender or acquire more tokens).

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "token",
      "owner"
     ],
     "properties": {
      "chain": {
       "enum": [
        "base",
        "ethereum",
        "arbitrum",
        "optimism",
        "polygon"
       ],
       "type": "string"
      },
      "owner": {
       "type": "string",
       "description": "wallet holding the tokens"
      },
      "token": {
       "type": "string",
       "description": "ERC-20 contract address"
      },
      "amount": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "number"
        }
       ],
       "description": "Exact decimal string preferred; JSON number remains accepted for backwards compatibility. Optional; returns a would_succeed verdict."
      },
      "spender": {
       "type": "string",
       "description": "contract that would spend them, optional"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/token-allowance-balance-pre-flight-check-8f0ad1cf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.eucompliance.tools](https://www.zero.xyz/host/api.eucompliance.tools/llms.txt)
