🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@voidly/pay

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@voidly/pay

Voidly Pay SDK — agent-to-agent payments for AI agents. Sign envelopes, settle transfers, run x402 paywalls, verify webhooks.

Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
15
-31.82%
Maintainers
1
Weekly downloads
 
Created
Source

@voidly/pay

The marketplace AI agents browse for paid HTTP services. Pay any of 17+ paid endpoints for <$0.01 using one Ed25519 keypair. List your own paid endpoint in 60 seconds. Settles in <200ms via x402 + USDC on Base mainnet.

npm version x402 vault

npm install @voidly/pay

30-second tour

import { VoidlyPay } from "@voidly/pay";

const pay = await VoidlyPay.create();              // mints + persists keypair
console.log("DID:", pay.did);                       // did:voidly:...
await pay.faucet();                                 // 10 free credits

// Browse the marketplace — 17 paid endpoints + N third-party listings
const r = await fetch("https://api.voidly.ai/v1/pay/marketplace");
const mp = await r.json();
mp.items.slice(0, 5).forEach(i =>
  console.log(`${i.name.padEnd(40)} $${i.pricing.amount_usdc}`)
);

// Pay any paid endpoint via auto-x402
const w = await pay.fetchWithPay(
  "https://api.voidly.ai/v1/pay/wiki?title=Alan%20Turing",
  undefined,
  { maxAmount: 0.005 },
);
const receipt = await w.json();
console.log(receipt.extract.slice(0, 200));

That's it. The SDK signs the envelope, the server returns a 402 with a Voidly-signed quote, the SDK transfers credits and retries — all in one round-trip.

Pay anything that returns 402

const r = await pay.fetchWithPay(
  "https://api.voidly.ai/v1/pay/extract",
  {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ url: "https://arxiv.org/pdf/2507.14183.pdf" }),
  },
  { maxAmount: 0.01 },
);
console.log((await r.json()).text_length);

List your own paid endpoint

await pay.createListing({
  name: "My Paid API",
  tagline: "Pay 1¢ for X, get Y signed.",
  url: "https://my-api.example.com/expensive",
  amount_usdc: 0.01,
  category: "data",
  tags: ["json", "agents"],
});
// Now appears at /v1/pay/marketplace, every Voidly-aware agent sees it.

Or browser-only (no install): voidly.ai/pay/list-your-service.

Run a paid endpoint (Express / Hono / any web-fetch handler)

Express:

import express from "express";
import { VoidlyPay, x402Express } from "@voidly/pay";

const app = express();
const pay = await VoidlyPay.create();

app.get("/expensive", x402Express({ pay, amount: 0.01 }), (req, res) => {
  res.json({ data: "the goods", paid_by: req.voidlyPayment.payer_did });
});
app.listen(3000);

Hono / Vercel / Cloudflare Workers:

import { Hono } from "hono";
import { VoidlyPay, x402Hono } from "@voidly/pay";

const app = new Hono();
const pay = await VoidlyPay.create();

app.get("/expensive", x402Hono({ pay, amount: 0.01 }), (c) =>
  c.json({ data: "the goods" }),
);

Any web-fetch handler:

import { withX402 } from "@voidly/pay";

export default {
  fetch: withX402({ pay, amount: 0.01 }, async (req) => {
    return new Response(JSON.stringify({ data: "the goods" }));
  }),
};

What you can do

PrimitiveUse caseMethod
MarketplaceList + browse paid servicespay.createListing(...), fetch('/v1/pay/marketplace')
Pay any URLAuto-x402 clientpay.fetchWithPay(url, init, { maxAmount })
Direct transferOne-shot paymentpay.transfer({ to, amount })
BatchPay many atomicallypay.batchTransfer([...])
EscrowConditional holdpay.openEscrow({ to, amount, deadlineHours })
StreamPer-token / per-second meteringpay.openStream({ provider, budget })
SubscriptionRecurring chargepay.subscribe({ provider, amountPerPeriod, periodSeconds })
x402 quoteServer-side paywallpay.createQuote({ resource, amount })
x402 verifyServer-side verifypay.verifyPayment({ payment_header })
WebhooksPush notificationspay.subscribeWebhook({ url, events })
Trust checkPre-flight 6-check reportpay.healthCheck() (incl. on-chain vault read)

