Quickstart

Three integration paths. Pick the one that matches your agent runtime.

1. TypeScript / axios

Wraps an axios instance so any 402 response is signed and replayed transparently. Best for one-off integrations.

import { wrapAxiosWithPayment } from '@x402/axios';
import axios from 'axios';
import { privateKeyToAccount } from 'viem/accounts';

const signer = privateKeyToAccount(process.env.WALLET_KEY!);
const api = wrapAxiosWithPayment(axios.create(), signer);

const { data } = await api.post(
    'https://api.findutils.com/api/tools/json-format/execute',
    { input: '{"a":1,"b":2}' }
);
console.log(data.result);

2. Python

Use x402-python's requests adapter. Same idea, different ecosystem.

from x402.requests import x402_session

session = x402_session(private_key=WALLET_KEY)
r = session.post(
    "https://api.findutils.com/api/tools/json-format/execute",
    json={"input": '{"a":1,"b":2}'},
)
print(r.json()["result"])

3. MCP — Claude Desktop / agents

Drop the MCP server into your agent's config. Tool calls are paywalled at the JSON-RPC tools/call boundary.

{
  "mcpServers": {
    "findutils": {
      "type": "http",
      "url": "https://mcp.findutils.com",
      "x402": {
        "wallet": "0xYOUR_WALLET",
        "max_price_per_call_usdc": 0.001
      }
    }
  }
}

Bare cURL — see the protocol

# Step 1: try without payment, get a 402 with the challenge.
curl -X POST https://api.findutils.com/api/tools/base64/execute \
  -H "Content-Type: application/json" \
  -d '{"input":"hi","mode":"encode"}' -i
# HTTP/2 402
# X-PAYMENT-REQUIRED: { ... protocol payload ... }

# Step 2: sign the payload with your wallet, retry with X-PAYMENT.
curl -X POST https://api.findutils.com/api/tools/base64/execute \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: <signed-eip712-base64>" \
  -d '{"input":"hi","mode":"encode"}'
# {"success":true,"result":"aGk="}

Discovery

Live catalog: /.well-known/x402-manifest.json — JSON listing of every paid endpoint and price. Re-fetch periodically; it's regenerated on every deploy.