mercury-x402-sdk
v1.0.0
Published
Mercury SDK + CLI — call the agent-payable web-data network with a wallet OR an API key. 28 keyless, signed-provenance services over x402 on Base mainnet (USDC).
Maintainers
Readme
mercury-x402-sdk
The Mercury client + CLI for the agent-payable web-data network — 28 keyless, signed-provenance services over x402 on Base mainnet (USDC). Dual-rail: call with a wallet or an API key.
npm i mercury-x402-sdkSDK
import { Mercury } from "mercury-x402-sdk";
// API key — no wallet, no crypto (get one free at /developers):
const m = new Mercury({ apiKey: "mk_test_…" });
// …or a wallet — keyless, pays per call from your own funds:
const m = new Mercury({ privateKey: "0x…" });
const r = await m.fetch("https://example.com"); // → { text, title, status, attestation }
console.log(r.text);
await m.verify(r); // verify the signed receipt offline (free)
// any SKU:
await m.markdown("https://example.com");
await m.extract("https://example.com", { title: "string", price: "number" });
await m.buy("sitemap", { url: "https://example.com" });
await m.catalog(); // every service + price (free, no rail)CLI
npx mercury catalog
export MERCURY_API_KEY=mk_test_… # or MERCURY_PRIVATE_KEY=0x…
npx mercury fetch https://example.com
npx mercury markdown https://example.com
npx mercury buy sitemap --url=https://example.comRails
| You bring | Rail | Notes |
|---|---|---|
| apiKey: "mk_…" | API key | the fiat on-ramp — no wallet. Free sandbox keys at /developers. |
| privateKey: "0x…" | x402 wallet | keyless, pays per call on Base mainnet. |
| nothing | keyless | free routes only (catalog, verify). |
Every paid result ships an EIP-191 signed provenance receipt (attestation) you can verify offline.
- npm:
mercury-x402-sdk· MCP:mercury-x402-mcp· docs:mercury-x402-jed.fly.dev/llms.txt
