DEV Community

Cover image for 💧 Spraay x402 Gateway Now Accepts Solana USDC — Dual-Chain AI Agent Payments Are Live
Mr Hamlin
Mr Hamlin

Posted on

💧 Spraay x402 Gateway Now Accepts Solana USDC — Dual-Chain AI Agent Payments Are Live

Your AI agent holds USDC on Solana. The API it needs to call takes payment on Base. Until today, that meant bridging, swapping, or just not making the call.

Not anymore.

What We Shipped

The Spraay x402 Gateway — 93+ paid endpoints covering AI inference, batch payments, DeFi, oracle data, escrow, payroll, robotics, supply chain, and more — now accepts USDC on both Base and Solana mainnet through the official x402 protocol.

Every gated endpoint returns a 402 challenge with two accepts entries. The agent picks whichever chain it holds funds on. No bridging, no extra steps.

{
  "accepts": [
    {
      "scheme": "exact",
      "price": "$0.008",
      "network": "eip155:8453",
      "payTo": "0xAd62f03C7514bb8c51f1eA70C2b75C37404695c8"
    },
    {
      "scheme": "exact",
      "price": "$0.008",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "8WhWE8YgY5QBWyLowEHuaZiWdwDM3SrgDk36xYBNvYNS"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Three Payment Rails, One Gateway

The gateway now supports three concurrent payment methods on every route:

1. x402 EVM (Base) — The original rail. Coinbase CDP facilitator handles verification and settlement. Sub-cent gas on Base.

2. x402 SVM (Solana) — New. Uses the official @x402/svm SDK with ExactSvmScheme. Same Coinbase facilitator. 400ms finality, ~$0.00025 tx fees. Fully compatible with pay.sh, xpay, and every x402 client.

3. Custom Solana (X-Solana-Tx header) — A direct SPL USDC transfer fallback. Agent sends USDC to the receive address, retries with the tx signature in a header, gateway verifies on-chain via @solana/web3.js. Works for agents that don't speak x402.

All three are active simultaneously. None interfere with each other.

How It Works (Agent Perspective)

Agent calls GET /api/v1/oracle/prices
  → Gateway returns 402 with accepts[] (Base + Solana)

Agent inspects accepts[], picks solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
  → Signs USDC transfer authorization

Agent retries with X-PAYMENT header containing signed payload
  → Coinbase facilitator verifies + settles on Solana
  → Gateway returns 200 with oracle data
Enter fullscreen mode Exit fullscreen mode

The entire flow is one round-trip after the initial 402. No accounts, no API keys, no subscriptions.

Discovery Endpoints

Agents can auto-discover payment options at:

  • /.well-known/x402.json — Full resource catalog with pricing
  • /.well-known/solana.json — Solana-specific payment config
  • /.well-known/agent-registration.json — Agent framework metadata
  • /.well-known/mpp.json — MPP/Stripe support (also active)

What's Covered

93+ paid endpoints across 21 categories:

  • AI Inference — 200+ models via OpenRouter + 43 Bittensor models (SN64)
  • Batch Payments — Base, Stellar, XRP, up to 200 recipients
  • DeFi — Swaps, bridge quotes, position tracking
  • Oracle — Prices, gas, FX rates
  • Payroll — Crypto payroll execution and estimation
  • Escrow — Create, fund, release, cancel with milestones
  • Infrastructure — RPC, IPFS, cron, logging, webhooks
  • Robotics (RTP) — Dispatch physical tasks to robots via x402
  • Supply Chain (SCTP) — Suppliers, POs, invoices, AI verification
  • Agent Wallets — Provision smart contract wallets on Base
  • And more — KYC, auth, audit, tax, GPU compute, search/RAG, XMTP messaging

All of these now accept payment on Base or Solana.

Technical Implementation

For anyone building a similar dual-chain x402 server, the key pieces are:

import { ExactSvmScheme } from "@x402/svm/exact/server";

// Register both schemes
const server = new x402ResourceServer(facilitatorClient)
  .register("eip155:8453", new ExactEvmScheme());
server.register("solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", new ExactSvmScheme());

// Each route gets dual accepts
"GET /api/v1/oracle/prices": {
  accepts: [
    { scheme: "exact", price: "$0.008", network: "eip155:8453", payTo: evmAddress },
    { scheme: "exact", price: "$0.008", network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", payTo: solanaAddress },
  ],
}
Enter fullscreen mode Exit fullscreen mode

The Coinbase CDP facilitator handles both EVM and SVM verification — no need to run your own.

Try It

# See the dual-chain 402 challenge
curl https://gateway.spraay.app/api/v1/oracle/prices

# Solana discovery
curl https://gateway.spraay.app/.well-known/solana.json

# With pay.sh (Solana wallet)
pay curl https://gateway.spraay.app/api/v1/oracle/prices?tokens=ETH
Enter fullscreen mode Exit fullscreen mode

Links


The x402 ecosystem is moving fast. Solana support in the protocol means agents on either chain can pay for APIs without bridging. We're live on both. Build something.

Top comments (0)