Use this file to discover all available pages before exploring further.
This guide takes you from zero to accepting AI agent payments. You’ll set up a server endpoint that requires stablecoin payment via the x402 protocol — any AI agent with a compatible wallet can pay and access it.
Coming soon. Python SDKs (prism-flask, prism-fastapi, prism-django) are not yet published to PyPI. The install command below shows the planned package.
pip install finance-district
Coming soon. The Java SDK (prism-sdk) is not yet published to Maven Central. The dependency below shows the planned coordinates.
Protect an endpoint with x402 payment verification. When an agent hits this endpoint without paying, it gets a 402 Payment Required response with payment instructions. After paying, the request goes through.
Express.js
FastAPI
Flask
import express from "express";import { prismPaymentMiddleware } from "@1stdigital/prism-express";const app = express();app.use( prismPaymentMiddleware( { identifyToken: process.env.PRISM_IDENTIFY_TOKEN, baseUrl: "https://prism-gw.fd.xyz", }, { "/api/premium": { price: "$0.01", description: "Premium API access", }, } ));app.get("/api/premium", (req, res) => { res.json({ message: "Premium content", payer: req.payer, // wallet address that paid });});app.listen(3000, () => console.log("Server running on port 3000"));
Coming soon. The prism-fastapi package is not yet published to PyPI. The code below shows the planned API.
This confirms the middleware is working. Any AI agent with a compatible wallet (including Agent Wallet) can now pay and access the endpoint automatically.
To test the full payment flow, use the Agent Wallet
CLI or connect an Agent Wallet via
MCP and ask the agent to access
your endpoint.