Onchain

Onchain is x402's Intelligent Intermediary Layer

Securely move money at the speed of light online

Powered by the integration of leading x402 facilitators

Coinbase
Daydreams
OctonetAI
Aurracloud
OpenX402
PayAI
x402rs
thirdweb
Anyspend
Heurist
Treasure
Corbits

Send USDC payments through the intelligent intermediary layer

💡 How it works: Your payment is signed, verified, and settled through the optimal x402 facilitator. Gasless USDC transfers with maximum efficiency on Base and Solana.

Loading analytics...

Why Onchain?

Onchain is a payment aggregator for x402 payments. Supporting Base, Solana, and cross-chain payments, Onchain routes your payments across multiple facilitators with intelligent selection and automatic failover. Additional networks launching progressively.

🔄 Multi-Facilitator Routing + Cross-Chain

Access multiple x402 facilitators (Coinbase CDP, x402.rs, Daydreams, Aurracloud, OpenX402, thirdweb, PayAI, OctonetAI, Anyspend, Heurist, Treasure, Corbits) through a single integration. Supports same-chain (Base → Base, Solana → Solana) and cross-chain payments (Solana → Base, Base → Solana). Automatic failover if one facilitator is down.

🎯 Intelligent Selection

Optimize for speed, cost, or reliability. Onchain scores each facilitator in real-time and routes to the optimal one based on your priority.

🌐 Language Agnostic

Simple REST API works with any programming language. Python, Node.js, Go, Ruby, PHP, Java, Rust - just make HTTP requests. No SDK dependencies required.

⚡ Production Ready

Battle-tested error handling, automatic retries, health monitoring, and rate limiting. Built for production from day one.

⚡ Uplink SDK - Simplest Integration

Our JavaScript/TypeScript SDK abstracts away the complexity. Just install, configure, and make payments in 12 lines of code.

# Install
npm install @onchainfi/uplink

# Usage
import { Uplink } from '@onchainfi/uplink';

const uplink = new Uplink({
  apiKey: process.env.ONCHAIN_API_KEY,
  privateKey: process.env.UPLINK_PRIVATE_KEY,
  network: 'base',
  createAtaFeeAcceptance: true,
  minimumCrosschainFeeAcceptance: true,
});

const txHash = await uplink.pay({
  to: '0xRecipient...',
  amount: '$10'
});

console.log(`Payment sent! TX: ${txHash}`);

Works on Base and Solana • Supports same-chain and cross-chain payments • Built-in retry logic and error handling

REST API Integration

Call our API from any programming language. Works with Python, Node.js, Go, Ruby, PHP, Java, Rust, or any HTTP client.

🚨 Important: Sign to Intermediate Address

The x402 payment must be signed to the correct intermediate address (NOT directly to the final recipient):

Base → Base:
0xfeb1F8F7F9ff37B94D14c88DE9282DA56b3B1Cb1
Solana → Solana:
DoVABZK8r9793SuR3powWCTdr2wVqwhueV9DuZu97n2L
Base → Solana:
0x931Cc2F11C36C34b4312496f470Ff21474F2fA42
Solana → Base:
AGm6Dzvd5evgWGGZtyvJE7cCTg7DKC9dNmwdubJg2toq

The to parameter is your final recipient. The backend validates your signature is to the correct intermediate.

# Step 1: Sign x402 payment to intermediate address
# (Use your wallet SDK to create x402 signature)

# Step 2: Call /pay with final recipient
curl -X POST https://api.onchain.fi/v1/pay \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "paymentHeader": "base64-signed-to-intermediate",
    "to": "0xFinalRecipient...",
    "sourceNetwork": "base",
    "destinationNetwork": "base",
    "expectedAmount": "1.00",
    "expectedToken": "USDC",
    "priority": "balanced"
  }'

# Response
{
  "status": "success",
  "data": {
    "txHash": "0x...",
    "verified": true,
    "settled": true,
    "facilitator": "Coinbase CDP"
  }
}

See API Documentation for detailed examples and other endpoints.

Ready to Start?

Get your free API key and start accepting payments in minutes

Get Your Free API Key →

Onchain Uplink SDK v2.2.0 released: Please migrate to v2 for new crosschain x402 payments functionality. Agents and apps can pay from Base <=> Solana in seconds.