accessMode.
| Access mode | Header | Settles on-chain? | Used for |
|---|---|---|---|
exact | PAYMENT-SIGNATURE (aka X-PAYMENT) | Yes — USDC on Solana mainnet | Paid Solana RPC and DAS routes |
siwx | SIGN-IN-WITH-X | No | Tokens API routes |
exact — pay-per-call with USDC
Used by every Alchemy and Helius Solana RPC / DAS route.
Challenge
The first unauthenticated request to a paid route returns402 Payment Required with an envelope like:
Response
The client builds an SVMexact transfer for maxAmountRequired to payTo and includes it in PAYMENT-SIGNATURE. The gateway:
- Verifies the signed transfer via the CDP facilitator.
- Forwards the request to the upstream provider.
- Settles the transfer only after the upstream returns a successful response.
- Returns the upstream JSON along with an
X-PAYMENT-RESPONSEheader carrying the Solana settlement transaction.
siwx — wallet authentication without payment
Used by every /v1/x402/tokens/... route. The gateway holds the Tokens API key server-side; clients never see it. Instead, they prove ownership of a Solana wallet and the gateway calls the Tokens API on their behalf.
Challenge
The first unauthenticated request returns402 Payment Required with a SIWX extension:
Response
The client constructs a SIWX message, signs it with their Solana wallet, base64-encodes the payload, and retries the request withSIGN-IN-WITH-X. The gateway:
- Verifies the wallet signature.
- Enforces the 300-second expiration window.
- Caches a short-lived session key in Redis to reject replays.
- Calls the Tokens API with the server-side
x-api-key. - Returns the Tokens API JSON response.
X-PAYMENT-RESPONSE header is returned.
Why two modes
The two modes solve different problems the gateway needs to bridge:- Paid Solana RPC/DAS comes from providers that already have a well-defined PAYG cost per request, and clients want per-call payment without managing a provider-specific API key.
exactx402 is the natural match. - Tokens API is priced at the account level, not per request, and needs a trusted origin to hold the shared API key. Asking clients to pay per request would misrepresent the upstream cost. SIWX gives clients wallet-level identity without pretending each call has an independent on-chain price.
@x402/fetch) supports them out of the box.

