Quickstart — Free API to Paid in 10 Minutes
Turn any existing Express API into an x402-gated, USDC-paid endpoint using the Orchus facilitator. No payment processor accounts. USDC goes straight to your wallet.
What you need: an existing Node.js API, a Solana wallet
Step 1 — Get a Solana Wallet (2 min)
- Go to phantom.app → Download → Install
- Create new wallet → save your seed phrase
- Copy your wallet address (looks like
BqVq3uwK1Lo4qVwmrNscWvyHAghPJcmmEck5961kaNCG)
This is where your USDC payments will land.
Step 2 — Get USDC on Solana
You need USDC on Solana mainnet. Buy it on any exchange (Coinbase, Binance) or swap via Jupiter.
Step 3 — Install x402 Packages
npm install @x402/express @x402/svm @x402/coreStep 4 — Add Payment Middleware
Before (your existing server):import express from 'express';
const app = express();
app.get('/data', (req, res) => {
res.json({ result: 'your data here' });
});
app.listen(3000);import express from 'express';
// --- ADD THESE ---
import { paymentMiddleware, x402ResourceServer } from '@x402/express';
import { ExactSvmScheme } from '@x402/svm/exact/server';
import { HTTPFacilitatorClient } from '@x402/core/server';
const facilitator = new HTTPFacilitatorClient({
url: 'https://x402.agentstrail.ai', // Orchus facilitator — already live
});
const resourceServer = new x402ResourceServer(facilitator)
.register('solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', new ExactSvmScheme());
app.use(paymentMiddleware({
'GET /data': {
accepts: [{
scheme: 'exact',
price: '$0.01',
network: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
payTo: 'YOUR_WALLET_ADDRESS', // from Step 1
asset: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
}],
},
}, resourceServer));
// --- END ---
// Your existing route — unchanged
app.get('/data', (req, res) => {
res.json({ result: 'your data here' });
});
app.listen(3000);Step 5 — Restart and Test
node server.jscurl http://localhost:3000/data
# Expected: HTTP 402 Payment Required ✅Your API is now x402-gated.
Step 6 — Register on Orchus
- Go to discover.agentstrail.ai/onboard
- Scroll to Submit Your Endpoint
- Paste your public API URL
- Click Submit
Orchus probes your endpoint, verifies the 402 response, and lists your API in the Library. AI agents will start discovering and paying for it.
Step 7 — Watch USDC Arrive
Every call:
- Client pays
$0.01 USDCautomatically x402.agentstrail.aiverifies + settles on Solana- USDC lands directly in your wallet
Check earnings at discover.agentstrail.ai/seller
Reference
| Item | Value |
|---|---|
| Facilitator URL | https://x402.agentstrail.ai |
| Network ID | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp |
| USDC mint | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v |