Installation
Get Corex402 packages installed and configured
For AI Agent Developers
Install Client SDK
npm install x402pp-client @solana/web3.jsThis 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.jsThis gives you Express middleware to automatically monetize your API endpoints.
All Packages
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