Installation

Get Corex402 packages installed and configured

For AI Agent Developers

Install Client SDK
npm install x402pp-client @solana/web3.js
This gives you everything needed to build autonomous AI agents that can negotiate pricing and pay for API access.

For API Providers

Install Server SDK
npm install x402pp-server express @solana/web3.js
This gives you Express middleware to automatically monetize your API endpoints.

All Packages

x402pp-corenpm →
Protocol foundation (required by all others)
x402pp-clientnpm →
Client SDK for AI agents
x402pp-servernpm →
Server middleware for providers
x402pp-gatewaynpm →
Verification and SLA resolution service
x402pp-indexernpm →
Analytics and reputation tracking

Network Configuration

Corex402 supports all Solana networks:

Development

// Devnet (testing)
const connection = new Connection(
  'https://api.devnet.solana.com'
);

Production

// Mainnet (production)
const connection = new Connection(
  'https://rpc.helius.xyz/?api-key=YOUR_KEY'
);

Getting SOL for Testing

Devnet Airdrop (Free)
# Get your wallet address
solana address

# Request free SOL
solana airdrop 2 YOUR_ADDRESS --url devnet

# Or use faucet: https://solfaucet.com/

Verify Installation

test.ts
import { createIntent } from 'x402pp-core';
import { Keypair } from '@solana/web3.js';

const intent = createIntent({
  capability: 'test',
  maxPricePerRequest: 0.01,
  token: 'USDC',
  agentPubkey: Keypair.generate().publicKey
});

console.log('✓ Installation successful!');
console.log('Intent ID:', intent.intentId);
ts-node test.ts
X (Twitter)