402-as-a-Service SDK A production-grade TypeScript SDK for integrating x402 payments into your applications. Enable HTTP 402 Payment Required for your APIs with just a few lines of code.
x402-sdk is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on x402, x402-payment. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like X402-audio-to-audio, sample-agentcore-cloudfront-x402-payments, spritz, x402-facilitator, Vault-0, tdm-sdk.
A production-grade TypeScript SDK for integrating x402 payments into your applications. Enable HTTP 402 Payment Required for your APIs with just a few lines of code.
import express from 'express';
import { paymentMiddleware } from '@x402/server/express';
import { NetworkIdentifiers } from '@x402/core';
const app = express();
app.use(paymentMiddleware({
payTo: '0xYourAddress',
routes: {
'GET /api/premium': {
accepts: [{
scheme: 'exact',
price: '$0.01',
network: NetworkIdentifiers.BASE_MAINNET,
payTo: '0xYourAddress'
}],
description: 'Premium API access'
}
}
}));
app.get('/api/premium', (req, res) => {
res.json({ data: 'premium content' });
});
import { createX402Fetch } from '@x402/client/fetch';
import { EVMWalletAdapter } from '@x402/wallet-adapters/evm';
const wallet = new EVMWalletAdapter({
privateKey: process.env.PRIVATE_KEY,
network: NetworkIdentifiers.BASE_MAINNET
});
const fetch = createX402Fetch({ wallet, autoPay: true });
// Automatically handles payments
const response = await fetch('https://api.example.com/premium');
const data = await response.json();
@x402/core - Core types, utilities, and facilitator client@x402/server - Server middleware (Express, Next.js, Hono, Fastify)@x402/client - Client SDK (Fetch, Axios)@x402/wallet-adapters - Wallet adapters (EVM, Solana)@x402/metering - Usage metering and analytics@x402/dashboard - Revenue dashboard# Install server packages
npm install @x402/core @x402/server
# Install client packages
npm install @x402/core @x402/client @x402/wallet-adapters
# Install metering and dashboard
npm install @x402/metering @x402/dashboard
eip155:8453)eip155:84532)eip155:1)eip155:11155111)solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp)solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1)┌─────────────────┐ 402 Payment Required ┌─────────────────┐
│ Client App │◄────────────────────────────►│ Server API │
│ (with wallet) │ Payment Payload (X-Payment) │ (x402 middleware)│
└────────┬────────┘ └────────┬────────┘
│ │
│ ┌──────────────────┐ │
└────────►│ Facilitator │◄─────────────────┘
│ (x402.org) │
│ - Verify │
│ - Settle │
└──────────────────┘
Apache-2.0
Transmits signed USDC payments over sound using a custom OOK audio modem with Goertzel detection. Compresses x402 handshakes to 138 bytes, settling on Base through 36 seconds of 2400 Hz beeping.
AWS payment demo of x402 using Bedrock AgentCore, Strands SDK, and CloudFront.
Spritz is a decentralized, permission-less and censorship resistant chat app for web3. Connect with friends using passkeys or wallets. Make HD video calls, go live to your followers, and chat freely on a decentralized network.
Golang implementation of an x402 payment facilitator
Vault-0: Agent Security, Monitor & x402 Wallet for OpenClaw. Encrypted secret vault, real-time agent monitor, policy enforcement, and native x402 payments — built with Rust + Tauri.
Open contract-facing SDK for payable routes and gateway-backed integrations. Thin public surface for authorize, checkout, and session flows.
An open SDK for agentic payments. Let AI agents make payments, hold funds, and move money across chains with policy enforcement and human approval built in.
Golang SDK for A2A Protocol
Client SDK for the Vybe x402 API. Pay-per-call USDC over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. Built for AI agents.
Rust SDK for the Machine Payments Protocol
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Opinionated React Native crypto x AI chat app boilerplate with embedded wallet support, conversational AI, and dynamic UI component injection