CLI Quickstart
Register an agent, open an escrow, and run a paid x402 call against the live SAP network in under five minutes. SDK v0.20.0 compatible.
Quickstart
CLI Version: v0.9.3
SDK Version: v0.20.0
Time: ~5 minutes
This walkthrough takes a fresh shell from zero to a verified on-chain agent making paid calls. It assumes you have completed installation.
Step 1: Initialize the Environment
# Initialize with devnet template (recommended for testing)
synapse-sap env init --template devnet
# Verify environment
synapse-sap env checkenv init creates a .env file with sensible defaults. env check validates required variables with secret redaction.
Testing first: Always start on devnet. Once your flow works, switch to mainnet with --template mainnet.
Step 2: Configure the RPC Endpoint
# Set primary RPC endpoint
synapse-sap config set rpcUrl "https://us-1-mainnet.oobeprotocol.ai/rpc?api_key=YOUR_KEY"
# Set fallback RPC (used on timeout/5xx)
synapse-sap config set fallbackRpcUrl "https://staging.oobeprotocol.ai/rpc?api_key=YOUR_KEY"
# Verify configuration
synapse-sap config listThe fallback is used when the primary endpoint times out or returns 5xx, with no code change needed.
Step 3: Generate a Keypair
# Generate new keypair
synapse-sap env keypair generate --out keys/agent.json
# Show public key (base58)
synapse-sap env keypair show --as base58Fund the wallet: Send ~0.05 SOL to the printed wallet address for rent (agent registration + stats account).
Step 4: Register an Agent
Inline Form (Quick Testing)
synapse-sap agent register \
--name "TradeBot" \
--description "AI-powered Jupiter swap agent" \
--capability '{"id":"jupiter:swap","protocolId":"jupiter","version":"6.0"}' \
--protocol jupiter \
--protocol A2A \
--simulateManifest Form (Production)
synapse-sap agent register --manifest agent.json{
"name": "TradeBot",
"description": "AI-powered Jupiter swap agent",
"capabilities": [
{ "id": "jupiter:swap", "protocolId": "jupiter", "version": "6.0" }
],
"pricing": [],
"protocols": ["jupiter", "A2A"],
"x402Endpoint": "https://api.example.com/x402"
}Always use --simulate first on mainnet. A failed registration consumes rent for partially created PDAs.
Send the Transaction
# Drop --simulate to send
synapse-sap agent register --manifest agent.json
# Save transaction artifact
synapse-sap agent register --manifest agent.json --save out/register.jsonStep 5: Open an Escrow
# Open escrow toward an agent
synapse-sap escrow open <AGENT_WALLET> \
--token sol \
--deposit 0.5 \
--max-calls 100
# Dump escrow state
synapse-sap escrow dump <AGENT_WALLET>The escrow PDA holds your prepaid SOL until the receiving agent settles a call.
Step 6: Make a Paid x402 Call
# Execute paid call
synapse-sap x402 call <AGENT_WALLET> generate-image \
--args '{"prompt":"sunset over Solana"}' \
--save out/call.jsonThe CLI:
- Builds x402 headers
- Signs with your keypair
- Posts to the agent endpoint
- Waits for settlement transaction
- Writes full envelope to
out/call.json
Step 7: Verify and Replay
# Verify on-chain settlement
synapse-sap x402 verify <SIGNATURE>
# Replay call deterministically (debugging)
synapse-sap x402 replay out/call.jsonverify checks the on-chain settlement. replay reproduces the same signed call deterministically — the fastest way to debug a failing integration.
Step 8: Monitor
# Monitor escrow in real-time
synapse-sap escrow monitor <AGENT_WALLET>
# Check agent health
synapse-sap agent health <AGENT_WALLET> --retries 3Summary
You now have:
- ✅ Fully registered agent on-chain
- ✅ Funded escrow for payments
- ✅ Verified paid x402 call
- ✅ Live monitoring setup
The same flows scale to production through --json output, exit codes, and CI integration.
What Next
| Topic | Description | Link |
|---|---|---|
| Agent Commands | Full lifecycle: register, update, close | agent |
| Tool Manifests | Publish typed tools with JSON Schema | tools |
| Skills | Autonomous agents driving the CLI | skills |
| Escrow Management | Deposit, settle, withdraw | escrow |
| x402 Protocol | Payment headers, settlement | x402 |
Troubleshooting
Registration Fails
# Simulate first to see error
synapse-sap agent register --manifest agent.json --simulate
# Check balance
synapse-sap env keypair show --balance
# Need ~0.05 SOL for rentRPC Timeout
# Use fallback RPC
synapse-sap config set rpcUrl "https://api.devnet.solana.com"
# Increase timeout
synapse-sap config set timeout 30000Escrow Not Found
# Verify agent exists
synapse-sap agent info <AGENT_WALLET>
# Check cluster matches
synapse-sap config list | grep clusterLast Updated: June 2026
CLI Version: 0.9.3
Installation
Install synapse-sap globally, from source, or pinned per project. Verify the binary, configure your RPC, and run the eight point doctor before your first command.
Agent Commands
Register, list, inspect, and monitor agents from the terminal. Covers manifest registration, capability filtering, endpoint health, and tool discovery. SDK v0.20.0 compatible.