Skip to content
Alchemy Logo

Agent Authentication and Payment

Authenticate your AI agent with an EVM or Solana wallet instead of an API key using SIWE and SIWS. Your agent purchases credits with USDC via the x402 payment protocol.

x402 wallet authentication uses three open standards:

  • SIWE (Sign-In With Ethereum): Your agent authenticates by signing a message with an EVM wallet.
  • SIWS (Sign-In With Solana): Adapted from EIP-4361 for Solana's ed25519 signatures. Your agent authenticates with a Solana wallet.
  • x402: An open protocol for HTTP-native payments. When your agent's credits run out, the server responds with HTTP 402, your agent purchases more credits and retries the request. Zero protocol fees.

When your agent needs to access Alchemy APIs without an API key, it handles the full wallet authentication flow:

  1. Wallet setup: Your agent creates a new wallet or imports an existing one. You choose between an EVM wallet (USDC on Base) or a Solana wallet (USDC on Solana).
  2. Authentication: Your agent generates a signed auth token using SIWE (EVM) or SIWS (Solana) and includes it in every API request.
  3. Credits: Your agent purchases 1 USDC worth of credits from your wallet. When credits run out, the server responds with HTTP 402, and your agent purchases another 1 USDC of credits automatically.

Your wallet type only determines authentication and payment. Either wallet type 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 walletSolana wallet
StandardSIWE (EIP-4361)SIWS
Signaturesecp256k1ed25519
PaymentUSDC on BaseUSDC on Solana
Queryable chainsAll supported networksAll supported networks

Install the agentic-gateway agent skill so your AI coding agent learns this flow automatically:

npx skills add alchemyplatform/skills --yes

Your agent will walk you through wallet setup and handle authentication and payments from there.

Was this page helpful?