Skip to content

SBC CLI

Official terminal interface for SBC Agent Payments. Authenticate agents and users, check balances, pay x402 / MPP seller URLs, send SBC or cfUSD, swap on Base, and manage seller endpoints from the command line.

Package: @stablecoin.xyz/cli · Binary: sbc · Node.js: 20+

npm install -g @stablecoin.xyz/cli

Or from source:

git clone https://github.com/stablecoinxyz/sbc-cli.git
cd sbc-cli
npm install && npm run build && npm link

Quickstart

1. Log in as a user

Generate a user key in the dashboardSettings → CLI access → Generate key.

sbc auth user login --user-key sk_user_YOUR_KEY
sbc user whoami

2. Log in as an agent

Create an agent and generate an API key on the agent detail page → API Keys → + New Key.

sbc agent login --agent-key sk_live_YOUR_KEY
sbc whoami

Agent login resolves the agent ID, chain, wallet, and token from the API key via GET /api/agents/me.

3. Pay, send, manage

# Check balances (SBC + cfUSD on Base)
sbc balance
 
# Pay a seller URL (x402 or MPP — amount and token set by the seller)
sbc pay --url "https://api.example.com/data"
 
# Send tokens (gasless on Base via ERC-4337 paymaster)
sbc send --to 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0 --amount 1.5
sbc send --to 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0 --amount 1.5 --token cfUSD
 
# Swap on Base (Better Intents RFQ — same pairs as the dashboard)
sbc swap --from USDC --to SBC --amount 1
sbc swap --from SBC --to cfUSD --amount 1
 
# Platform manifest + account management
sbc manifest
sbc agent list
sbc endpoint list

Supported tokens: SBC on all chains; cfUSD on Base and Base Sepolia only. Token is chosen at send / endpoint-create time — not when creating an agent.

Add --output json to any command for machine-readable output.

See the full command reference.

How it works

Payments (sbc pay)

sbc pay sends the seller URL to the SBC platform. The seller responds with HTTP 402 and the price; the platform signs and settles (x402 permit or MPP transfer). You never pass the amount on the CLI.

Gasless send (sbc send on Base)

On Base and Base Sepolia, sbc send uses ERC-4337 with the SBC AA proxy (api.aa.stablecoin.xyz) as bundler and paymaster. Gas is sponsored — the agent wallet needs zero ETH. Pass --token cfUSD to send cfUSD (default is SBC). On Radius and Tempo, direct transfer is used (SBC only).

Swap (sbc swap on Base)

sbc swap calls Agent Payments (POST /api/agents/:id/swap) and settles via Better Intents RFQ. Base / Base Sepolia agents only. Allowed pairs: USDC→SBC, SBC→cfUSD, cfUSD→SBC. Swaps count toward agent spending limits.

Config

Credentials are stored in ~/.sbc/config.json with 0600 permissions. Prefer environment variables in CI:

VariableDescription
SBC_API_URLPlatform base URL (default: https://agents.stablecoin.xyz)
SBC_AGENT_KEYAgent API key — overrides config file
SBC_AGENT_IDDefault agent UUID — overrides config file
SBC_USER_KEYUser API key — overrides config file
export SBC_API_URL=http://localhost:3000
sbc agent login --agent-key sk_live_...

Security

  • Never commit ~/.sbc/ or plaintext keys. Add ~/.sbc/ to your global .gitignore.
  • In automated environments, use SBC_AGENT_KEY / SBC_USER_KEY instead of the config file.
  • Report vulnerabilities privately to security@stablecoin.xyz.

Related