This guide walks you through setting up an OmniClaw agent for both buying and selling.
OmniClaw is the Economic Execution and Control Layer for Agentic Systems. In that system:
- the owner runs the Financial Policy Engine
- the agent uses
omniclaw-clias the zero-trust execution layer - buyers pay with
omniclaw-cli pay - sellers earn with
omniclaw-cli serve
- Python 3.10+
- Circle API key
- USDC on the target network (testnet or mainnet)
- A private key for your agent
Create a policy.json file that defines your agent:
{
"version": "2.0",
"tokens": {
"my-agent-token": {
"wallet_alias": "primary",
"active": true,
"label": "My Agent"
}
},
"wallets": {
"primary": {
"name": "Primary Wallet",
"limits": {
"daily_max": "100.00",
"per_tx_max": "50.00"
},
"recipients": {
"mode": "allow_all"
}
}
}
}On startup, the server will auto-generate and persist wallet_id and address
inside each wallet entry if they are missing.
You can copy the default from examples/default-policy.json and edit it.
The server validates policy.json on startup and will refuse to boot if it is invalid.
# Required
export OMNICLAW_PRIVATE_KEY="0x..." # Your agent's private key
export OMNICLAW_AGENT_TOKEN="my-agent-token" # Must match policy.json token key
export OMNICLAW_AGENT_POLICY_PATH="/path/to/policy.json"
export CIRCLE_API_KEY="your-circle-api-key"
# Network (testnet or mainnet)
export OMNICLAW_NETWORK="ETH-SEPOLIA" # or ETH-MAINNET for production
# Set production for mainnet usage
export OMNICLAW_ENV="production" # optional - for mainnet
# RPC for on-chain operations
export OMNICLAW_RPC_URL="https://..."
export OMNICLAW_OWNER_TOKEN="your-owner-token" # Required for approvals
export OMNICLAW_POLICY_RELOAD_INTERVAL="5" # Hot reload interval (seconds)uvicorn omniclaw.agent.server:app --port 8080The Financial Policy Engine runs at http://localhost:8080.
For agents, use environment variables (no interactive setup required):
export OMNICLAW_SERVER_URL="http://localhost:8080"
export OMNICLAW_TOKEN="my-agent-token"Optional: persist config locally for dev workflows:
omniclaw-cli configure --server-url http://localhost:8080 --token my-agent-token --wallet primaryCLI output is agent-first (JSON, no banner). For human-friendly output set:
export OMNICLAW_CLI_HUMAN=1omniclaw-cli addressomniclaw-cli balance
# Or detailed view
omniclaw-cli balance_detailomniclaw-cli deposit --amount 10This moves USDC from your EOA to the Circle Gateway contract.
omniclaw-cli withdraw --amount 5This moves USDC from Gateway to your Circle Developer Wallet.
If a policy requires confirmation, /pay will return:
requires_confirmation: trueconfirmation_id: <id>
Approve with the owner token:
omniclaw-cli configure --owner-token YOUR_OWNER_TOKEN
omniclaw-cli confirmations approve --id <confirmation_id>Then retry the payment with the same confirmation_id in metadata:
{
"recipient": "0xRecipient",
"amount": "50.00",
"metadata": {
"confirmation_id": "<confirmation_id>"
}
}To receive payments, expose a service behind x402 payment:
omniclaw-cli serve \
--price 0.01 \
--endpoint /api/data \
--exec "python my_service.py" \
--port 8000This opens http://localhost:8000/api/data that requires USDC payment to access.
This is the seller side of the same OmniClaw economy. The same CLI powers both sides:
- buyer:
omniclaw-cli pay - seller:
omniclaw-cli serve
| Command | Purpose |
|---|---|
omniclaw-cli address |
Get your wallet address |
omniclaw-cli balance |
Check balance |
omniclaw-cli deposit --amount X |
Deposit to Gateway |
omniclaw-cli withdraw --amount X |
Withdraw to Circle wallet |
omniclaw-cli withdraw_trustless --amount X |
Trustless withdraw (~7-day delay) |
omniclaw-cli withdraw_trustless_complete |
Complete trustless withdraw after delay |
omniclaw-cli pay --recipient 0x... --amount X |
Pay another agent |
omniclaw-cli serve --price X --endpoint /api --exec "cmd" |
Start payment gate |
To switch from testnet to mainnet:
export OMNICLAW_NETWORK="ETH-MAINNET"
export OMNICLAW_ENV="production"Everything automatically switches to mainnet URLs.
Wait a few seconds and retry. The agent is setting up.
Check that OMNICLAW_AGENT_TOKEN matches a key in your policy.json's tokens section.
Make sure you've deposited USDC to the Gateway first:
omniclaw-cli deposit --amount 10