What's in the marketplace today (Voidly's 17 paid endpoints)

EndpointPriceWhat it does
voidly_hash$0.001SHA-256/512 + signed receipt
voidly_timestamp$0.001Proof-of-existence (OpenTimestamps-style, <200ms)
voidly_random$0.001Signed CSPRNG bytes
voidly_qr$0.001QR-code PNG of any text/URL
voidly_wiki$0.001Wikipedia summary + signed citation
voidly_exchange$0.001Fiat/crypto exchange rates
voidly_markdown$0.001HTML → clean markdown (10x reduction)
voidly_meta$0.001URL metadata (og + title + canonical)
voidly_extract$0.01PDF/document → plain text
voidly_scrape$0.01Fetch any URL + Voidly-signed receipt
voidly_fetch$0.05Country-pinned fetch via 37+ probe network
probe_attest$0.005Multi-vantage signed reachability proof
Plus 5 research SKUs (forecast, claim-verify, incident-summary, agent-discover, incidents-export)

Live machine-readable catalog: api.voidly.ai/v1/pay/marketplace.

Webhook signature verification

import { verifyWebhookSignature } from "@voidly/pay";

app.post("/voidly-webhook", async (req, res) => {
  const ok = await verifyWebhookSignature({
    body: req.rawBody,
    signatureHeader: req.headers["x-voidly-signature"],
    secret: process.env.VOIDLY_WEBHOOK_SECRET!,
  });
  if (!ok) return res.status(401).end();
});

Configuration

const pay = await VoidlyPay.create({
  apiUrl: "https://api.voidly.ai",     // override for self-hosted
  secretKey: existingKey,               // bring your own Ed25519 key
  defaultExpiryMinutes: 30,
});

Keys auto-persist to:

  • Browser: localStorage["voidly-pay-keypair-v1"]
  • Node: ~/.voidly-pay/keypair.json (mode 0600)
  • Or pass a custom KeyStorage implementation

Why agents use this

ProblemVoidly Pay solves it
Need to add payment to your agent servicex402 middleware ships for Express, Hono, FastAPI, Flask, any web-fetch handler
Need to discover paid servicesOne install → 17 endpoints + open self-serve marketplace
Don't want to manage 10 API keysOne Ed25519 keypair, one wallet, every paid endpoint works
Don't trust the agent's payment claimsEvery receipt is Ed25519-signed by Voidly. Verifiable offline.
Need country-attested fetch37+ probe network, signed (URL, country, ASN, probe-DID)

Honest disclosure

The Voidly Pay vault on Base mainnet (0xb592512932a7b354969bb48039c2dc7ad6ad1c12, Sourcify-verified) currently holds $4 USDC. We have approximately zero sustained external paying users yet. Live reserves at voidly.ai/pay/proof.

We opened the marketplace before the demand exists because we believe agent adoption is gated on discoverability, not on payment-rail UX.

Framework adapters

  • MCP (Claude Desktop, Cursor, Windsurf, Cline, Continue, Zed, Goose): npx @voidly/pay-mcp — 42 tools
  • Vercel AI SDK: npm install @voidly/pay-vercel-ai
  • CLI (shell, cron, CI): npm install -g @voidly/pay-cli

Keywords

x402 · agent payments · typescript sdk · usdc · base mainnet · signed receipts · agent marketplace · pay per call · micropayments · express x402 · hono x402 · vercel ai sdk · cloudflare workers · langchain agent payments · crewai payments · llamaindex tools · pydantic-ai tools · autogen extensions · claude code · cursor · windsurf

License

MIT

Keywords

voidly

FAQs

Package last updated on 02 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts