cn402
Chinese metaphysics, calendar and divination data — BaZi, I Ching, Feng Shui, TCM, almanac, and more — priced and structured for autonomous agents, settled trustlessly over x402.
01 Quick start
Install (JS / TypeScript)
npm i x402-fetch viem import { wrapFetchWithPayment } from "x402-fetch";
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
const account = privateKeyToAccount("0xYOUR_KEY");
const wallet = createWalletClient({ account, chain: base, transport: http() });
const pay = wrapFetchWithPayment(fetch, wallet);
const r = await pay("https://api.cn402.com/bazi/sizhu?date=1990-06-15T08:30");
console.log(await r.json()); // 402 -> auto-sign EIP-3009 -> 200 + data Inspect from the command line
curl -i https://api.cn402.com/iching/divine
# HTTP/1.1 402 Payment Required
# the body carries the x402 payment terms (network, amount, asset)
# a paying client signs EIP-3009 and retries with the X-PAYMENT header Any x402-capable client or agent works — the protocol is plain HTTP. Python client and MCP server are on the way.
02 How it works
x402 is HTTP's native payment standard. The server returns 402 Payment Required with payment terms; the client signs an EIP-3009 authorization; the Coinbase CDP facilitator settles on Base; the request is fulfilled. End-to-end in roughly one second. No account, no key, no subscription — the agent simply pays per call.
03 Links
04 Get your API on x402
402 上线服务 · API onboarding
Have an API or data feed you want agents to pay for? We handle the full x402 integration — payment gating, pricing, on-chain settlement, manifest and directory listing — and get you live and discoverable.
把你的 API 接入 x402:我们负责支付网关、定价、链上结算、manifest 与目录收录,一条龙上线并让 agent 可发现。
business@cn402.com →