r1x SDK

Build AI agents that pay. Ship x402 services agents buy. The complete toolkit for the autonomous economy.

Overview

The r1x SDK provides everything you need to build in the agent economy. Create agents that understand payments. Deploy services that agents buy. All with TypeScript type safety and one‑line integrations.

Installation

npm install x402-sdk @reown/appkit wagmi viem
# or
pnpm add x402-sdk @reown/appkit wagmi viem

Quick Start: Accept Payments

import { create402Response, verifyPayment } from 'x402-sdk';

export async function POST(request: Request) {
  const payment = request.headers.get('x-payment');
  
  if (!payment) {
    // Return 402 with quote
    return create402Response({
      amount: "1.00",
      merchant: process.env.MERCHANT_ADDRESS!,
      description: "Premium API access"
    });
  }
  
  // Verify payment
  const verified = await verifyPayment(payment);
  if (!verified) return new Response('Invalid payment', { status: 400 });
  
  // Return service
  return Response.json({ data: "Your premium content" });
}
Coming Soon
The r1x SDK is in active development. Agent builder tools, payment abstractions, and discovery protocols shipping soon.
server.r1xlabs.com