82trust / 100
Token Allowance
by ERC-20 allowance (owner to in Onchain & crypto
x402 APIPassing, checked 4 h ago
How much of an ERC-20 token a spender contract is approved to move from an owner wallet - the approval check an agent runs before a swap, a bridge, or an x402 transferWithAuthorization flow. Returns the allowance as an exact decimal string scaled by the token's decimals, the raw uint256, and an `unlimited` flag for max-uint style approvals.
POST https://agent402.tools/api/token-allowance
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 195 ms typical, 195 ms slowest 5%
- Last check
- 4 h ago
- Next check
- any minute now
How to call it
# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/api/token-allowance" \
-H "content-type: application/json" \
-d '{"contract":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","network":"ethereum","owner":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","spender":"0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD"}'import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fapi%2Ftoken-allowance
const res = await pay("https://agent402.tools/api/token-allowance", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"contract":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","network":"ethereum","owner":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","spender":"0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD"}),
});
console.log(await res.json());Example input
{
"contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"network": "ethereum",
"owner": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"spender": "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD"
}Example output
{
"allowance": "0",
"chainId": 1,
"contract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"decimals": 6,
"fetchedAt": "2026-08-22T12:00:00.000Z",
"network": "ethereum",
"owner": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"raw": "0",
"source": "alchemy",
"spender": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad",
"symbol": "USDC",
"unlimited": false
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 4 h ago | Passed | 402 | 195 ms | $0.002 |