Vybevybe

Collect · buildathon

Hackathon path — get paid in one evening

Built for hands-on nights like ProductTank Build-a-thons. Goal: publish a Collect offering, gate a route with HTTP 402, take a paid call. Prefer www.vybe.finance for every URL.

0 · Before you code

  • Laptop + GitHub account
  • Cursor / Claude Code / VS Code — install Collect skill if you use an agent:
Terminal
npx skills add Vybe-Finance/vybe-collect -g -y

If /app opens “Create your first spend key” and you only need Collect tonight: click Skip for now (or switch to Business in the sidebar). You can finish agent spend keys later.

1 · Seller setup (~10 min)

  1. Sign up → verify email → claim @username
  2. Open Business → Products, add an offering (price locked), publish your service page
  3. Enable Accept payments from AI agents (Vybe Collect)
  4. Confirm catalog: GET https://www.vybe.finance/api/agent/collect/YOUR_USERNAME
  5. Optional API key: Business → Developers → issue vybe_col_… (webhooks / offerings API)

Human page: /s/@you · Agent docs: /a/@you

2 · Gate your API (Track A)

Fastest code path for the room: npm i express-vybe-402 on a tiny Express app.

Terminal
# Clone / paste into a new folder
npm install express express-vybe-402

export VYBE_ORIGIN=https://www.vybe.finance
export VYBE_USERNAME=YOUR_USERNAME
export VYBE_OFFERING_ID=svc_YOUR_OFFERING
export PORT=4050

node node_modules/express-vybe-402/example.js
# → GET http://localhost:4050/v1/report  (expect 402 until paid)

Point VYBE_USERNAME / VYBE_OFFERING_ID at your catalog (ids look like svc_…).

server.js
const { requireVybePayment } = require("express-vybe-402");

app.get(
  "/v1/report",
  requireVybePayment({
    username: process.env.VYBE_USERNAME,
    offeringId: process.env.VYBE_OFFERING_ID,
    origin: "https://www.vybe.finance",
  }),
  (req, res) => res.json({ ok: true, payment: req.vybePayment }),
);

3 · Pay + unlock

Unpaid → HTTP 402 + payment details. Settle, then retry with X-Vybe-Public-Id.

curl
# 1) Create intent against a catalog offering
curl -sS -D - -X POST \
  "https://www.vybe.finance/api/agent/collect/YOUR_USERNAME/svc_YOUR_OFFERING" \
  -H "Accept: application/json"

# Note X-Vybe-Public-Id and PAYMENT-REQUIRED from the 402 response.

# 2) After settle (human /r/{publicId} or agent x402 / txHash), retry your API:
curl -sS http://localhost:4050/v1/report \
  -H "X-Vybe-Public-Id: pr_…"

# 3) Confirm seller catalog is public
curl -sS "https://www.vybe.finance/api/agent/collect/YOUR_USERNAME" | head

Optional webhook for fulfillment:

webhook.js
// Minimal payment.paid handler (verify signature in production)
app.post("/webhooks/vybe", express.raw({ type: "application/json" }), (req, res) => {
  const event = JSON.parse(req.body.toString());
  if (event.type === "payment.paid") {
    // credit quota / unlock content — idempotent on event.id or publicId
  }
  res.status(200).json({ ok: true });
});
// Configure URL + secret: Business desk → Developers → Webhooks
// Header: X-Vybe-Signature: sha256=…

Success criteria for judges: catalog JSON live, 402 on unpaid call, 200 after pay, credit visible on seller balance / webhook.

Demo catalog (read-only)

Explore a live Collect seller while you finish setup — replace with your @username for the build.

Set NEXT_PUBLIC_COLLECT_DEMO_USERNAME in deploy if you want a different public demo handle.

Stuck? Top failures

SymptomFix
Catalog 404 / emptyPublish page + enable Collect + at least one active offering
402 forever after payRetry with header X-Vybe-Public-Id: pr_… from the intent
401 on Business APIUse Authorization: Bearer vybe_col_… (server only — never NEXT_PUBLIC_)
TLS / fetch errors to apexUse https://www.vybe.finance — not bare https://vybe.finance
Wallet / spend-key screenSkip for Collect; open Business → Products / Developers

More depth: Integration guide · OpenAPI · support@vybe.finance