This page covers x402 gateway auth — using a wallet to authenticate and pay for access to Alchemy APIs. To pay x402 v2 endpoints that offer a supported EVM payment option from the CLI, see x402 payments.
x402 gateway auth to Alchemy APIs in the Alchemy CLI uses two open standards today:
- SIWE (Sign-In With Ethereum): Your agent authenticates by signing a message with an EVM wallet.
- x402: An open protocol for HTTP-native payments. When payment is required, the server responds with HTTP 402, the CLI signs the payment challenge with the same EVM wallet, and retries the request. Zero protocol fees.
The CLI also supports local Solana wallets for Solana transaction signing, but x402 gateway authentication currently uses an EVM wallet and SIWE.
When your agent needs to access Alchemy APIs without an API key, it handles the full wallet authentication flow:
- Wallet setup: Your agent creates a local EVM wallet or imports an existing EVM private key.
- Authentication: Your agent generates a signed SIWE token and includes it in every x402 gateway request.
- Payment: When payment is required, the server responds with HTTP 402, and your agent signs the requested USDC payment before retrying automatically.
The wallet used for x402 gateway auth only determines authentication and payment. Once authenticated, it can query any chain across all networks Alchemy supports.
All standard Alchemy APIs are available through the x402 gateway:
- Node RPC: Standard Ethereum JSON-RPC methods (
eth_*) plus Alchemy-enhanced methods, across 100+ chains - Token API: Token balances, metadata, and allowances
- NFT API: NFT ownership, metadata, sales, and spam detection
- Transfers API: Asset transfer history with filtering
- Prices API: Spot and historical token prices
- Portfolio API: Multi-chain balances and portfolio data
- Simulation API: Transaction simulation and outcome prediction
These are the same APIs available with a standard API key. The only difference is the authentication and payment mechanism.
| EVM wallet | Solana wallet | |
|---|---|---|
| CLI use | x402 gateway auth and EVM transaction signing | Solana transaction signing |
| Auth standard | SIWE (EIP-4361) | Not used for x402 gateway auth in the CLI today |
| Signature | secp256k1 | ed25519 |
| Payment | USDC payments to Alchemy through x402 gateway auth | Not used for x402 gateway auth in the CLI today |
| Queryable chains through x402 gateway auth | All supported networks | Not applicable |
Install the agentic-gateway agent skill so your AI coding agent learns this flow automatically:
npx skills add alchemyplatform/skills --yesYour agent will walk you through wallet setup and handle authentication and payments from there.
The Alchemy CLI ships the x402 gateway auth flow built in. Create or import a local EVM wallet, opt into x402 gateway auth, and node and data commands can authenticate and pay Alchemy from that wallet without an API key.
alchemy wallet connect --mode local
alchemy config set x402 true
alchemy evm data balance vitalik.ethYou can also point at an existing EVM private key file with alchemy config set wallet-key-file <path>, pass --wallet-key-file <path>, or set ALCHEMY_WALLET_KEY.