Bankr
by @oguhfailed
AI-powered crypto trading agent and LLM gateway via natural language. Use when the user wants to trade crypto, check portfolio balances, view token prices, t...
clawhub install bankr-2π About This Skill
name: bankr description: AI-powered crypto trading agent and LLM gateway via natural language. Use when the user wants to trade crypto, check portfolio balances, view token prices, transfer crypto, manage NFTs, use leverage, bet on Polymarket, deploy tokens, set up automated trading, sign and submit raw transactions, or access LLM models through the Bankr LLM gateway funded by your Bankr wallet. Supports Base, Ethereum, Polygon, Solana, and Unichain. metadata: { "clawdbot": { "emoji": "πΊ", "homepage": "https://bankr.bot", "requires": { "bins": ["bankr"] }, }, }
Bankr
Execute crypto trading and DeFi operations using natural language. Two integration options:
1. Bankr CLI (recommended) β Install @bankr/cli for a batteries-included terminal experience
2. REST API β Call https://api.bankr.bot directly from any language or tool
Both use the same API key and the same async job workflow under the hood.
Getting an API Key
Before using either option, you need a Bankr API key. Two ways to get one:
Option A: Headless email login (recommended for agents)
Two-step flow β send OTP, then verify and complete setup. See "First-Time Setup" below for the full guided flow with user preference prompts.
# Step 1 β send OTP to email
bankr login email user@example.comStep 2 β verify OTP and generate API key (options based on user preferences)
bankr login email user@example.com --code 123456 --accept-terms --key-name "My Agent" --read-write
This creates a wallet, accepts terms, and generates an API key β no browser needed. Before running step 2, ask the user whether they need read-only or read-write access, LLM gateway, and their preferred key name.
Option B: Bankr Terminal
1. Visit bankr.bot/api
2. Sign up / Sign in β Enter your email and the one-time passcode (OTP) sent to it
3. Generate an API key β Create a key with Agent API access enabled (the key starts with bk_...)
Both options automatically provision EVM wallets (Base, Ethereum, Polygon, Unichain) and a Solana wallet β no manual wallet setup needed.
Option 1: Bankr CLI (Recommended)
Install
bun install -g @bankr/cli
Or with npm:
npm install -g @bankr/cli
First-Time Setup
#### Headless email login (recommended for agents)
When the user asks to log in with an email, walk them through this flow:
Step 1 β Send verification code
bankr login email
Step 2 β Ask the user for the OTP code they received via email.
Step 3 β Before completing login, ask the user about their preferences:
1. Accept Terms of Service β Present the Terms of Service link and confirm the user agrees. Required for new users β do not pass --accept-terms unless the user has explicitly confirmed.
2. Read-only or read-write API key?
- Read-only (default) β portfolio, balances, prices, research only
- Read-write (--read-write) β enables swaps, transfers, orders, token launches, leverage, Polymarket bets
3. Enable LLM gateway access? (--llm) β multi-model API at llm.bankr.bot (currently limited to beta testers). Skip if user doesn't need it.
4. Key name? (--key-name) β a display name for the API key (e.g. "My Agent", "Trading Bot")
Step 4 β Construct and run the step 2 command with the user's choices:
# Example with all options
bankr login email --code --accept-terms --key-name "My Agent" --read-write --llmExample read-only, no LLM
bankr login email --code --accept-terms --key-name "Research Bot"
#### Login options reference
| Option | Description |
|--------|-------------|
| --code | OTP code received via email (step 2) |
| --accept-terms | Accept Terms of Service without prompting (required for new users) |
| --key-name | Display name for the API key (e.g. "My Agent"). Prompted if omitted |
| --read-write | Enable write operations: swaps, transfers, orders, token launches, leverage, Polymarket bets. Without this flag, the key is read-only (portfolio, balances, prices, research only) |
| --llm | Enable LLM gateway access (multi-model API at llm.bankr.bot). Currently limited to beta testers |
Any option not provided on the command line will be prompted interactively by the CLI, so you can mix headless and interactive as needed.
#### Login with existing API key
If the user already has an API key:
bankr login --api-key bk_YOUR_KEY_HERE
If they need to create one at the Bankr Terminal:
1. Run bankr login --url β prints the terminal URL
2. Present the URL to the user, ask them to generate a bk_... key
3. Run bankr login --api-key bk_THE_KEY
#### Separate LLM Gateway Key (Optional)
If your LLM gateway key differs from your API key, pass --llm-key during login or run bankr config set llmKey YOUR_LLM_KEY afterward. When not set, the API key is used for both. See references/llm-gateway.md for full details.
#### Verify Setup
bankr whoami
bankr prompt "What is my balance?"
Option 2: REST API (Direct)
No CLI installation required β call the API directly with curl, fetch, or any HTTP client.
Authentication
All requests require an X-API-Key header:
curl -X POST "https://api.bankr.bot/agent/prompt" \
-H "X-API-Key: bk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "What is my ETH balance?"}'
Quick Example: Submit β Poll β Complete
# 1. Submit a prompt β returns a job ID
JOB=$(curl -s -X POST "https://api.bankr.bot/agent/prompt" \
-H "X-API-Key: $BANKR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "What is my ETH balance?"}')
JOB_ID=$(echo "$JOB" | jq -r '.jobId')2. Poll until terminal status
while true; do
RESULT=$(curl -s "https://api.bankr.bot/agent/job/$JOB_ID" \
-H "X-API-Key: $BANKR_API_KEY")
STATUS=$(echo "$RESULT" | jq -r '.status')
[ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ] || [ "$STATUS" = "cancelled" ] && break
sleep 2
done3. Read the response
echo "$RESULT" | jq -r '.response'
Conversation Threads
Every prompt response includes a threadId. Pass it back to continue the conversation:
# Start β the response includes a threadId
curl -X POST "https://api.bankr.bot/agent/prompt" \
-H "X-API-Key: $BANKR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "What is the price of ETH?"}'
β {"jobId": "job_abc", "threadId": "thr_XYZ", ...}
Continue β pass threadId to maintain context
curl -X POST "https://api.bankr.bot/agent/prompt" \
-H "X-API-Key: $BANKR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "And what about SOL?", "threadId": "thr_XYZ"}'
Omit threadId to start a new conversation. CLI equivalent: bankr prompt --continue (reuses last thread) or bankr prompt --thread .
API Endpoints Summary
| Endpoint | Method | Description |
|----------|--------|-------------|
| /agent/prompt | POST | Submit a prompt (async, returns job ID) |
| /agent/job/{jobId} | GET | Check job status and results |
| /agent/job/{jobId}/cancel | POST | Cancel a running job |
| /agent/balances | GET | Wallet balances across chains (sync, optional ?chains= filter) |
| /agent/sign | POST | Sign messages/transactions (sync) |
| /agent/submit | POST | Submit raw transactions (sync) |
For full API details (request/response schemas, job states, rich data, polling strategy), see:
Reference: references/api-workflow.md | references/sign-submit-api.md
CLI Command Reference
Core Commands
| Command | Description |
|---------|-------------|
| bankr login | Authenticate with the Bankr API (interactive menu) |
| bankr login email | Send OTP to email (headless step 1) |
| bankr login email --code | Verify OTP and complete setup (headless step 2) |
| bankr login --api-key | Login with an existing API key directly |
| bankr login --api-key | Login with separate LLM gateway key |
| bankr login --url | Print Bankr Terminal URL for API key generation |
| bankr logout | Clear stored credentials |
| bankr whoami | Show current authentication info |
| bankr prompt | Send a prompt to the Bankr AI agent |
| bankr prompt --continue | Continue the most recent conversation thread |
| bankr prompt --thread | Continue a specific conversation thread |
| bankr status | Check the status of a running job |
| bankr cancel | Cancel a running job |
| bankr balances | Show wallet token balances across all chains |
| bankr balances --chain | Filter by chain(s): base, polygon, mainnet, unichain, solana (comma-separated) |
| bankr balances --json | Output raw JSON balances |
| bankr skills | Show all Bankr AI agent skills with examples |
Configuration Commands
| Command | Description |
|---------|-------------|
| bankr config get [key] | Get config value(s) |
| bankr config set | Set a config value |
| bankr --config | Use a custom config file path |
Valid config keys: apiKey, apiUrl, llmKey, llmUrl
Default config location: ~/.bankr/config.json. Override with --config or BANKR_CONFIG env var.
Environment Variables
| Variable | Description |
|----------|-------------|
| BANKR_API_KEY | API key (overrides stored key) |
| BANKR_API_URL | API URL (default: https://api.bankr.bot) |
| BANKR_LLM_KEY | LLM gateway key (falls back to BANKR_API_KEY if not set) |
| BANKR_LLM_URL | LLM gateway URL (default: https://llm.bankr.bot) |
Environment variables override config file values. Config file values override defaults.
LLM Gateway Commands
| Command | Description |
|---------|-------------|
| bankr llm models | List available LLM models |
| bankr llm setup openclaw [--install] | Generate or install OpenClaw config |
| bankr llm setup opencode [--install] | Generate or install OpenCode config |
| bankr llm setup claude | Show Claude Code environment setup |
| bankr llm setup cursor | Show Cursor IDE setup instructions |
| bankr llm claude [args...] | Launch Claude Code via the Bankr LLM Gateway |
Core Usage
Simple Query
For straightforward requests that complete quickly:
bankr prompt "What is my ETH balance?"
bankr prompt "What's the price of Bitcoin?"
The CLI handles the full submit-poll-complete workflow automatically. You can also use the shorthand β any unrecognized command is treated as a prompt:
bankr What is the price of ETH?
Interactive Prompt
For prompts containing $ or special characters that the shell would expand:
# Interactive mode β no shell expansion issues
bankr prompt
Then type: Buy $50 of ETH on Base
Or pipe input
echo 'Buy $50 of ETH on Base' | bankr prompt
Conversation Threads
Continue a multi-turn conversation with the agent:
# First prompt β starts a new thread automatically
bankr prompt "What is the price of ETH?"
β Thread: thr_ABC123
Continue the conversation (agent remembers the ETH context)
bankr prompt --continue "And what about BTC?"
bankr prompt -c "Compare them"Resume any thread by ID
bankr prompt --thread thr_ABC123 "Show me ETH chart"
Thread IDs are automatically saved to config after each prompt. The --continue / -c flag reuses the last thread.
Manual Job Control
For advanced use or long-running operations:
# Submit and get job ID
bankr prompt "Buy $100 of ETH"
β Job submitted: job_abc123
Check status of a specific job
bankr status job_abc123Cancel if needed
bankr cancel job_abc123
LLM Gateway
The Bankr LLM Gateway is a unified API for Claude, Gemini, GPT, and other models β multi-provider access, cost tracking, automatic failover, and SDK compatibility through a single endpoint.
Base URL: https://llm.bankr.bot | Dashboard: bankr.bot/llm | API Keys: bankr.bot/api
Key Concepts
llmKey if configured, otherwise falls back to your API keybankr llm credits | Check trading wallet: bankr balancesbankr/ (e.g. bankr/claude-sonnet-4.6). In direct API calls, use bare IDs (e.g. claude-sonnet-4.6)Quick Commands
bankr llm models # List available models
bankr llm credits # Check credit balance
bankr llm setup openclaw --install # Install Bankr provider into OpenClaw
bankr llm setup claude # Print Claude Code env vars
bankr llm claude # Launch Claude Code through gateway
For full details β setup paths, model list, provider config, SDK examples, key management, and troubleshooting β see:
Reference: references/llm-gateway.md
Capabilities Overview
Trading Operations
Reference: references/token-trading.md
Portfolio Management
bankr balances or GET /agent/balances)bankr balances --chain base,solana or GET /agent/balances?chains=base,solanaReference: references/portfolio.md
Market Research
Reference: references/market-research.md
Transfers
Reference: references/transfers.md
NFT Operations
Reference: references/nft-operations.md
Polymarket Betting
Reference: references/polymarket.md
Leverage Trading
Reference: references/leverage-trading.md
Token Deployment
Reference: references/token-deployment.md
Automation
Reference: references/automation.md
Arbitrary Transactions
Reference: references/arbitrary-transaction.md
Supported Chains
| Chain | Native Token | Best For | Gas Cost | | -------- | ------------ | ----------------------------- | -------- | | Base | ETH | Memecoins, general trading | Very Low | | Polygon | MATIC | Gaming, NFTs, frequent trades | Very Low | | Ethereum | ETH | Blue chips, high liquidity | High | | Solana | SOL | High-speed trading | Minimal | | Unichain | ETH | Newer L2 option | Very Low |
Safety & Access Control
Dedicated Agent Wallet: When building autonomous agents, create a separate Bankr account rather than using your personal wallet. This isolates agent funds β if a key is compromised, only the agent wallet is exposed. Fund it with limited amounts and replenish as needed.
API Key Types: Bankr uses a single key format (bk_...) with capability flags (agentApiEnabled, llmGatewayEnabled). You can optionally configure a separate LLM Gateway key via bankr config set llmKey or BANKR_LLM_KEY β useful when you want independent revocation or different permissions for agent vs LLM access.
Read-Only API Keys: Keys with readOnly: true filter all write tools (swaps, transfers, staking, token launches, etc.) from agent sessions. The /agent/sign and /agent/submit endpoints return 403. Ideal for monitoring bots and research agents.
IP Whitelisting: Set allowedIps on your API key to restrict usage to specific IPs. Requests from non-whitelisted IPs are rejected with 403 at the auth layer.
Rate Limits: 100 messages/day (standard), 1,000/day (Bankr Club), or custom per key. Resets 24h from first message (rolling window). LLM Gateway uses a credit-based system.
Key safety rules:
BANKR_API_KEY, BANKR_LLM_KEY), never in source code~/.bankr/ and .env to .gitignore β the CLI stores credentials in ~/.bankr/config.jsonwaitForConfirmation: true with /agent/submit β transactions execute immediately with no confirmation promptReference: references/safety.md
Common Patterns
Check Before Trading
# Check balance
bankr prompt "What is my ETH balance on Base?"Check price
bankr prompt "What's the current price of PEPE?"Then trade
bankr prompt "Buy $20 of PEPE on Base"
Portfolio Review
# Direct balance check (no AI agent, instant response)
bankr balances
bankr balances --chain base
bankr balances --chain base,solana
bankr balances --jsonVia AI agent (natural language, richer context)
bankr prompt "Show my complete portfolio"Chain-specific
bankr prompt "What tokens do I have on Base?"Token-specific
bankr prompt "Show my ETH across all chains"
Set Up Automation
# DCA strategy
bankr prompt "DCA $100 into ETH every week"Stop loss protection
bankr prompt "Set stop loss for my ETH at $2,500"Limit order
bankr prompt "Buy ETH if price drops to $3,000"
Market Research
# Price and analysis
bankr prompt "Do technical analysis on ETH"Trending tokens
bankr prompt "What tokens are trending on Base?"Compare tokens
bankr prompt "Compare ETH vs SOL"
API Workflow
Bankr uses an asynchronous job-based API:
1. Submit β Send prompt (with optional threadId), get job ID and thread ID
2. Poll β Check status every 2 seconds
3. Complete β Process results when done
4. Continue β Reuse threadId for multi-turn conversations
The bankr prompt command handles this automatically. When using the REST API directly, implement the poll loop yourself (see Option 2 above or the reference below). For manual job control via CLI, use bankr status and bankr cancel .
For details on the API structure, job states, polling strategy, and error handling, see:
Reference: references/api-workflow.md
Synchronous Endpoints
For direct signing and transaction submission, Bankr also provides synchronous endpoints:
These endpoints return immediately (no polling required) and are ideal for:
Reference: references/sign-submit-api.md
Error Handling
Common issues and fixes:
bankr login or check bankr whoami (CLI), or verify your X-API-Key header (REST API)For comprehensive error troubleshooting, setup instructions, and debugging steps, see:
Reference: references/error-handling.md
Best Practices
Security
1. Never share your API key or LLM key
2. Use a dedicated agent wallet with limited funds for autonomous agents
3. Use read-only API keys for monitoring and research-only agents
4. Set IP whitelisting for server-side agents with known IPs
5. Verify addresses before large transfers
6. Use stop losses for leverage trading
7. Store keys in environment variables, not source code β add ~/.bankr/ to .gitignore
See references/safety.md for comprehensive safety guidance.
Trading
1. Check balance before trades 2. Specify chain for lesser-known tokens 3. Consider gas costs (use Base/Polygon for small amounts) 4. Start small, scale up after testing 5. Use limit orders for better prices
Automation
1. Test automation with small amounts first 2. Review active orders regularly 3. Set realistic price targets 4. Always use stop loss for leverage 5. Monitor execution and adjust as needed
Tips for Success
For New Users
For Experienced Users
Prompt Examples by Category
Trading
Portfolio
bankr balances (direct, no AI processing)bankr balances --chain base (single chain)Market Research
Transfers
NFTs
Polymarket
Leverage
Automation
Token Deployment
Solana (LaunchLab):
EVM (Clanker):
Arbitrary Transactions
Sign API (Synchronous)
Direct message signing without AI processing:
# Sign a plain text message
curl -X POST "https://api.bankr.bot/agent/sign" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"signatureType": "personal_sign", "message": "Hello, Bankr!"}'Sign EIP-712 typed data (permits, orders)
curl -X POST "https://api.bankr.bot/agent/sign" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"signatureType": "eth_signTypedData_v4", "typedData": {...}}'Sign a transaction without broadcasting
curl -X POST "https://api.bankr.bot/agent/sign" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"signatureType": "eth_signTransaction", "transaction": {"to": "0x...", "chainId": 8453}}'
Submit API (Synchronous)
Direct transaction submission without AI processing:
# Submit a raw transaction
curl -X POST "https://api.bankr.bot/agent/submit" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transaction": {"to": "0x...", "chainId": 8453, "value": "1000000000000000000"},
"waitForConfirmation": true
}'
Reference: references/sign-submit-api.md
Resources
Troubleshooting
CLI Not Found
# Verify installation
which bankrReinstall if needed
bun install -g @bankr/cli
Authentication Issues
CLI:
# Check current auth
bankr whoamiRe-authenticate
bankr loginCheck LLM key specifically
bankr config get llmKey
REST API:
# Test your API key
curl -s "https://api.bankr.bot/_health" -H "X-API-Key: $BANKR_API_KEY"
API Errors
See references/error-handling.md for comprehensive troubleshooting.
Getting Help
1. Check error message in CLI output or API response
2. Run bankr whoami to verify auth (CLI) or test with a curl to /_health (REST API)
3. Consult relevant reference document
4. Test with simple queries first (bankr prompt "What is my balance?" or POST /agent/prompt)
Pro Tip: The most common issue is not specifying the chain for tokens. When in doubt, always include "on Base" or "on Ethereum" in your prompt.
Security: Keep your API key private. Never commit your config file to version control. Only trade amounts you can afford to lose.
Quick Win: Start by checking your portfolio (bankr prompt "Show my portfolio") to see what's possible, then try a small $5-10 trade on Base to get familiar with the flow.
π Tips & Best Practices
Security
1. Never share your API key or LLM key
2. Use a dedicated agent wallet with limited funds for autonomous agents
3. Use read-only API keys for monitoring and research-only agents
4. Set IP whitelisting for server-side agents with known IPs
5. Verify addresses before large transfers
6. Use stop losses for leverage trading
7. Store keys in environment variables, not source code β add ~/.bankr/ to .gitignore
See references/safety.md for comprehensive safety guidance.
Trading
1. Check balance before trades 2. Specify chain for lesser-known tokens 3. Consider gas costs (use Base/Polygon for small amounts) 4. Start small, scale up after testing 5. Use limit orders for better prices
Automation
1. Test automation with small amounts first 2. Review active orders regularly 3. Set realistic price targets 4. Always use stop loss for leverage 5. Monitor execution and adjust as needed