Getting Started

Get Soldi running on your site in under 10 minutes.

Prerequisites

  • Node.js 20+
  • A deployed website (Next.js, Express, or Hono)

Step 1: Sign up

Create your account at dashboard.soldi.dev. You'll get an API key during onboarding.

Step 2: Install

npm install @soldidev/middleware

Step 3: Add middleware

For Next.js, create middleware.ts in your project root:

import { createSoldi } from "@soldidev/middleware/next";

export const middleware = createSoldi({
  apiKey: process.env.SOLDI_API_KEY!,
  defaultPrice: 0.005,
});

export const config = {
  matcher: ["/blog/:path*", "/premium/:path*"],
};

Step 4: Set your API key

SOLDI_API_KEY=sk_live_your_key_here

Step 5: Deploy and test

Deploy your site, then go to your dashboard and click "Send test agent request" in Settings. If you see a 402 response, Soldi is working.

How it works

  1. An AI agent requests a page on your site
  2. Soldi detects it's an agent (not a human)
  3. Returns a 402 Payment Required response with payment options
  4. Agent pays via x402 (USDC) or Stripe (card)
  5. Content is served. You earn money.
  6. Human visitors see your normal site — no paywall, no changes.