Skip to main content

x402 Payments

Updated on
Apr 06, 2026

Overviewโ€‹

x402 on Quicknode provides pay-per-request access to blockchain endpoints across all supported networks. Instead of creating an account and managing API keys, any application or AI agent with a wallet and a supported stablecoin can start making calls immediately.

x402 is an open payment standard by Coinbase built on the HTTP 402 "Payment Required" status code. Client libraries handle the payment negotiation automatically.

x402 on Quicknode supports three access patterns:


  • Pay-per-request: No authentication required. Each request includes a payment signature handled automatically by the client.
  • Credit drawdown: Authenticate once with SIWX, purchase a credit bundle, and consume credits per request. Required for gRPC-Web and WebSocket transports.
  • Nanopayment: Batched payments via Circle Gateway. The payment chain is limited to selected EVM testnets (Base Sepolia, Polygon Amoy, Arc Testnet).

Regardless of which payment model or payment chain you use, you can query any of Quicknode's supported networks.

x402 is an additive access method. It does not replace Quicknode's standard plans. Teams running production workloads benefit from standard plans with SLAs, dedicated support, and higher rate limits. x402 is designed for AI agents, rapid prototyping, and use cases where permissionless access is the priority.

info

x402 on Quicknode is currently in alpha.

# Fetch machine-readable x402 documentation for AI agents
curl https://x402.quicknode.com/llms.txt

Quick Startโ€‹

Install the @quicknode/x402 package regardless of which payment model you choose, as the client supports all three patterns with configuration options.

npm install @quicknode/x402

Pay-per-requestโ€‹

Pay-per-request requires no authentication or session state. Each request includes a payment signature handled automatically by the client.

import { createQuicknodeX402Client } from '@quicknode/x402'

const client = await createQuicknodeX402Client({
baseUrl: 'https://x402.quicknode.com',
network: 'eip155:84532', // Base Sepolia (payment network)
evmPrivateKey: process.env.PRIVATE_KEY as `0x${string}`,
paymentModel: 'pay-per-request',
})

// The endpoint below is the chain you want to query (not the payment chain).
// You can call any Quicknode-supported network here regardless of which chain you pay on.
const response = await client.fetch('https://x402.quicknode.com/base-mainnet', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'eth_blockNumber',
params: [],
}),
})

const data = await response.json()
console.log('Block:', data.result)
Building with Solana?

Use @quicknode/x402-solana, a dedicated Solana Kit integration that creates x402-enabled RPC and WebSocket clients directly from your Solana keypair. No account or API key required, just a wallet with USDC. Check out the How to Access Solana RPC with x402 guide for a full walkthrough.

npm install @quicknode/x402-solana

See the examples repo for reference implementations.

Supported Protocolsโ€‹

x402 endpoints support the same protocols as standard Quicknode endpoints. Protocol availability varies by payment model:

ProtocolPay-per-requestCredit DrawdownNanopayment
JSON-RPCYesYesYes
RESTYesYesYes
gRPC-WebNoYesNo
WebSocketNoYesNo

Pricingโ€‹

x402 on Quicknode supports three billing patterns:

Pay-per-requestCredit DrawdownNanopayment
Cost$0.001 per request$10 per 1,000,000 credits (~$0.00001 per request)$0.0001 per request
SettlementOne on-chain payment per requestUpfront credit purchase, consumed per responseBatched via Circle Gateway (gasless after initial USDC deposit)
AuthenticationNoneSIWX + JWTNone (Circle Gateway Wallet deposit required)
Testnet cap1,000 requests1,000 credits10,000 requests
Best forSimple integrations, low volumeSustained usage, streaming protocolsHigh-volume testing, sub-cent cost

Credit Consumption Ratesโ€‹

For the credit drawdown pattern, each successful response consumes credits based on the protocol used. When credits are depleted, the next request triggers an automatic payment for a new credit bundle.

