Everything you need to buy from NOKEY with your own agent, or sell to it.
Every NOKEY seller is a standard x402 endpoint. Use the official paying fetch and a funded Base Sepolia wallet:
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig, decodePaymentResponseHeader } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:84532", client: new ExactEvmScheme(account) }],
spendControls: { maxAmountPerPayment: "$0.05" }, // never pay more than this per call
});
const res = await pay("https://<your-nokey-host>/api/sellers/weather", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ city: "Goa" }),
});
console.log(await res.json());
console.log(decodePaymentResponseHeader(res.headers.get("PAYMENT-RESPONSE")!)); // { transaction: "0x…" }Need test funds? USDC: faucet.circle.com (Base Sepolia) · ETH: Coinbase CDP faucet.
@x402/next or @x402/express middleware to your route. The List page generates the snippet with your wallet and price filled in.| POST | /api/sellers/weather | { city } → current weather + 7-day forecast |
| POST | /api/sellers/crypto-price | { symbol } → USD price, 24h change, market cap, volume |
| POST | /api/sellers/wallet-scan | { address | name.eth } → Base + Ethereum balances, tx count, type |
| POST | /api/sellers/news | { topic } → latest headlines (Google News, CoinDesk) |
| POST | /api/sellers/web-search | { query } → DuckDuckGo + Wikipedia results |
| POST | /api/sellers/image-gen | { prompt } → image URL |
| POST | /api/proxy/{slug} | Community APIs, fronted by NOKEY's x402 gateway |
| POST | /api/agent | { question, budgetUsd?, maxPerCallUsd? } → text/event-stream of agent steps |
| GET | /api/market | All listed sellers with price and earnings |
| GET | /api/stats | Agent wallet, spend totals and recent receipts |
All /api/sellers/* and /api/proxy/* routes answer 402 until paid.
No. That's the point. Payment is the authentication: every call carries a signed USDC authorization for its exact price.
Base Sepolia (eip155:84532) with Circle's test USDC, settled through the public x402 facilitator. Moving to Base mainnet is a network-id change.
The facilitator submits the USDC transfer. The paying agent only signs, so it needs USDC but no ETH.
Payment settles only after a successful response. A seller that errors doesn't get paid and the buyer keeps the USDC.
If the agent wallet has no testnet USDC, the app runs the same handshake without touching a chain. Those receipts have sim- ids, a 'simulated' tag, and no explorer link. With USDC in the wallet every receipt is settled on-chain and links to Basescan.
Public keyless x402 facilitators, tried in order: PayAI, then openx402, then x402.org. If one can't settle (for example its gas wallet is empty) the next one is tried. It never silently falls back to simulated payments.
With no keys, a free keyless LLM (gpt-oss-20b via Pollinations) plans the paid calls and writes the answer. The free tier allows one reply every 45s per server, so answers can take a little under a minute; if the LLM is busy or down, a rule-based planner takes over and the UI says so. Set ANTHROPIC_API_KEY and the agent switches to Claude automatically, same tools and budget. The header always shows the model actually running.