Install
openclaw skills install @macd2/open-claw-cashOpenClawCash AgentWalletAPI Skill - Enables AI agents to safely manage crypto wallets on EVM and Solana chains. Includes CLI tools, API docs, and automation scripts for transfers, swaps, balances, and checkout flows. Compatible with MCP servers.
openclaw skills install @macd2/open-claw-cashInteract with OpenclawCash-managed wallets to send native assets and tokens, check balances, execute DEX swaps, manage Polymarket account, orders, and redeem flows via Polygon wallets, and operate YieldWolf Casino accounts via Solana wallets.
This skill may also be referred to as openclawcash.
AGENTWALLETAPI_KEYAGENTWALLETAPI_URL (default: https://openclawcash.com)curljq (for pretty JSON output in CLI)https://openclawcash.comnpx -y @openclawcash/mcp-server
wallets, wallet, policy, balance, tokens) on testnets first.allowWalletCreation, allowWalletImport)--yes) for write actionsconfirm_each_write: ask before every write action.operate_on_my_behalf: after one explicit onboarding approval, execute future write actions without re-asking, as long as the user keeps instructing the agent in the same session.operate_on_my_behalf, the agent should treat the user's later task messages as execution instructions and run the corresponding write commands with --yes.Wallet labels are user- and agent-controlled display text, and any API key on the account can set them.
walletId from GET /api/agent/wallets, not by walletLabel.. _ - ( ) #, starting with a letter or number; not digits-only; no embedded addresses; unique per account (case-insensitive); must not match a wallet ID.walletLabel is case-insensitive and fails closed. Some older accounts have wallets that share a label; selecting one of those by label returns 409 wallet_label_ambiguous with details.matchingWalletIds. Retry with walletId, then ask your human which wallet should get a new unique label and rename it with PATCH /api/agent/wallet (MCP: wallet_rename)..env file:
bash scripts/setup.sh
.env file in this skill folder and replace the placeholder with your real API key:
AGENTWALLETAPI_KEY=occ_your_api_key
If MCP is unavailable, use the included tool script to make API calls directly:
# Read-only (recommended first)
bash scripts/agentwalletapi.sh skill-latest
bash scripts/agentwalletapi.sh wallets
bash scripts/agentwalletapi.sh user-tag-get
bash scripts/agentwalletapi.sh user-tag-set studio --yes
bash scripts/agentwalletapi.sh wallet Q7X2K9P
bash scripts/agentwalletapi.sh wallet "Trading Bot"
bash scripts/agentwalletapi.sh policies
bash scripts/agentwalletapi.sh policy Q7X2K9P
bash scripts/agentwalletapi.sh balance Q7X2K9P
bash scripts/agentwalletapi.sh transactions Q7X2K9P
bash scripts/agentwalletapi.sh tokens mainnet
# Metadata write (no funds move, no --yes needed)
bash scripts/agentwalletapi.sh rename Q7X2K9P "Trading Bot v2"
# Write actions (require explicit --yes)
export WALLET_EXPORT_PASSPHRASE_OPS='your-strong-passphrase'
bash scripts/agentwalletapi.sh create "Ops Wallet" sepolia WALLET_EXPORT_PASSPHRASE_OPS --yes
bash scripts/agentwalletapi.sh import "Treasury Imported" mainnet --yes
bash scripts/agentwalletapi.sh import "Poly Ops" polygon-mainnet --yes
# Automation-safe import: read private key from stdin instead of command args
printf '%s' '<private_key>' | bash scripts/agentwalletapi.sh import "Treasury Imported" mainnet - --yes
bash scripts/agentwalletapi.sh transfer Q7X2K9P 0xRecipient 0.01 --yes
bash scripts/agentwalletapi.sh transfer Q7X2K9P 0xRecipient 100 USDC --yes
bash scripts/agentwalletapi.sh quote mainnet WETH USDC 10000000000000000
bash scripts/agentwalletapi.sh quote solana-mainnet SOL USDC 10000000 solana
bash scripts/agentwalletapi.sh swap Q7X2K9P WETH USDC 10000000000000000 0.5 --yes
# Checkout escrow lifecycle
bash scripts/agentwalletapi.sh checkout-payreq-create Q7X2K9P 30000000 --yes
bash scripts/agentwalletapi.sh checkout-payreq-get pr_a1b2c3
bash scripts/agentwalletapi.sh checkout-escrow-get es_d4e5f6
bash scripts/agentwalletapi.sh checkout-quick-pay es_d4e5f6 Q7X2K9P --yes
bash scripts/agentwalletapi.sh checkout-swap-and-pay-quote es_d4e5f6 Q7X2K9P
bash scripts/agentwalletapi.sh checkout-swap-and-pay-confirm es_d4e5f6 Q7X2K9P 1 --yes
bash scripts/agentwalletapi.sh checkout-release es_d4e5f6 --yes
bash scripts/agentwalletapi.sh checkout-refund es_d4e5f6 --yes
bash scripts/agentwalletapi.sh checkout-cancel es_d4e5f6 --yes
bash scripts/agentwalletapi.sh checkout-webhooks-list
# Polymarket setup is user-managed in dashboard Venues settings
# Direct setup page: https://openclawcash.com/venues/polymarket
bash scripts/agentwalletapi.sh polymarket-market Q7X2K9P 123456 BUY 25 FAK 0.65 --yes
bash scripts/agentwalletapi.sh polymarket-resolve https://polymarket.com/market/market-slug No
bash scripts/agentwalletapi.sh polymarket-account Q7X2K9P
bash scripts/agentwalletapi.sh polymarket-orders Q7X2K9P OPEN 50
bash scripts/agentwalletapi.sh polymarket-activity Q7X2K9P 50
bash scripts/agentwalletapi.sh polymarket-positions Q7X2K9P 100
bash scripts/agentwalletapi.sh polymarket-redeem Q7X2K9P all 100 --yes
bash scripts/agentwalletapi.sh polymarket-redeem Q7X2K9P 1234567890 100 --yes
bash scripts/agentwalletapi.sh polymarket-cancel Q7X2K9P order_id_here --yes
quote.amountIn, swap.amountIn, approve.amount, and transfer valueBaseUnits must be base-units integer strings (digits only).0.001), or validation will fail immediately.0.001 ETH -> 1000000000000000 wei1 USDC (6 decimals) -> 1000000amountDisplay when you want human-readable units and let the API convert.amount and value are still accepted for compatibility.allowWalletImport in dashboard settings.--yes for automation, or interactive YES prompt).- and pipe input via stdin.https://openclawcash.com
If requests fail because of host/URL issues, use this recovery flow:
agentwalletapi/.env and verify AGENTWALLETAPI_KEY is set and has no extra spaces..env file:
AGENTWALLETAPI_URL=https://openclawcash.com
AGENTWALLETAPI_URL is only ever allowed to be https://openclawcash.com or an
https://<subdomain>.openclawcash.com host — the CLI script refuses to run and exits
with an error for any other value, so X-Agent-Key can never be sent to an untrusted
host even if this env var is tampered with.bash scripts/agentwalletapi.sh wallets
The API key is loaded from the .env file in this skill folder. For direct HTTP calls, include it as a header:
X-Agent-Key: occ_your_api_key
Content-Type: application/json
X-Agent-Key is sent only to https://openclawcash.com (or an https://<subdomain>.openclawcash.com
host). The bundled scripts/agentwalletapi.sh validates AGENTWALLETAPI_URL against this allowlist
before every request and refuses to run otherwise, so the key cannot be redirected to another host
by an env var override.
/api/agent/*
X-Agent-KeyGET /api/public/agentwalletapi/skill/latest
GET /api/public/agentwalletapi/skill/latest - Fetch latest skill version, GitHub repo URL, and install instructions (no auth)
1a. GET /api/public/tokenlist - Token Lists v1 document covering every supported chain. Default ?extended=true merges curated + Uniswap (EVM) + Jupiter (Solana). Pass ?extended=false for curated only, ?chainId=<num> to scope to one chain. No auth.GET /api/agent/wallets - Discover available wallets (id, label, address, network, chain). Optional ?includeBalances=true adds native balance + nativeSymbolGET /api/agent/wallet?walletId=... or ?walletLabel=... or ?walletAddress=... - Fetch one wallet with native/token balances
3b. PATCH /api/agent/wallet - Rename a wallet: body { "walletId" | "walletLabel" | "walletAddress", "label": "<new label>" }. Metadata only (no funds move); label rules: see Wallet Labels below; rate limited separately from create/import. MCP tool: wallet_rename
3a. GET /api/agent/policies - List governance policies for every wallet accessible to this API key. GET /api/agent/policy?walletId=... (or walletLabel/walletAddress) - Same, scoped to one wallet. Call before suggesting or executing a transfer/swap so the request stays inside configured limits.POST /api/agent/wallets/create - Create a new wallet under API-key policy controlsPOST /api/agent/wallets/import - Import a mainnet, polygon-mainnet, base-mainnet, or solana-mainnet wallet under API-key policy controlsGET /api/agent/transactions?walletId=... (or walletLabel/walletAddress) - Read merged wallet transaction history (on-chain + app-recorded). EVM wallets accept optional &network=<id> to scope to a single EVM chain or &network=all to merge across the bucket. Each row carries data.network.GET /api/agent/supported-tokens?network=... or ?chain=evm|solana - Get recommended common, well-known token list + guidance (requires X-Agent-Key)POST /api/agent/token-balance - Check wallet balances (native + token balances; specific token by symbol/address supported)POST /api/agent/quote - Get a swap quote before execution on Uniswap (EVM) or Jupiter (Solana mainnet). amountIn is base-units integer string.POST /api/agent/swap - Execute token swap on Uniswap (EVM) or Jupiter (Solana mainnet). amountIn is base-units integer string. EVM wallets accept optional network (e.g. "base-mainnet") to swap on a non-default EVM chain.POST /api/agent/transfer - Send native coin or token. Optional chain guard. EVM wallets accept optional network (e.g. "base-mainnet") to transfer on a non-default EVM chain. Omit network to use the wallet's default. Do not use this for checkout escrow funding.
10a. Cross-chain bridge (LiFi-routed; aggregator picks the underlying bridge such as Across, Stargate, etc., and announces it as bridgeName in the response):POST /api/agent/bridge/quote - Quote a transfer between EVM chains (or EVM<->Solana for quote; Solana source-side execute is gated to a follow-up). fromNetwork, fromToken, toNetwork, toToken, amountIn (base units). Returns quoteId, provider, bridgeName, amountOut, amountOutMin, fee details, and expiresAt (~60s TTL).POST /api/agent/bridge/execute - Execute a previously quoted bridge. Requires Idempotency-Key header. Returns sourceTxHash, bridgeTxId, and platform fee tx hash.GET /api/agent/bridge/status?bridgeTxId=... - Look up status. States: submitted, source_confirmed, destination_confirmed, completed, failed.GET /api/agent/user-tag and PUT /api/agent/user-tag - Read/set the global checkout user tag (set is one-time / immutable once configured; 3-8 lowercase characters: a-z, 0-9, ., _, -)checkout_fund (tries quick-pay, falls back to swap-and-pay when needed)POST /api/agent/checkout/payreq - Create pay request + escrowGET /api/agent/checkout/payreq/:id - Read pay requestPOST /api/agent/checkout/escrows/:id/funding-confirm - Confirm funding by tx hashPOST /api/agent/checkout/escrows/:id/quick-pay - Direct buyer fundingPOST /api/agent/checkout/escrows/:id/swap-and-pay - Quote/execute swap fundingGET /api/agent/checkout/escrows/:id - Read escrow statePOST /api/agent/checkout/escrows/:id/accept - Accept as buyerPOST /api/agent/checkout/escrows/:id/proof - Submit proofPOST /api/agent/checkout/escrows/:id/dispute - Open disputePOST /api/agent/checkout/escrows/:id/release - Release fundsPOST /api/agent/checkout/escrows/:id/refund - Refund fundsPOST /api/agent/checkout/escrows/:id/cancel - Cancel escrowGET|POST /api/agent/checkout/webhooks and PATCH|DELETE /api/agent/checkout/webhooks/:id - Manage webhooksCheckout timing fields for POST /api/agent/checkout/payreq:
expiresInSeconds: funding deadline before request expires.autoReleaseSeconds: when funded escrow can auto-release if no dispute exists.disputeWindowSeconds: how long dispute can be opened after auto-release point.3600 seconds, and disputeWindowSeconds <= autoReleaseSeconds.GET /api/agent/venues/polymarket/market/resolve resolves marketUrl/slug + human-readable outcome to the exact tokenId needed for order toolspolymarket_market_resolve calls the same agent endpointPOST /api/agent/venues/polymarket/orders/limit - Place BUY/SELL limit ordersPOST /api/agent/venues/polymarket/orders/market - Place BUY/SELL market ordersGET /api/agent/venues/polymarket/account - Read account summaryGET /api/agent/venues/polymarket/orders - List open ordersPOST /api/agent/venues/polymarket/orders/cancel - Cancel an orderGET /api/agent/venues/polymarket/redeemable - List currently redeemable positions and tokenId candidatesPOST /api/agent/venues/polymarket/redeem - Redeem one position by tokenId or all redeemable positions; signing path is auto-selected by wallet signatureType (0 = direct on-chain EOA, 1 / 2 = gasless via relayer); pass optional signatureType to defensively assert; response includes signingPath. All-mode may require multiple calls until hasMoreRedeemable=falsePOST /api/agent/venues/polymarket/unlink - Clear stored Polymarket integration config for a walletGET /api/agent/venues/polymarket/activity - List trade activityGET /api/agent/venues/polymarket/positions - List open positions (open-market filtered, includes PnL fields)POST /api/agent/venues/yieldwolf-casino/link { walletId, lane: "real" | "test" } - Bind a Solana wallet to a casino account. Response carries proxy_base and a runtime instructions payload with per-flow guidance (fund, balance, catalog, play_standard, play_kuhn, history, withdraw). The raw casino key is intentionally not returned to the agent. The linked wallet is the only allowed withdrawal destination.POST /api/agent/venues/yieldwolf-casino/unlink { walletId } - Clear the binding. To switch lanes, unlink and re-link.GET /api/agent/venues/yieldwolf-casino/proxy/<upstream_path>?walletId=... - Read passthrough to YieldWolf's gateway. Common reads: agents/me/balance, transactions/history, games, games/info.POST /api/agent/venues/yieldwolf-casino/proxy/<upstream_path>?walletId=... - Write passthrough. Common writes: games/play (game_type one of dice, wheel, slots, crash), transactions/withdraw, arena/kuhn/* for PvP poker. Pass X-Idempotency-Key so retries do not double-submit.yieldwolf_casino_link, yieldwolf_casino_unlink, and yieldwolf_casino_call (generic dispatcher for the proxy).txHash / orderId values to confirm execution and lifecycle statusUse this pattern for write actions:
confirm_each_write:
--yesoperate_on_my_behalf:
--yes once the needed details are clearRecommended onboarding wording:
confirm_each_write or operate_on_my_behalf."Example:
operate_on_my_behalfbash scripts/agentwalletapi.sh transfer Q7X2K9P 0xabc... 100 USDC evm --yes
| Endpoint | Method | Auth | Purpose |
|---|---|---|---|
/api/public/agentwalletapi/skill/latest | GET | No | Get latest skill version + GitHub repo URL + install instructions |
/api/public/tokenlist | GET | No | Token Lists v1 document. ?extended=true (default) merges curated + Uniswap + Jupiter. ?chainId=<num> scopes to one chain |
/api/agent/wallets | GET | Yes | List wallets (discovery; optional includeBalances=true for native balances) |
/api/agent/wallet | GET | Yes | Get one wallet detail with native/token balances |
/api/agent/wallet | PATCH | Yes | Rename a wallet (update its label) |
/api/agent/policies | GET | Yes | List governance policies for every wallet accessible to this API key |
/api/agent/policy | GET | Yes | Get governance policies for one wallet |
/api/agent/wallets/create | POST | Yes | Create a new API-key-managed wallet |
/api/agent/wallets/import | POST | Yes | Import a mainnet/polygon-mainnet/base-mainnet/solana-mainnet wallet via API key |
/api/agent/transactions | GET | Yes | List per-wallet transaction history |
/api/agent/transfer | POST | Yes | Send native/token transfers (EVM + Solana). Not the checkout escrow funding path. |
/api/agent/swap | POST | Yes | Execute DEX swap (Uniswap on EVM, Jupiter on Solana mainnet) |
/api/agent/quote | POST | Yes | Get swap quotes (Uniswap on EVM, Jupiter on Solana mainnet) |
/api/agent/token-balance | POST | Yes | Check balances |
/api/agent/supported-tokens | GET | Yes | List recommended common, well-known tokens per network |
/api/agent/user-tag | GET | Yes | Read the global checkout user tag for the API key owner |
/api/agent/user-tag | PUT | Yes | Set the global checkout user tag once (immutable after set; 3-8 lowercase chars: a-z, 0-9, ., _, -) |
/api/agent/approve | POST | Yes | Approve spender for ERC-20 token (EVM only) |
/api/agent/bridge/quote | POST | Yes | Quote cross-chain bridge transfer (LiFi-routed). Returns quoteId, provider, bridgeName, fee breakdown, expiresAt (~60s) |
/api/agent/bridge/execute | POST | Yes | Execute previously quoted bridge. Requires Idempotency-Key header |
/api/agent/bridge/status | GET | Yes | Look up bridge tx status by bridgeTxId |
/api/agent/checkout/payreq | POST | Yes | Create checkout pay request + escrow |
/api/agent/checkout/payreq/:id | GET | Yes | Read checkout pay request |
/api/agent/checkout/escrows/:id/funding-confirm | POST | Yes | Confirm escrow funding tx |
/api/agent/checkout/escrows/:id/quick-pay | POST | Yes | Directly fund escrow from buyer wallet |
/api/agent/checkout/escrows/:id/swap-and-pay | POST | Yes | Quote/execute swap + fund escrow |
/api/agent/checkout/escrows/:id | GET | Yes | Read escrow lifecycle details |
/api/agent/checkout/escrows/:id/accept | POST | Yes | Accept escrow as buyer |
/api/agent/checkout/escrows/:id/proof | POST | Yes | Submit seller proof |
/api/agent/checkout/escrows/:id/dispute | POST | Yes | Open escrow dispute |
/api/agent/checkout/escrows/:id/release | POST | Yes | Release escrow funds |
/api/agent/checkout/escrows/:id/refund | POST | Yes | Refund escrow funds |
/api/agent/checkout/escrows/:id/cancel | POST | Yes | Cancel escrow |
/api/agent/checkout/webhooks | GET | Yes | List checkout webhooks |
/api/agent/checkout/webhooks | POST | Yes | Create checkout webhook |
/api/agent/checkout/webhooks/:id | PATCH | Yes | Update checkout webhook |
/api/agent/checkout/webhooks/:id | DELETE | Yes | Delete checkout webhook |
/api/agent/venues/polymarket/market/resolve | GET | Yes | Resolve market URL/slug + outcome to Polymarket tokenId |
/api/agent/venues/polymarket/orders/limit | POST | Yes | Place Polymarket limit order |
/api/agent/venues/polymarket/orders/market | POST | Yes | Place Polymarket market order |
/api/agent/venues/polymarket/account | GET | Yes | Read Polymarket account summary |
/api/agent/venues/polymarket/orders | GET | Yes | List Polymarket open orders |
/api/agent/venues/polymarket/orders/cancel | POST | Yes | Cancel Polymarket order |
/api/agent/venues/polymarket/redeemable | GET | Yes | List currently redeemable Polymarket positions (tokenId candidates) |
/api/agent/venues/polymarket/redeem | POST | Yes | Redeem one or all redeemable Polymarket positions via gasless relay (chunked all-mode) |
/api/agent/venues/polymarket/unlink | POST | Yes | Clear Polymarket integration for wallet |
/api/agent/venues/polymarket/activity | GET | Yes | List Polymarket trade activity |
/api/agent/venues/polymarket/positions | GET | Yes | List Polymarket open positions (open-market filtered with PnL fields) |
/api/agent/venues/yieldwolf-casino/link | POST | Yes | Bind a Solana wallet to a YieldWolf Casino account. Returns proxy_base + runtime instructions. No raw casino key returned to the agent |
/api/agent/venues/yieldwolf-casino/unlink | POST | Yes | Clear the YieldWolf Casino binding for a wallet |
/api/agent/venues/yieldwolf-casino/proxy/<upstream> | GET | Yes | Read passthrough to YieldWolf's gateway (e.g. agents/me/balance, transactions/history) |
/api/agent/venues/yieldwolf-casino/proxy/<upstream> | POST | Yes | Write passthrough to YieldWolf's gateway (e.g. games/play, transactions/withdraw); supports X-Idempotency-Key |
Agent-side wallet lifecycle endpoints:
POST /api/agent/wallets/createPOST /api/agent/wallets/importBehavior notes:
X-Agent-Key.allowWalletCreation for createallowWalletImport for import429 with Retry-After.mainnet, polygon-mainnet, base-mainnet, and solana-mainnet.exportPassphrase (minimum 12 characters)exportPassphraseStorageTypeexportPassphraseStorageRefconfirmExportPassphraseSaved: truePOST /api/agent/wallets/create with:
exportPassphraseStorageTypeexportPassphraseStorageRefconfirmExportPassphraseSaved: trueEVM wallets are buckets. The same wallet address holds assets across mainnet, polygon-mainnet, base-mainnet, and sepolia. The network field on a wallet is its default/home chain, not a hard binding.
GET /api/agent/wallets?includeBalances=true returns native balance on the wallet's home chain. The dashboard separately shows per-chain ERC-20 indicators across all EVM chains.POST /api/agent/transfer, /swap, and /approve accept an optional network field on EVM wallets. Set it to operate on a non-default EVM chain. Omit it to use the wallet's home network.
polygon-mainnet can transfer USDC on Base by passing { "network": "base-mainnet", "token": "USDC", ... }.network must be a known EVM network for EVM wallets. For Solana wallets, network must be omitted or match the wallet's cluster (Solana keypairs are cluster-bound).400 network_mismatch with the supported list.resolveToken("USDC", "base-mainnet") returns the canonical Base USDC address, distinct from the Polygon or mainnet USDC entries.network behave exactly as before (use the wallet's home).polygon-mainnet under the hood, but any EVM-home wallet (mainnet, polygon-mainnet, base-mainnet) can be linked to Polymarket. The wallet's home network does not gate eligibility.tokenId first via GET /api/agent/venues/polymarket/market/resolve (or MCP tool polymarket_market_resolve).POST /api/agent/venues/polymarket/orders/limit with tokenId, side, price, sizePOST /api/agent/venues/polymarket/orders/market with tokenId, side, amount, optional orderType and worstPrice{ "marketUrl": "https://polymarket.com/market/<slug>", "outcome": "No" }outcome.tokenId (use this as tokenId in order tools)POST /api/agent/venues/polymarket/orders/market with side: "SELL" and amount as shares.SELL only when the user explicitly asks for a limit/target price.amount semantics follow Polymarket CLOB behavior: BUY uses notional/collateral amount; SELL uses share amount.GET /api/agent/venues/polymarket/accountGET /api/agent/venues/polymarket/ordersPOST /api/agent/venues/polymarket/orders/cancel with orderIdGET /api/agent/venues/polymarket/redeemable to fetch current redeemable tokenIdsPOST /api/agent/venues/polymarket/redeem with optional tokenId (omit tokenId to redeem all)POST /api/agent/venues/polymarket/unlink to clear stored venue config for a walletGET /api/agent/venues/polymarket/activityGET /api/agent/venues/polymarket/positionscashPnl, percentPnl, and currentValue (with computed fallback values when upstream fields are missing).Send native coin (default when no token specified):
{ "walletId": "Q7X2K9P", "to": "0xRecipient...", "amountDisplay": "0.01" }
Send 100 USDC by symbol:
{ "walletLabel": "Trading Bot", "to": "0xRecipient...", "token": "USDC", "amountDisplay": "100" }
Send arbitrary ERC-20 by contract address:
{ "walletId": "Q7X2K9P", "to": "0xRecipient...", "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "amountDisplay": "100" }
Send SOL by symbol:
{ "walletId": "Q7X2K9P", "to": "SolanaRecipientWalletAddress...", "token": "SOL", "amountDisplay": "0.01" }
Send SOL with memo (Solana only):
{ "walletId": "Q7X2K9P", "to": "SolanaRecipientWalletAddress...", "token": "SOL", "amountDisplay": "0.01", "memo": "payment verification note" }
Use amountDisplay for human-readable values (e.g., "100" = 100 USDC). Use valueBaseUnits for base units (smallest denomination on each chain).
Legacy transfer aliases amount and value remain available for compatibility.
Use optional chain: "evm" | "solana" in agent payloads for explicit chain routing and validation.
memo is supported only for Solana transfers and must pass safety validation (max 5 words, max 256 UTF-8 bytes, no control/invisible characters).
Native transfers (EVM + Solana) enforce a minimum transferable amount preflight that accounts for platform fee and network fee; Solana may also require a larger first funding transfer for a brand-new recipient address.
For native SOL transfers, the API may auto-adjust requested value to fit platform fee + network fee.
Transfer responses include requestedValueBaseUnits, adjustedValueBaseUnits, requestedAmountDisplay, and adjustedAmountDisplay (legacy aliases also included).
GET /api/agent/supported-tokens returns recommended common, well-known tokens plus guidance fields.ETH on EVM and SOL on Solana (with chain-specific native token IDs in balance payloads).Every error response carries a machine-readable envelope:
{
"code": "no_route_or_liquidity",
"message": "No viable DEX route for this pair/amount right now.",
"what_happened": "The quote engine could not find a usable route or sufficient liquidity.",
"what_to_do": "Retry shortly, or adjust the pair/amount and try again.",
"retryable": true,
"details": { "reason": "route_or_liquidity" }
}
Branch on retryable, not on the HTTP status. retryable: true means the same
request may succeed later and is safe to repeat after a short backoff.
retryable: false means the request must change before retrying — repeating it
unchanged will fail the same way.
details contains fixed, enumerated values only. Upstream RPC/DEX error text is
never returned; it is recorded server-side for support to inspect.
chain_mismatch: requested chain does not match the selected walletamount_below_min_transfer: requested native transfer is below minimum transferable amount after fee/network preflightinsufficient_balance: requested transfer + fees exceed available balancepolicy_violation: request blocked by a wallet governance policy (see Policy Constraints below)wallet_label_ambiguous: walletLabel matches more than one wallet; retry with walletId from details.matchingWalletIds and rename one walletvalidation_error / invalid_wallet_label, 409 wallet_label_taken: wallet label rejected on create, import, or rename (see Wallet Labels)retryable: true.A pair with no liquidity is a temporary condition, not a malformed request.
It returns 503 with retryable: true; keep the same parameters and retry after
a short delay rather than discarding the pair.
invalid_quote_request (retryable: false): unknown token, invalid address, tokenIn equal to tokenOut, a non-positive or malformed amountIn, or an amount below the router's minimum. Change the request before retrying.no_route_or_liquidity (retryable: true): no DEX route, insufficient pool liquidity, or the output amount would fall below the pool's minimum. Retry shortly, or adjust the amount.upstream_rpc_unavailable (retryable: true): an upstream RPC or DEX API timed out, refused the connection, or rate-limited us. Retry after a short backoff.quote_failed (retryable: true): unclassified quote failure. Retry once; if it persists, try a different pair or amount.invalid_swap_request (retryable: false) on POST /api/agent/swap: the swap parameters themselves are unusable.swap_failed (retryable: true) on POST /api/agent/swap: temporary DEX execution or routing issue, including a pair that cannot currently be routed. Request a fresh quote, then retry with a lower amount or higher slippage.Call GET /api/agent/policies (all wallets) or GET /api/agent/policy?walletId=... (one wallet) to read active policies before suggesting or executing a write action. Policy type values:
Violations return HTTP 403 with code: "policy_violation" and a policyType field naming which policy blocked the request, plus an explanation message.
Content-Type: application/json400 amount_below_min_transfer when requested amount is too small after platform fee or below chain transferability minimum (for example, first funding a new Solana address)400 insufficient_balanceamountDisplay for simplicity, use valueBaseUnits for precise base-unit controlwallets, then wallet (or token-balance), then quote, then swap.insufficient_token_balance, reduce amount or change token..env file in this skill folder stores your API key — never commit it to version controlagentwalletapi/
├── SKILL.md # This file
├── .env # Your API key (created by setup.sh)
├── scripts/
│ ├── setup.sh # Creates .env with API key placeholder
│ └── agentwalletapi.sh # CLI tool for making API calls
└── references/
└── api-endpoints.md # Full endpoint documentation
See references/api-endpoints.md for full endpoint details with request/response examples.