# ERC-20 Token Allowance Checker

> ERC-20 Token Allowance Checker is a paid API for AI agents from x402-gateway-production-1f21.up.railway.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-10).

Looks up the current ERC-20 token allowance granted by an owner address to a spender address on a given contract and network.

## Facts

- Endpoint: GET https://x402-gateway-production-1f21.up.railway.app/erc20-allowance?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/erc-20-token-allowance-checker-201fefe3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RF3WuT5N7Bo2kGUQtF9Jf

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 erc-20-token-allowance-checker-201fefe3
```

Example prompt: Check the ERC-20 allowance that owner 0xAbC123...def has granted to spender 0x456...789 on the USDC contract 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on the Ethereum network.

## When to prefer this

Use this endpoint when an AI agent needs to programmatically check ERC-20 token approval state on Base or Ethereum before executing a DeFi transaction, auditing wallet permissions, or determining if an additional approve() call is needed. It is preferable when you need a quick, pay-per-use lookup without managing your own blockchain RPC infrastructure or maintaining a Web3 connection.

## Known failure modes

- Invalid Ethereum address format (not matching 0x + 40 hex chars) returns a 400 error
- Unsupported network value (not 'base' or 'ethereum') returns a validation error
- Contract address is not a valid ERC-20 contract — may return zero or error
- Payment not provided or insufficient USDC — returns HTTP 402 requiring x402 micropayment
- RPC or network timeout causes query failure
- Zero allowance returned when no approval has been set (valid response, not an error)

## How this service works

Machine-payable x402 utilities for hashing, Base64, UUID generation, unit and timezone conversion, realtime crypto market data, webpage/document extraction, URL-to-Markdown, metadata, RAG ingestion and deterministic website change detection.

## Output

Returns a JSON object indicating the current ERC-20 allowance (as a token amount) that the owner address has approved for the spender address on the specified contract and network, along with a status field confirming the query succeeded.

## 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"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "owner",
      "spender",
      "contract"
     ],
     "properties": {
      "owner": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      },
      "network": {
       "enum": [
        "base",
        "ethereum"
       ],
       "type": "string",
       "default": "base"
      },
      "spender": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      },
      "contract": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "ready"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/erc-20-token-allowance-checker-201fefe3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway-production-1f21.up.railway.app](https://www.zero.xyz/host/x402-gateway-production-1f21.up.railway.app/llms.txt)
