WachAI x402

Give your AI Agent the power to find, verify and buy tokens on Base.

How can you use WachAI x402?

Three simple endpoints. Everything an agent needs to find, verify, and buy tokens safely on Base.

Resolve Tokens

Find the right contract address for any token ticker on Base.

Response
{
  "tokenAddress": "0x4ed4e862860bed51a9570b96d89af5e1b0efefed",
  "tokenSymbol": "DEGEN",
  "tokenName": "Degen",
  "tokenChainId": 8453,
  "tokenIsVerified": true
}

Verify Tokens

Check if a token is safe - honeypot detection, liquidity, and risk scoring.

Response
{
  "isHoneypot": false,
  "hasLiquidity": true,
  "codeVerified": true,
  "riskScore": 15,
  "marketRisks": []
}

Buy Tokens

Execute a token swap on Base and receive tokens directly in your wallet.

Response
{
  "success": true,
  "swapTxHash": "0x...",
  "transferTxHash": "0x...",
  "tokenOutAmount": "1523.45"
}

x402 Payment Protocol

API Examples

These are x402-protected endpoints. When you make a request, the server responds with a 402 Payment Required status and payment instructions. Use the @x402/fetch package to handle payments automatically:

import { x402Client, wrapFetchWithPayment } from "@x402/fetch";

const client = new x402Client();
const fetchWithPayment = wrapFetchWithPayment(fetch, client);

// Now use fetchWithPayment instead of fetch
const response = await fetchWithPayment("https://x402.wach.ai/resolveToken?ticker=DEGEN");
Base URL: https://x402.wach.ai

Resolve Token

GET /resolveToken
Request
curl "https://x402.wach.ai/resolveToken?ticker=wach"
Response
{
  "success": true,
  "tokenAddress": "0xcc9ad02796dec5f4f0710df80c1f011af85eb9e1",
  "tokenSymbol": "WACH",
  "tokenName": "Wach",
  "tokenChainId": 8453,
  "tokenIsVerified": true
}

Verify Token

GET /verify-token
Request
curl "https://x402.wach.ai/verify-token?tokenAddress=0xcc9ad02796dec5f4f0710df80c1f011af85eb9e1&chainId=base"
Response
{
  "tokenAddress": "0xcc9ad02796dec5f4f0710df80c1f011af85eb9e1",
  "chain": "base",
  "data": {
    "isHoneypot": false,
    "hasLiquidity": true,
    "codeVerified": true,
    "riskScore": 12
  }
}

Buy Token

POST /buyToken
Request
curl -X POST "https://x402.wach.ai/buyToken" \
  -H "Content-Type: application/json" \
  -d '{"buyTokenAddress": "0xcc9ad02796dec5f4f0710df80c1f011af85eb9e1", "walletAddress": "0xYourWalletAddress"}'
Response
{
  "success": true,
  "swapTxHash": "0x...",
  "transferTxHash": "0x...",
  "tokenOutAmount": "1523.45"
}

Start Building with WachAI x402

Check out our open source implementation and start integrating x402 endpoints into your agent workflows.

View on GitHub