Developers

Ten lines to accept any coin.

A dependency-free TypeScript SDK and a REST API. Test with a sandbox account (secret key sk_test_…), then switch to live keys: nothing else changes.

1. Create a checkout session (server)

Your secret key stays on your server. Amounts are in dollars; the customer pays in any coin and you receive exactly this amount.

import { Cascade } from "@cascade/sdk/server";
const cascade = new Cascade({ apiKey: process.env.CASCADE_SECRET_KEY!, baseUrl: "https://<your-cascade-host>" });

const session = await cascade.checkout.create(
  { amount: "25.00", description: "Stoneware mug", reference: order.id },
  { idempotencyKey: order.id },
);
2. Open the checkout (browser)

A modal on your page, or redirect to session.url. Wallet payments, QR codes and deposit addresses are handled for you.

import { openCheckout } from "@cascade/sdk/browser";
openCheckout({ sessionUrl: session.url, onPaid: () => showThanks() });
3. Fulfil from the signed webhook

Trust the webhook, never the browser. Every event is HMAC-signed with a timestamp.

import { verifyWebhook } from "@cascade/sdk/webhooks";
const event = await verifyWebhook(rawBody, req.headers["cascade-signature"], process.env.CASCADE_WEBHOOK_SECRET!);
if (event.type === "checkout.session.completed") ship(event.data.session.reference);
Invoices, subscriptions, payouts

Hosted invoices with line items, plans billed every period, prepaid periods, customers.

const inv = await cascade.invoices.create({ customer: { name: "Fieldwork Café" }, items: [{ description: "Mug", quantity: 24, unitAmount: "18.00" }] });
const plan = await cascade.plans.create({ name: "Mug of the month", amount: "12.00", interval: "month" });
await cascade.subscriptions.create({ planId: plan.id, customer: { name: "Ines" }, prepaidPeriods: 3 });
Charge AI agents per request (x402)

Unpaid requests get HTTP 402 with payment options; agents pay in any coin, or from an on-chain budget on NEAR.

import { x402Guard } from "@cascade/sdk/x402";
const guard = x402Guard(cascade, { price: "0.10", description: "One forecast" });
export async function GET(req: Request) {
  const g = await guard(req);
  return g.paid ? Response.json(forecast(), { headers: g.headers }) : g.response;
}
AI assistants (MCP)

Run your account from Claude, Cursor or any MCP client, and let agents pay x402 APIs from a budget with limits the contract enforces.

claude mcp add cascade --env CASCADE_URL=https://<your-cascade-host> \
  --env CASCADE_SECRET_KEY=rk_live_… -- npx tsx packages/mcp/src/main.ts
API reference

Authenticate with Authorization: Bearer sk_…. Read-only keys can call every GET. Idempotency: send Idempotency-Key on creates.

POST/v1/checkout/sessionsCreate a session (amount in USDC base units)
GET/v1/checkout/sessions/:idRetrieve a session
POST/v1/checkout/sessions/:id/refundsRefund in the customer's coin and chain
POST/v1/invoicesCreate a hosted invoice
POST/v1/plans · /v1/subscriptionsRecurring billing
GET/v1/customersCustomers with lifetime totals
POST/v1/x402/prepare · /v1/x402/settleAgent payments (used by x402Guard)
GET/v1/merchant/payouts · escrows · agentsMoney out, read from the chain
POST/v1/merchant/keysRead-only keys (rk_) for your team
POST/v1/merchant/payoutSettlement chain (needs your NEAR signature)
GET/v1/reports/ledger.csvAccounting export
Sandbox and live
SandboxLive
NetworkNEAR testnetNEAR mainnet
Customer paymentsSimulated swap, real contracts and receiptsReal, through NEAR Intents (1Click)
Keyssk_test_ / rk_test_sk_live_ / rk_live_
AccessInstant, at /startAfter a short review