ERC-8004 Inspector via x402 Wire v2: A Technical Tutorial
Call ContextIQ's ERC-8004 Inspector via x402 wire v2 for on-chain agent identity and reputation lookups on Ethereum, Base, Arbitrum, Polygon, and more.
ERC-8004 Inspector looks up an agent's on-chain identity and reputation directly from the ERC-8004 Identity and Reputation registries — no indexer, no third-party API, just a public RPC read against the real contracts. This is a tutorial for its x402 wire v2 endpoint.
The Endpoint
POST /api/v1/erc8004-inspector/x402-v2
Price: $0.02 per call
Body: { "agentId": "<ERC-8004 agent ID>", "network": "<ethereum|base|base-sepolia|arbitrum|polygon|avalanche|bnb>" }
The 402 Challenge
curl -i -X POST https://contextiq.trango-compute.com/api/v1/erc8004-inspector/x402-v2 \
-H "Content-Type: application/json" \
-d '{"agentId":"1","network":"ethereum"}'
{
"x402Version": 2,
"resource": { "url": "https://contextiq.trango-compute.com/api/v1/erc8004-inspector/x402-v2" },
"accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "20000", "payTo": "0x4eba5ea3cf0f3fc307099317e17e54390f7a4c58", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }],
"extensions": {
"bazaar": {
"info": {
"input": {
"type": "http", "method": "POST",
"schema": { "properties": { "agentId": { "type": "string" }, "network": { "type": "string" } }, "required": ["agentId", "network"] }
}
}
}
}
}
Note the payment network in accepts[] (eip155:8453, Base — where ContextIQ gets paid) is independent of the network field in your request body (the chain the agent you're looking up is registered on). Those are two unrelated networks and commonly differ — you can pay on Base to look up an agent registered on Ethereum.
Option A: API Key
curl -X POST https://contextiq.trango-compute.com/api/v1/erc8004-inspector/x402-v2 \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"agentId":"1","network":"ethereum"}'
Option B: Pay With x402, No API Key
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
import { wrapFetchWithPayment } from "@x402/fetch";
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const client = createWalletClient({ account, transport: http(), chain: base });
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const res = await fetchWithPayment("https://contextiq.trango-compute.com/api/v1/erc8004-inspector/x402-v2", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ agentId: "1", network: "ethereum" }),
});
console.log(await res.json());
The Response
Real output — agent #1, looked up on Ethereum mainnet, right now:
{
"agentId": "1",
"network": "ethereum",
"networkLabel": "Ethereum",
"status": "found",
"identity": {
"owner": "0x9ce7082814bda389f3ba548bdf2626006279569c",
"agentWallet": "0x9ce7082814bda389f3ba548bdf2626006279569c"
},
"reputation": {
"clientCount": 2,
"clients": ["0xf17b5dd382b048ff4c05c1c9e4e24cfc5c6adad9", "0x130e90223aa47b1a046cbb1f6f27ea98e139ee30"],
"summary": { "count": 6, "value": "51", "valueDecimals": 0 }
},
"warnings": ["tokenURI is empty — no agent metadata published"]
}
status is found, not_found, or error. reputation.clientCount is the number of distinct addresses that have left feedback — deliberately not the same as summary.count (total feedback entries), since a handful of addresses leaving repeated feedback is a weaker signal than genuine breadth. We don't score or interpret summary.value beyond exposing it raw: ERC-8004 doesn't standardize a value scale or decimal convention across implementations, so comparing one agent's raw feedback number to another's would be fabricated precision, not a real signal. warnings surfaces things like a missing tokenURI (no metadata published) without treating it as disqualifying — the field isn't mandated by the spec.
Try It
ERC-8004 Inspector is free from the dashboard for one-off lookups, or callable via the API above for verifying a counterparty's on-chain identity before you decide anything else about them.
Follow Trango Compute on LinkedIn
We post updates on new tools, context engineering patterns, and LLM cost research.