Skip to main content
Prism acts as the x402 facilitator — it adds payment enforcement to your HTTP endpoints without you implementing the protocol directly. You configure prices; Prism handles the 402 response, payment verification, and on-chain settlement.

How It Works

The Prism SDK installs a middleware layer on your server:
  1. A request arrives without a valid payment header
  2. Middleware returns 402 Payment Required with x402Version, accepts, and resource fields
  3. The agent’s wallet pays on-chain and retries with an X-PAYMENT header
  4. Prism’s Spectrum layer verifies the on-chain transfer
  5. If valid, the request proceeds and the transaction hash returns in X-PAYMENT-RESPONSE
Your application code only runs after payment is confirmed.

Integration

The middleware is available for TypeScript, Python, and Java frameworks. Configuration is a single block:
import { prismPaymentMiddleware } from "@1stdigital/prism-express";

app.use(
  prismPaymentMiddleware(
    {
      apiKey: process.env.PRISM_API_KEY,
      baseUrl: "https://prism-gw.fd.xyz",
    },
    {
      "/api/premium":     { price: "$0.01", description: "Premium data" },
      "/api/ai/generate": { price: "$0.50", description: "AI generation" },
    },
  ),
);
See the SDK Overview for all supported frameworks, or x402 Protocol Concepts for the full facilitator spec including the 402 response format, payment verification steps, and pricing models.

SDK Overview

Framework guides for TypeScript, Python, and Java

x402 Protocol Concepts

Full x402 breakdown from the merchant/facilitator perspective
Last modified on March 23, 2026