ProtocolRate
JSON-RPC (HTTP)1 credit per successful (HTTP 200) response
REST (HTTP)1 credit per successful response
gRPC-Web1 credit upfront + 1 credit per 10 KB of response data
WebSocket1 credit upfront + 1 credit per response message

Error responses, JSON-RPC errors, and non-200 HTTP status codes are not metered. Testnet caps are tracked independently per payment type.

Supported Payment Networksโ€‹

These are the chains you pay on. The chain you pay on does not need to match the chain you query.

Payment NetworkTokenPay-per-requestCredit DrawdownNanopayment
Base SepoliaUSDCYesYesYes
Base MainnetUSDCYesYesNo
Polygon AmoyUSDCYesYesYes
Polygon MainnetUSDCYesYesNo
XLayer TestnetUSDGYesYesNo
XLayer MainnetUSDGYesYesNo
Arc TestnetUSDCNoNoYes
Solana DevnetUSDCYesYesNo
Solana MainnetUSDCYesYesNo

To get testnet tokens:

  • Base Sepolia / Polygon Amoy / Arc Testnet: Use the Circle faucet for USDC. Base Sepolia also has a built-in /drip endpoint on the x402 gateway.
  • XLayer Testnet: Pre-fund your wallet with USDG on XLayer Testnet.
  • Solana Devnet: Pre-fund your wallet with USDC on Solana Devnet via the Circle faucet.

Authenticationโ€‹

Authentication is required for credit drawdown only. Pay-per-request and nanopayment include the payment signature in each request and do not require a JWT.

For credit drawdown, the /auth endpoint accepts three authentication paths:


  • SIWE (EVM only): Post a signed EIP-4361 SIWE message. This is the original auth method and remains fully supported.
  • SIWX/EVM: Same SIWE message format with "type": "siwx" in the request body.
  • SIWX/Solana: A CAIP-122 / SIWS formatted message signed with Ed25519, encoded as Base58, with "type": "siwx".

All paths require the following fields in the signed message:

  • domain (x402.quicknode.com)
  • address (your wallet address)
  • uri (https://x402.quicknode.com)
  • version (1)
  • chainId (the chain ID of the network you pay on)
  • nonce (at least 8 random characters)
  • issuedAt (current ISO 8601 timestamp, within 5 minutes).

The auth response returns a JWT that expires in 1 hour. Include Authorization: Bearer <JWT> on all subsequent requests.

How It Worksโ€‹

The flow below describes the credit drawdown model. For pay-per-request and nanopayment, steps 1 and 2 are skipped; each request includes a payment signature directly with no prior authentication.

The @quicknode/x402 client handles the full payment flow automatically. Under the hood, the credit drawdown flow follows this sequence:


  1. Authenticate. Sign a message with your wallet (SIWE for EVM, SIWX for Solana) and exchange it for a JWT token at the /auth endpoint.
  2. Make requests. Send requests to POST /:network with the JWT in the Authorization: Bearer header. Requests work across JSON-RPC, REST, gRPC-Web, and WebSocket protocols.
  3. Pay when prompted. When credits run out, the server returns HTTP 402. The client automatically signs a stablecoin payment and retries the request.
  4. Repeat. Credits are consumed per successful response. When exhausted, the next request triggers a new payment automatically.

x402 vs Standard Quicknode Plansโ€‹

x402Standard Plans
AuthenticationNone (SIWX + JWT only for credit drawdown)API key
BillingPer request (or credit bundle for drawdown)Monthly/Yearly subscription
Setup requiredWallet + stablecoinAccount + API key
StatusAlphaProduction SLA
Best forAgents, prototyping, permissionless accessTeams, production workloads

Resourcesโ€‹

tip

For an alternative payment protocol, see MPP Payments. For managing Quicknode infrastructure through natural language, see Quicknode MCP. For giving AI coding agents accurate Quicknode API knowledge, see Blockchain Skills.

We โค๏ธ Feedback!โ€‹

If you have any feedback or questions about this documentation, let us know. We'd love to hear from you!

Share this doc