selat command only; it does not install or configure the Router SDK for application code.
It ships as the @selat-ai/selat-cli package, which installs the selat command.
When to use it
- You want to test a paid endpoint manually.
- You want a shell-based flow for operators or CI.
- You want an agent-friendly command layer without writing a custom client first.
Install
Prerequisites
selat init checks these for you and tells you how to fix anything missing, but for reference the CLI needs:
- Node.js 18 or newer
- The Circle CLI (
@circle-fin/cli) — wallet creation, MPC-backed signing, and Gateway deposits - The discovery skill (
@selat-ai/selat-discovery) — the federated catalog and intent ranking that powersselat searchandselat run. Ships as a dependency of the CLI;initverifies it.
Get started
The canonical first-run flow is init → fund → arm a budget → run, withselat search as the free preview of what run would pick.
1
Bootstrap your setup
selat init is idempotent — safe to re-run. It checks prerequisites, walks you through Circle Agent Wallet login (one email + one OTP), ensures agent wallets exist, and writes your config.init points you to selat fund.2
Fund your Gateway balance
Top up the Gateway balance your payments draw from.
fund previews the deposit and requires an explicit confirmation before moving anything ($0.50 minimum deposit). Prefer to buy with a card instead? selat fund --onramp mints a Circle Onramp browser-widget link — no deposit happens on the CLI side.3
Discover and rank — for free
Describe what you want in plain language.
search runs the same discovery and ranking as run, but stops before payment — no wallet, no spend.4
Arm a session budget
Paid calls (
run, skill run, compare --pay, verify --pay) refuse to execute until a session budget is armed. This is a separate, required gate from the wallet’s own Circle spending policy.5
Pay for the best match
run discovers matching x402 services, ranks them, and pays for the best one in a single pipe — capped at $1.10 per call by default.Spending caps
A runaway agent is stopped at four independent scopes — none can be raised by anything running inside an agent session:Commands
selat init
Bootstraps an agent-payment setup in one flow.
selat search "<intent>"
Runs the free front half of selat run: discovers matching endpoints across the federated catalogs and ranks them for the intent, without touching a wallet. No payment path exists in this command.
selat run "<intent>"
Takes a natural-language intent and runs the discovery skill’s ranking + payment plan against it, paying for the top match. Requires an armed session budget (selat budget start) — see Spending caps.
selat fund
Tops up your Gateway balance. Shows the plan locally, then requires you to confirm before depositing. Refused while selat freeze is on.
Buy USDC with a card (Onramp)
No crypto yet?selat fund --onramp lets you start from a debit or credit card. It mints a one-time Circle Onramp session through the SELAT catalog (free; the Onramp key stays server-side) and gives you a browser link. You pick the amount and pay inside Circle’s widget — the CLI never sees your card, never prompts for an amount, and moves no money itself.
1
Buy USDC in the widget
Run
selat fund --onramp. In a terminal it offers to open the link in your browser; in an agent (non-interactive) shell it prints the link for the agent to relay into chat. Links expire after about 30 minutes — re-run the command any time for a fresh one.The session is scoped to USDC only, on the chains selat fund can deposit from: Base, Ethereum, Arbitrum, Polygon, Avalanche, Unichain, and Arc. (Circle’s widget doesn’t carry USDC on Optimism, so it isn’t offered.) The purchase lands on-chain in your agent wallet on the chain you choose.2
Deposit it into Gateway
Once the purchase has landed on-chain, deposit it into your Gateway balance like any other USDC — pass
--chain for the chain you bought on:- First run.
selat initoffers the same path when your wallet is empty — answercardat the send / card / skip prompt. - Other wallets.
--addressfunds any agent wallet. If it isn’t the configured SELAT wallet, the CLI warns you — paid calls still spend from the configured wallet. - Kill switch.
--onrampis refused whileselat freezeis on, like every other funding path. - Not Transak. This is SELAT’s built-in onramp. Circle CLI’s
circle wallet fund --method fiatis a different, Transak-backed onramp. - If the link can’t be minted (catalog unreachable), the command exits with an error — crypto funding with
selat fund --amount <usd>still works.
selat refund claim | query <quote-id>
Files or checks a refund claim for a prior settled quote (a selatx… ID from a paid call’s receipt), authenticated through selat-pay with a signed wallet-ownership proof (an EIP-712 signature that can’t move funds). This is authentication, not a payment — it doesn’t touch the session budget or --max-amount. Every claim is reviewed; what comes back depends on whether the upstream captured the payment — see Refunds follow capture.
selat budget
Read-only view of the wallet’s Circle spending caps and the remaining per-window budget, plus the commands to arm or disarm the session spending tripwire that paid calls require. See Spending caps for how this fits with selat setup-policy and selat freeze.
selat freeze / selat unfreeze
A local, instant kill switch — no Circle round-trip. While frozen, this CLI refuses selat fund (deposits and --onramp) and any paid call; selat-pay also refuses to sign. Free discovery (search, skill list, doctor) keeps working. It does not touch Circle wallet policy, which stays governed by selat setup-policy.
selat history
Shows locally recorded Gateway micropayments.
selat spend
Prints a unified, read-only spend report: settled spend from the local selat-pay ledger plus Apify prepaid-token utilization from the token store.
selat setup-policy
Interactively sets Circle spending caps (per-transaction, daily, weekly, monthly) on your Agent Wallet. Requires an email OTP per chain — Circle gates policy writes for security, and there is no batch write. Recommended before any deposit over ~$20.
With all four caps given as flags, the prompts are skipped and the only interactive step left is Circle’s emailed code(s).
selat doctor
Runs a one-pass diagnosis of common setup problems (skill install, PATH, Circle auth, wallet, config, catalog freshness).
Agent skills
Beyond ad-hocselat run, the CLI can install and run agent skills — named, reusable payment recipes from the public selat-skills registry (or a local path).
Configuration
selat init writes your config to $XDG_CONFIG_HOME/selat-pay/.env (mode 0600). Values are layered: shell env > cwd .env > this file. You can also set these in the environment to override defaults: