Skip to main content
This quickstart takes you from installation to a working request through selat-router.

Prerequisites

Before you begin, you must have:
  • Node.js 18 or newer
  • Access to a signer, either a private key, Circle Agent Wallet, or remote signer
  • A wallet funded with USDC on your target chain (see the “Fund your wallet” step below)
  • A target endpoint that is reachable through SELAT

Get started

1

Install

Install the SDK.
2

Create a signer

Start with a private key, or switch to a Circle Agent Wallet or remote signer when you are ready to remove secrets from the runtime.The signer reads your key from the X402_CLIENT_PRIVATE_KEY environment variable. If you don’t already have a key, generate one:
Then create the signer:
3

Fund your wallet

Paid requests draw USDC from your signer’s wallet through Circle Gateway. A brand-new key has a zero balance, so fund it before your first paid request — otherwise the request fails with an insufficient-balance error.The simplest way to top up is the SELAT CLI:
Use the same chain you pass to RouterClient (here, base) — see signer and chain guidance. You can also deposit USDC into Circle Gateway directly for the wallet behind your signer.
4

Send a paid request

Create the client and call fetch against your target endpoint.
If you want to keep the signer outside the SDK process, use Circle Agent Wallets or a remote signer.