Writing Skills
writing-skills
效率与协作技能,来自 obra/superpowers,查看原文获取完整用途和操作说明。
or special characters that the shell would expand:\n\n```bash\n# Interactive mode — no shell expansion issues\nbankr prompt\n# Then type: Buy $50 of ETH on Base\n\n# Or pipe input\necho 'Buy $50 of ETH on Base' | bankr prompt\n```\n\n### Conversation Threads\n\nContinue a multi-turn conversation with the agent:\n\n```bash\n# First prompt — starts a new thread automatically\nbankr prompt \"What is the price of ETH?\"\n# → Thread: thr_ABC123\n\n# Continue the conversation (agent remembers the ETH context)\nbankr prompt --continue \"And what about BTC?\"\nbankr prompt -c \"Compare them\"\n\n# Resume any thread by ID\nbankr prompt --thread thr_ABC123 \"Show me ETH chart\"\n```\n\nThread IDs are automatically saved to config after each prompt. The `--continue` / `-c` flag reuses the last thread.\n\n### Manual Job Control\n\nFor advanced use or long-running operations:\n\n```bash\n# Submit and get job ID\nbankr prompt \"Buy $100 of ETH\"\n# → Job submitted: job_abc123\n\n# Check status of a specific job\nbankr status job_abc123\n\n# Cancel if needed\nbankr cancel job_abc123\n```\n\n## LLM Gateway\n\nThe [Bankr LLM Gateway](https://docs.bankr.bot/llm-gateway/overview) 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.\n\n**Base URL:** `https://llm.bankr.bot` | **Dashboard:** [bankr.bot/llm](https://bankr.bot/llm) | **API Keys:** [bankr.bot/api](https://bankr.bot/api)\n\n### Key Concepts\n\n- Uses your `llmKey` if configured, otherwise falls back to your API key\n- **LLM credits** (USD) and **trading wallet** (crypto) are completely separate balances — having crypto does NOT give you LLM credits\n- **New accounts start with $0 LLM credits** — top up at [bankr.bot/llm](https://bankr.bot/llm) before making any LLM calls, or you will get a 402 error\n- Check credits: `bankr llm credits` | Check trading wallet: `bankr balances`\n- In OpenClaw config, prefix model IDs with `bankr/` (e.g. `bankr/claude-sonnet-4.6`). In direct API calls, use bare IDs (e.g. `claude-sonnet-4.6`)\n\n### Quick Commands\n\n```bash\nbankr llm models # List available models\nbankr llm credits # Check credit balance\nbankr llm setup openclaw --install # Install Bankr provider into OpenClaw\nbankr llm setup claude # Print Claude Code env vars\nbankr llm claude # Launch Claude Code through gateway\n```\n\nFor full details — setup paths, model list, provider config, SDK examples, key management, and troubleshooting — see:\n\n**Reference**: [references/llm-gateway.md](references/llm-gateway.md)\n\n## Capabilities Overview\n\n### Trading Operations\n\n- **Token Swaps**: Buy/sell/swap tokens across chains\n- **Cross-Chain**: Bridge tokens between chains\n- **Limit Orders**: Execute at target prices\n- **Stop Loss**: Automatic sell protection\n- **DCA**: Dollar-cost averaging strategies\n- **TWAP**: Time-weighted average pricing\n\n**Reference**: [references/token-trading.md](references/token-trading.md)\n\n### Portfolio Management\n\n- Check balances across all chains (`bankr balances` or `GET /agent/balances`)\n- View USD valuations\n- Track holdings by token or chain\n- Real-time price updates\n- Multi-chain aggregation\n- Filter by chain: `bankr balances --chain base,solana` or `GET /agent/balances?chains=base,solana`\n\n**Reference**: [references/portfolio.md](references/portfolio.md)\n\n### Market Research\n\n- Token prices and market data\n- Technical analysis (RSI, MACD, etc.)\n- Social sentiment analysis\n- Price charts\n- Trending tokens\n- Token comparisons\n\n**Reference**: [references/market-research.md](references/market-research.md)\n\n### Transfers\n\n- Send to addresses, ENS, or social handles\n- Multi-chain support\n- Flexible amount formats\n- Social handle resolution (Twitter, Farcaster, Telegram)\n\n**Reference**: [references/transfers.md](references/transfers.md)\n\n### NFT Operations\n\n- Browse and search collections\n- View floor prices and listings\n- Purchase NFTs via OpenSea\n- View your NFT portfolio\n- Transfer NFTs\n- Mint from supported platforms\n\n**Reference**: [references/nft-operations.md](references/nft-operations.md)\n\n### Polymarket Betting\n\n- Search prediction markets\n- Check odds\n- Place bets on outcomes\n- View positions\n- Redeem winnings\n\n**Reference**: [references/polymarket.md](references/polymarket.md)\n\n### Leverage Trading\n\n- Long/short positions (up to 50x crypto, 100x forex/commodities)\n- Crypto, forex, and commodities\n- Stop loss and take profit\n- Position management via Avantis on Base\n\n**Reference**: [references/leverage-trading.md](references/leverage-trading.md)\n\n### Token Deployment\n\n- **EVM (Base)**: Deploy ERC20 tokens via Clanker with customizable metadata and social links\n- **Solana**: Launch SPL tokens via Raydium LaunchLab with bonding curve and auto-migration to CPMM\n- Creator fee claiming on both chains\n- Fee Key NFTs for Solana (50% LP trading fees post-migration)\n- Optional fee recipient designation with 99.9%/0.1% split (Solana)\n- Both creator AND fee recipient can claim bonding curve fees (gas sponsored)\n- Optional vesting parameters (Solana)\n- Rate limits: 1/day standard, 10/day Bankr Club (gas sponsored within limits)\n\n**Reference**: [references/token-deployment.md](references/token-deployment.md)\n\n### Automation\n\n- Limit orders\n- Stop loss orders\n- DCA (dollar-cost averaging)\n- TWAP (time-weighted average price)\n- Scheduled commands\n\n**Reference**: [references/automation.md](references/automation.md)\n\n### Arbitrary Transactions\n\n- Submit raw EVM transactions with explicit calldata\n- Custom contract calls to any address\n- Execute pre-built calldata from other tools\n- Value transfers with data\n\n**Reference**: [references/arbitrary-transaction.md](references/arbitrary-transaction.md)\n\n## Supported Chains\n\n| Chain | Native Token | Best For | Gas Cost |\n| -------- | ------------ | ----------------------------- | -------- |\n| Base | ETH | Memecoins, general trading | Very Low |\n| Polygon | MATIC | Gaming, NFTs, frequent trades | Very Low |\n| Ethereum | ETH | Blue chips, high liquidity | High |\n| Solana | SOL | High-speed trading | Minimal |\n| Unichain | ETH | Newer L2 option | Very Low |\n\n## Safety & Access Control\n\n**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.\n\n**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.\n\n**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.\n\n**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.\n\n**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.\n\n**Key safety rules:**\n- Store keys in environment variables (`BANKR_API_KEY`, `BANKR_LLM_KEY`), never in source code\n- Add `~/.bankr/` and `.env` to `.gitignore` — the CLI stores credentials in `~/.bankr/config.json`\n- Test with small amounts on low-cost chains (Base, Polygon) before production use\n- Use `waitForConfirmation: true` with `/agent/submit` — transactions execute immediately with no confirmation prompt\n- Rotate keys periodically and revoke immediately if compromised at [bankr.bot/api](https://bankr.bot/api)\n\n**Reference**: [references/safety.md](references/safety.md)\n\n## Common Patterns\n\n### Check Before Trading\n\n```bash\n# Check balance\nbankr prompt \"What is my ETH balance on Base?\"\n\n# Check price\nbankr prompt \"What's the current price of PEPE?\"\n\n# Then trade\nbankr prompt \"Buy $20 of PEPE on Base\"\n```\n\n### Portfolio Review\n\n```bash\n# Direct balance check (no AI agent, instant response)\nbankr balances\nbankr balances --chain base\nbankr balances --chain base,solana\nbankr balances --json\n\n# Via AI agent (natural language, richer context)\nbankr prompt \"Show my complete portfolio\"\n\n# Chain-specific\nbankr prompt \"What tokens do I have on Base?\"\n\n# Token-specific\nbankr prompt \"Show my ETH across all chains\"\n```\n\n### Set Up Automation\n\n```bash\n# DCA strategy\nbankr prompt \"DCA $100 into ETH every week\"\n\n# Stop loss protection\nbankr prompt \"Set stop loss for my ETH at $2,500\"\n\n# Limit order\nbankr prompt \"Buy ETH if price drops to $3,000\"\n```\n\n### Market Research\n\n```bash\n# Price and analysis\nbankr prompt \"Do technical analysis on ETH\"\n\n# Trending tokens\nbankr prompt \"What tokens are trending on Base?\"\n\n# Compare tokens\nbankr prompt \"Compare ETH vs SOL\"\n```\n\n## API Workflow\n\nBankr uses an asynchronous job-based API:\n\n1. **Submit** — Send prompt (with optional `threadId`), get job ID and thread ID\n2. **Poll** — Check status every 2 seconds\n3. **Complete** — Process results when done\n4. **Continue** — Reuse `threadId` for multi-turn conversations\n\nThe `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 \u003cjobId>` and `bankr cancel \u003cjobId>`.\n\nFor details on the API structure, job states, polling strategy, and error handling, see:\n\n**Reference**: [references/api-workflow.md](references/api-workflow.md)\n\n### Synchronous Endpoints\n\nFor direct signing and transaction submission, Bankr also provides synchronous endpoints:\n\n- **POST /agent/sign** - Sign messages, typed data, or transactions without broadcasting\n- **POST /agent/submit** - Submit raw transactions directly to the blockchain\n\nThese endpoints return immediately (no polling required) and are ideal for:\n- Authentication flows (sign messages)\n- Gasless approvals (sign EIP-712 permits)\n- Pre-built transactions (submit raw calldata)\n\n**Reference**: [references/sign-submit-api.md](references/sign-submit-api.md)\n\n## Error Handling\n\nCommon issues and fixes:\n\n- **Authentication errors** → Run `bankr login` or check `bankr whoami` (CLI), or verify your `X-API-Key` header (REST API)\n- **Insufficient balance** → Add funds or reduce amount\n- **Token not found** → Verify symbol and chain\n- **Transaction reverted** → Check parameters and balances\n- **Rate limiting** → Wait and retry\n\nFor comprehensive error troubleshooting, setup instructions, and debugging steps, see:\n\n**Reference**: [references/error-handling.md](references/error-handling.md)\n\n## Best Practices\n\n### Security\n\n1. Never share your API key or LLM key\n2. Use a dedicated agent wallet with limited funds for autonomous agents\n3. Use read-only API keys for monitoring and research-only agents\n4. Set IP whitelisting for server-side agents with known IPs\n5. Verify addresses before large transfers\n6. Use stop losses for leverage trading\n7. Store keys in environment variables, not source code — add `~/.bankr/` to `.gitignore`\n\nSee [references/safety.md](references/safety.md) for comprehensive safety guidance.\n\n### Trading\n\n1. Check balance before trades\n2. Specify chain for lesser-known tokens\n3. Consider gas costs (use Base/Polygon for small amounts)\n4. Start small, scale up after testing\n5. Use limit orders for better prices\n\n### Automation\n\n1. Test automation with small amounts first\n2. Review active orders regularly\n3. Set realistic price targets\n4. Always use stop loss for leverage\n5. Monitor execution and adjust as needed\n\n## Tips for Success\n\n### For New Users\n\n- Start with balance checks and price queries\n- Test with $5-10 trades first\n- Use Base for lower fees\n- Enable trading confirmations initially\n- Learn one feature at a time\n\n### For Experienced Users\n\n- Leverage automation for strategies\n- Use multiple chains for diversification\n- Combine DCA with stop losses\n- Explore advanced features (leverage, Polymarket)\n- Monitor gas costs across chains\n\n## Prompt Examples by Category\n\n### Trading\n\n- \"Buy $50 of ETH on Base\"\n- \"Swap 0.1 ETH for USDC\"\n- \"Sell 50% of my PEPE\"\n- \"Bridge 100 USDC from Polygon to Base\"\n\n### Portfolio\n\n- `bankr balances` (direct, no AI processing)\n- `bankr balances --chain base` (single chain)\n- \"Show my portfolio\"\n- \"What's my ETH balance?\"\n- \"Total portfolio value\"\n- \"Holdings on Base\"\n\n### Market Research\n\n- \"What's the price of Bitcoin?\"\n- \"Analyze ETH price\"\n- \"Trending tokens on Base\"\n- \"Compare UNI vs SUSHI\"\n\n### Transfers\n\n- \"Send 0.1 ETH to vitalik.eth\"\n- \"Transfer $20 USDC to @friend\"\n- \"Send 50 USDC to 0x123...\"\n\n### NFTs\n\n- \"Show Bored Ape floor price\"\n- \"Buy cheapest Pudgy Penguin\"\n- \"Show my NFTs\"\n\n### Polymarket\n\n- \"What are the odds Trump wins?\"\n- \"Bet $10 on Yes for [market]\"\n- \"Show my Polymarket positions\"\n\n### Leverage\n\n- \"Open 5x long on ETH with $100\"\n- \"Short BTC 10x with stop loss at $45k\"\n- \"Show my Avantis positions\"\n\n### Automation\n\n- \"DCA $100 into ETH weekly\"\n- \"Set limit order to buy ETH at $3,000\"\n- \"Stop loss for all holdings at -20%\"\n\n### Token Deployment\n\n**Solana (LaunchLab):**\n\n- \"Launch a token called MOON on Solana\"\n- \"Launch a token called FROG and give fees to @0xDeployer\"\n- \"Deploy SpaceRocket with symbol ROCK\"\n- \"Launch BRAIN and route fees to 7xKXtg...\"\n- \"How much fees can I claim for MOON?\"\n- \"Claim my fees for MOON\" (works for creator or fee recipient)\n- \"Show my Fee Key NFTs\"\n- \"Claim my fee NFT for ROCKET\" (post-migration)\n- \"Transfer fees for MOON to 7xKXtg...\"\n\n**EVM (Clanker):**\n\n- \"Deploy a token called BankrFan with symbol BFAN on Base\"\n- \"Claim fees for my token MTK\"\n\n### Arbitrary Transactions\n\n- \"Submit this transaction: {to: 0x..., data: 0x..., value: 0, chainId: 8453}\"\n- \"Execute this calldata on Base: {...}\"\n- \"Send raw transaction with this JSON: {...}\"\n\n### Sign API (Synchronous)\n\nDirect message signing without AI processing:\n\n```bash\n# Sign a plain text message\ncurl -X POST \"https://api.bankr.bot/agent/sign\" \\\n -H \"X-API-Key: $API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"signatureType\": \"personal_sign\", \"message\": \"Hello, Bankr!\"}'\n\n# Sign EIP-712 typed data (permits, orders)\ncurl -X POST \"https://api.bankr.bot/agent/sign\" \\\n -H \"X-API-Key: $API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"signatureType\": \"eth_signTypedData_v4\", \"typedData\": {...}}'\n\n# Sign a transaction without broadcasting\ncurl -X POST \"https://api.bankr.bot/agent/sign\" \\\n -H \"X-API-Key: $API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"signatureType\": \"eth_signTransaction\", \"transaction\": {\"to\": \"0x...\", \"chainId\": 8453}}'\n```\n\n### Submit API (Synchronous)\n\nDirect transaction submission without AI processing:\n\n```bash\n# Submit a raw transaction\ncurl -X POST \"https://api.bankr.bot/agent/submit\" \\\n -H \"X-API-Key: $API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"transaction\": {\"to\": \"0x...\", \"chainId\": 8453, \"value\": \"1000000000000000000\"},\n \"waitForConfirmation\": true\n }'\n```\n\n**Reference**: [references/sign-submit-api.md](references/sign-submit-api.md)\n\n## Resources\n\n- **Documentation**: https://docs.bankr.bot\n- **LLM Gateway Docs**: https://docs.bankr.bot/llm-gateway/overview\n- **API Key Management**: https://bankr.bot/api\n- **Terminal**: https://bankr.bot/terminal\n- **CLI Package**: https://www.npmjs.com/package/@bankr/cli\n- **Twitter**: @bankr_bot\n\n## Troubleshooting\n\n### CLI Not Found\n\n```bash\n# Verify installation\nwhich bankr\n\n# Reinstall if needed\nbun install -g @bankr/cli\n```\n\n### Authentication Issues\n\n**CLI:**\n```bash\n# Check current auth\nbankr whoami\n\n# Re-authenticate\nbankr login\n\n# Check LLM key specifically\nbankr config get llmKey\n```\n\n**REST API:**\n```bash\n# Test your API key\ncurl -s \"https://api.bankr.bot/_health\" -H \"X-API-Key: $BANKR_API_KEY\"\n```\n\n### API Errors\n\nSee [references/error-handling.md](references/error-handling.md) for comprehensive troubleshooting.\n\n### Getting Help\n\n1. Check error message in CLI output or API response\n2. Run `bankr whoami` to verify auth (CLI) or test with a curl to `/_health` (REST API)\n3. Consult relevant reference document\n4. Test with simple queries first (`bankr prompt \"What is my balance?\"` or `POST /agent/prompt`)\n\n---\n\n**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.\n\n**Security**: Keep your API key private. Never commit your config file to version control. Only trade amounts you can afford to lose.\n\n**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.\n","licenseDocuments":[]}}
bankr【部署与运维】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 …
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Execute crypto trading and DeFi operations using natural language. Two integration options:
@bankr/cli for a batteries-included terminal experiencehttps://api.bankr.bot directly from any language or toolBoth use the same API key and the same async job workflow under the hood.
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.com
# Step 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
bk_...)Both options automatically provision EVM wallets (Base, Ethereum, Polygon, Unichain) and a Solana wallet — no manual wallet setup needed.
bun install -g @bankr/cli
Or with npm:
npm install -g @bankr/cli
When the user asks to log in with an email, walk them through this flow:
Step 1 — Send verification code
bankr login email <user-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:
--accept-terms unless the user has explicitly confirmed.--read-write) — enables swaps, transfers, orders, token launches, leverage, Polymarket bets--llm) — multi-model API at llm.bankr.bot (currently limited to beta testers). Skip if user doesn't need it.--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 <user-email> --code <otp> --accept-terms --key-name "My Agent" --read-write --llm
# Example read-only, no LLM
bankr login email <user-email> --code <otp> --accept-terms --key-name "Research Bot"
| Option | Description |
|---|---|
--code <otp> | OTP code received via email (step 2) |
--accept-terms | Accept Terms of Service without prompting (required for new users) |
--key-name <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.
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:
bankr login --url — prints the terminal URLbk_... keybankr login --api-key bk_THE_KEYIf 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.
bankr whoami
bankr prompt "What is my balance?"
No CLI installation required — call the API directly with curl, fetch, or any HTTP client.
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?"}'
# 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
done
# 3. Read the response
echo "$RESULT" | jq -r '.response'
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 <id>.
| 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
| Command | Description |
|---|---|
bankr login | Authenticate with the Bankr API (interactive menu) |
bankr login email <address> | Send OTP to email (headless step 1) |
bankr login email <address> --code <otp> [options] | Verify OTP and complete setup (headless step 2) |
bankr login --api-key <key> | Login with an existing API key directly |
bankr login --api-key <key> --llm-key <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 <text> | Send a prompt to the Bankr AI agent |
bankr prompt --continue <text> | Continue the most recent conversation thread |
bankr prompt --thread <id> <text> | Continue a specific conversation thread |
bankr status <jobId> | Check the status of a running job |
bankr cancel <jobId> | Cancel a running job |
bankr balances | Show wallet token balances across all chains |
bankr balances --chain <chains> | 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 |
| Command | Description |
|---|---|
bankr config get [key] | Get config value(s) |
bankr config set <key> <value> | Set a config value |
bankr --config <path> <command> | 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.
| 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.
| 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 |
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?
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
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.
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_abc123
# Cancel if needed
bankr cancel job_abc123
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
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)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
Reference: references/token-trading.md
bankr balances or GET /agent/balances)bankr balances --chain base,solana or GET /agent/balances?chains=base,solanaReference: references/portfolio.md
Reference: references/market-research.md
Reference: references/transfers.md
Reference: references/nft-operations.md
Reference: references/polymarket.md
Reference: references/leverage-trading.md
Reference: references/token-deployment.md
Reference: references/automation.md
Reference: references/arbitrary-transaction.md
| 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 |
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
# 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"
# Direct balance check (no AI agent, instant response)
bankr balances
bankr balances --chain base
bankr balances --chain base,solana
bankr balances --json
# Via 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"
# 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"
# 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"
Bankr uses an asynchronous job-based API:
threadId), get job ID and thread IDthreadId for multi-turn conversationsThe 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 <jobId> and bankr cancel <jobId>.
For details on the API structure, job states, polling strategy, and error handling, see:
Reference: references/api-workflow.md
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
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
~/.bankr/ to .gitignoreSee references/safety.md for comprehensive safety guidance.
bankr balances (direct, no AI processing)bankr balances --chain base (single chain)Solana (LaunchLab):
EVM (Clanker):
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}}'
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
# Verify installation
which bankr
# Reinstall if needed
bun install -g @bankr/cli
CLI:
# Check current auth
bankr whoami
# Re-authenticate
bankr login
# Check 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"
See references/error-handling.md for comprehensive troubleshooting.
bankr whoami to verify auth (CLI) or test with a curl to /_health (REST API)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.