AI agents are becoming useful, but most of them still cannot safely move money onchain. OpenclawCash gives your agent a wallet, policy controls, and API endpoints for transfers and swaps across EVM and Solana chains.
In this post, you'll see the basic flow: authenticate with an agent key, inspect a wallet, and make a first onchain action with OpenclawCash.
Why this matters
Most agent demos stop at "the model can suggest an action." That is not enough when the action is moving assets. OpenclawCash is built for the part that matters in production: letting an AI agent hold a wallet and act under policy controls instead of raw key access.
That makes it useful for agents that need to:
- Send payments.
- Swap tokens.
- Run autonomous workflows with guardrails.
- Work across EVM chains and Solana in a single setup.
What you'll build
By the end of this tutorial, your agent will be able to:
- Authenticate with an OpenclawCash agent key.
- List wallets.
- Read wallet details and balances.
- Send a transfer.
- Run a token swap.
Prerequisites
You need:
- OpenClawCash Agents
- An agent key
- Python or Node.js to make API requests.
Bonus
Use Code PAYME26 on signup to get 10 days free use.
Step 1: Authenticate your agent
Prompt:
Connect to my OpenclawCash wallet.
Example output:
✓ Connected to OpenclawCash agent wallet
Ready for wallet actions.
OpenclawCash uses an agent key passed in the X-Agent-Key header. That header is the most important piece of the setup because it lets your agent call the wallet API without exposing private keys in your application logic.
Step 2: List available wallets
Prompt:
Show me my available wallets.
Example output:
You have 2 wallets available:
- Main: 0.42 ETH, 128 USDC (Ethereum)
- Test: 0.01 SOL (Solana)
If your agent has access to more than one wallet, this is where you can choose the right one for the task. One wallet might be used for testing, while another is reserved for live transfers.
Step 3: Read wallet balance
Prompt:
What's my wallet balance?
Example output:
Main wallet balance:
- 0.42 ETH ($1,250)
- 128.45 USDC ($128)
- 0.01 SOL ($1.50)
This is the point where your agent can make a simple decision:
- If balance is too low, stop.
- If balance is sufficient, continue.
- If the asset is wrong, swap first.
That sort of logic is exactly why a wallet layer for agents matters.
Step 4: Send a transfer
Prompt:
Send 0.01 ETH to 0x1234567890abcdef.
Example output:
✓ Transfer sent successfully
Tx: 0xabc123... | 0.01 ETH | Confirmed on Ethereum
Gas used: 21,000 | Status: Success
This example shows the basic idea: the agent chooses a wallet, a destination, a token, and an amount. OpenclawCash handles the wallet infrastructure so the agent can execute the transfer in a controlled way.
For a real production setup, you should add policy checks before the transfer runs. For example:
- Maximum amount per transfer.
- Allowed destination list.
- Network restrictions.
- Manual approval for large amounts.
Step 5: Swap tokens
Prompt:
Swap 0.05 ETH to USDC.
Example output:
✓ Swap completed
0.05 ETH → 145.20 USDC
Tx: 0xdef456... | Status: Confirmed
Agents often need to change assets before acting. OpenclawCash supports swaps as part of the same wallet workflow. That means your agent can do more than just move funds. It can prepare the right asset for the next step in an automated workflow.
A simple agent flow
Here is the simplest real-world flow for an AI agent:
Prompt:
Send 25 USDC to @user123 wallet.
Example output:
Checking balance... ✓ 128 USDC available
Sending payment... ✓ 25 USDC transferred
Tx: 0x789... | Status: Confirmed
That pattern is enough for many practical uses:
- Paying a service onchain.
- Funding a worker wallet.
- Rebalancing small treasury flows.
- Executing a limited DeFi action under policy.
Example use case
Imagine a support agent that receives a request to reimburse a user in USDC.
Prompt:
Reimburse @user456 25 USDC.
Example output:
✓ Balance check passed (128 USDC available)
✓ Payment sent: 25 USDC to @user456 wallet
Tx: 0x789... | Status: Confirmed ✓
The agent can then check the wallet balance, swap a small amount of ETH to USDC if needed, transfer the final amount to the recipient, and record the transaction for review.
That is much more useful than a chatbot that can only suggest what should happen.
Production advice
If you plan to use OpenclawCash in a live product, keep the agent restricted. A good rule is to let the model decide what should happen, while your policy layer decides whether it is allowed.
A solid first policy set would include:
- Spending limits.
- Whitelisted addresses.
- Per-network restrictions.
- Manual review for large transactions.
That keeps the system practical without giving the model unrestricted financial control.
Closing thoughts
OpenclawCash makes it straightforward to give an AI agent a wallet, connect it to real onchain actions, and add policy around those actions. If you want your agent to do more than talk about money, this is the missing layer.













