bankr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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. The API has two layers:
  • Wallet API (
    /wallet/*
    ) — Direct, synchronous endpoints for portfolio, transfers, signing, and transaction submission
  • Agent API (
    /agent/*
    ) — AI-powered async prompt endpoint for natural language operations
使用自然语言执行加密货币交易和DeFi操作。提供两种集成选项:
  1. Bankr CLI(推荐)—— 安装
    @bankr/cli
    即可获得功能齐全的终端体验
  2. REST API—— 可从任意语言或工具直接调用
    https://api.bankr.bot
两种方式使用相同的API密钥。API分为两层:
  • 钱包API (
    /wallet/*
    ) —— 直接的同步端点,用于投资组合查询、转账、签名和交易提交
  • Agent API (
    /agent/*
    ) —— 基于AI的异步提示端点,用于自然语言操作

Getting an API Key

获取API密钥

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.
bash
undefined
使用任意一种选项之前,你需要先获取Bankr API密钥。有两种获取方式:
选项A:无界面邮箱登录(推荐Agent使用)
两步流程——发送OTP,然后验证并完成设置。完整引导流程包含用户偏好提示,请参见下方“首次设置”部分。
bash
undefined

Step 1 — send OTP to email

步骤1 —— 向邮箱发送OTP

bankr login email user@example.com
bankr login email user@example.com

Step 2 — verify OTP and generate API key (options based on user preferences)

步骤2 —— 验证OTP并生成API密钥(可根据用户偏好选择选项)

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 which APIs they need (wallet, agent, both via `--read-write`, LLM gateway) and their preferred key name.

**Option B: Bankr Terminal**

1. Visit [bankr.bot/api](https://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 **Wallet & 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.
bankr login email user@example.com --code 123456 --accept-terms --key-name "My Agent" --read-write

该操作会创建钱包、接受服务条款并生成API密钥——无需浏览器操作。运行步骤2之前,请询问用户需要哪些API(钱包、Agent,通过`--read-write`同时启用两者,或LLM网关)以及他们偏好的密钥名称。

**选项B:Bankr终端**

1. 访问 [bankr.bot/api](https://bankr.bot/api)
2. **注册/登录** —— 输入你的邮箱和收到的一次性验证码(OTP)
3. **生成API密钥** —— 创建一个启用了**钱包&Agent API**访问权限的密钥(密钥以`bk_...`开头)

两种选项都会自动配置**EVM钱包**(Base、Ethereum、Polygon、Unichain)和**Solana钱包**——无需手动设置钱包。

Option 1: Bankr CLI (Recommended)

选项1:Bankr CLI(推荐)

Install

安装

bash
bun install -g @bankr/cli
Or with npm:
bash
npm install -g @bankr/cli
bash
bun install -g @bankr/cli
或者使用npm:
bash
npm install -g @bankr/cli

First-Time Setup

首次设置

Headless email login (recommended for agents)

无界面邮箱登录(推荐Agent使用)

When the user asks to log in with an email, walk them through this flow:
Step 1 — Send verification code
bash
bankr login email <user-email>
Step 2 — Ask the user for the OTP code and all preferences in a single message. This avoids unnecessary back-and-forth. Ask for:
  1. OTP code — the code they received via email
  2. Accept Terms of Service (REQUIRED) — Present the Terms of Service link and confirm the user agrees. The login command will fail for new users without
    --accept-terms
    .
    You MUST ask for ToS acceptance and do not pass
    --accept-terms
    unless the user has explicitly confirmed.
  3. Which APIs do they need?
    • Wallet API — enabled by default, use
      --no-wallet-api
      to disable
    • Agent API (
      --agent-api
      ) — AI-powered prompts and natural language operations
    • Token Launch — enabled by default, use
      --no-token-launch
      to disable
    • Add
      --read-write
      to allow transactions (without it, enabled APIs are read-only)
  4. Enable LLM gateway access? (
    --llm
    ) — multi-model API at
    llm.bankr.bot
    (currently limited to beta testers). Skip if user doesn't need it.
  5. Key name? (
    --key-name
    ) — a display name for the API key (e.g. "My Agent", "Trading Bot")
Step 3 — Construct and run the step 2 command with the user's choices. Do NOT execute if the user has not explicitly accepted the Terms of Service — ask again if needed:
bash
undefined
当用户要求使用邮箱登录时,按照以下流程引导:
步骤1 —— 发送验证码
bash
bankr login email <user-email>
步骤2 —— 在单条消息中向用户询问OTP验证码和所有偏好设置,避免不必要的来回沟通。需要询问的内容:
  1. OTP验证码 —— 用户通过邮箱收到的验证码
  2. 接受服务条款(必填) —— 提供服务条款链接并确认用户同意。**新用户如果不添加
    --accept-terms
    参数,登录命令会执行失败。**你必须向用户确认是否接受服务条款,除非用户明确同意,否则不要传入
    --accept-terms
    参数。
  3. 他们需要哪些API?
    • 钱包API —— 默认启用,使用
      --no-wallet-api
      禁用
    • Agent API (
      --agent-api
      ) —— 基于AI的提示和自然语言操作
    • 代币发布 —— 默认启用,使用
      --no-token-launch
      禁用
    • 添加
      --read-write
      允许执行交易(不添加该参数的话,已启用的API仅支持只读操作)
  4. 是否启用LLM网关访问权限? (
    --llm
    ) —— 位于
    llm.bankr.bot
    的多模型API(目前仅对beta测试者开放)。如果用户不需要可以跳过。
  5. 密钥名称? (
    --key-name
    ) —— API密钥的展示名称(例如"My Agent"、"Trading Bot")
步骤3 —— 根据用户的选择构建并运行步骤2的命令。如果用户没有明确接受服务条款,请勿执行命令——如有需要可再次询问:
bash
undefined

Full access: wallet + agent with write + LLM

完整权限:钱包+Agent可写+LLM

bankr login email <user-email> --code <otp> --accept-terms --key-name "My Agent" --agent-api --read-write --llm
bankr login email <user-email> --code <otp> --accept-terms --key-name "My Agent" --agent-api --read-write --llm

Agent with write access (AI can execute transactions)

Agent可写权限(AI可以执行交易)

bankr login email <user-email> --code <otp> --accept-terms --key-name "Trading Agent" --agent-api --read-write
bankr login email <user-email> --code <otp> --accept-terms --key-name "Trading Agent" --agent-api --read-write

Default key (wallet + token launch, read-only)

默认密钥(钱包+代币发布,只读)

bankr login email <user-email> --code <otp> --accept-terms --key-name "My Key"
bankr login email <user-email> --code <otp> --accept-terms --key-name "My Key"

Agent read-only (research, prices, balances — no transactions)

Agent只读(研究、价格查询、余额查询——无交易权限)

bankr login email <user-email> --code <otp> --accept-terms --key-name "Research Agent" --agent-api
bankr login email <user-email> --code <otp> --accept-terms --key-name "Research Agent" --agent-api

LLM-only (no wallet, no token launch)

仅LLM权限(无钱包、无代币发布权限)

bankr login email <user-email> --code <otp> --accept-terms --key-name "LLM Client" --no-wallet-api --no-token-launch --llm
undefined
bankr login email <user-email> --code <otp> --accept-terms --key-name "LLM Client" --no-wallet-api --no-token-launch --llm
undefined

Login options reference

登录选项参考

OptionDescription
--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
--no-wallet-api
Disable Wallet API (enabled by default)
--agent-api
Enable Agent API (AI prompts, natural language operations)
--read-write
Disable read-only mode (allow transactions). Without this, enabled APIs are read-only
--no-token-launch
Disable Token Launch API (enabled by default)
--llm
Enable LLM gateway access (multi-model API at
llm.bankr.bot
). Currently limited to beta testers
--allowed-ips <ips>
Comma-separated IP allowlist for the API key
--allowed-recipients <addresses>
Comma-separated EVM/Solana addresses the key can send to (auto-classified by 0x prefix)
New key defaults (when no flags are passed):
FlagDefaultTo change
walletApiEnabled
Enabled
--no-wallet-api
agentApiEnabled
Disabled
--agent-api
tokenLaunchApiEnabled
Enabled
--no-token-launch
llmGatewayEnabled
Disabled
--llm
readOnly
Enabled (read-only)
--read-write
Any option not provided on the command line will be prompted interactively by the CLI, so you can mix headless and interactive as needed.
选项描述
--code <otp>
通过邮箱收到的OTP验证码(步骤2使用)
--accept-terms
无需提示直接接受服务条款(新用户必填)
--key-name <name>
API密钥的展示名称(例如"My Agent")。如果省略会弹窗提示
--no-wallet-api
禁用钱包API(默认启用)
--agent-api
启用Agent API(AI提示、自然语言操作)
--read-write
禁用只读模式(允许交易)。不添加该参数的话,已启用的API仅支持只读操作
--no-token-launch
禁用代币发布API(默认启用)
--llm
启用LLM网关访问权限(位于
llm.bankr.bot
的多模型API)。目前仅对beta测试者开放
--allowed-ips <ips>
API密钥允许访问的IP白名单,用逗号分隔
--allowed-recipients <addresses>
密钥允许转账的EVM/Solana地址列表,用逗号分隔(通过0x前缀自动识别链类型)
新密钥默认配置(未传入任何参数时):
配置项默认值修改方式
walletApiEnabled
启用
--no-wallet-api
agentApiEnabled
禁用
--agent-api
tokenLaunchApiEnabled
启用
--no-token-launch
llmGatewayEnabled
禁用
--llm
readOnly
启用(只读)
--read-write
命令行中未提供的选项会由CLI交互式提示用户输入,因此你可以根据需要混合使用无界面和交互模式。

Login with existing API key

使用现有API密钥登录

If the user already has an API key:
bash
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
如果用户已经有API密钥:
bash
bankr login --api-key bk_YOUR_KEY_HERE
如果他们需要在Bankr终端创建密钥:
  1. 运行
    bankr login --url
    —— 打印终端URL
  2. 将URL提供给用户,要求他们生成一个
    bk_...
    开头的密钥
  3. 运行
    bankr login --api-key bk_THE_KEY

Separate LLM Gateway Key (Optional)

独立LLM网关密钥(可选)

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.
如果你的LLM网关密钥和API密钥不同,可以在登录时传入
--llm-key
参数,或者之后运行
bankr config set llmKey YOUR_LLM_KEY
进行配置。未设置的情况下,API密钥会同时用于两者。完整详情请参见references/llm-gateway.md

Verify Setup

验证设置

bash
bankr whoami
bankr wallet portfolio
bankr agent prompt "What is my balance?"
bash
bankr whoami
bankr wallet portfolio
bankr agent prompt "What is my balance?"

Option 2: REST API (Direct)

选项2:REST API(直接调用)

No CLI installation required — call the API directly with
curl
,
fetch
, or any HTTP client.
无需安装CLI——使用
curl
fetch
或任意HTTP客户端直接调用API即可。

Authentication

鉴权

All requests require an
X-API-Key
header:
bash
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?"}'
所有请求都需要携带
X-API-Key
请求头:
bash
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

快速示例:提交→轮询→完成

bash
undefined
bash
undefined

1. Submit a prompt — returns a job ID

1. 提交提示 —— 返回任务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')
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

2. 轮询直到任务进入终态

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
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

3. 读取响应

echo "$RESULT" | jq -r '.response'
undefined
echo "$RESULT" | jq -r '.response'
undefined

Conversation Threads

对话线程

Every prompt response includes a
threadId
. Pass it back to continue the conversation:
bash
undefined
每个提示的响应都会包含
threadId
。传回该参数可以继续对话:
bash
undefined

Start — the response includes a threadId

开启对话 —— 响应包含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?"}'
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", ...}

→ {"jobId": "job_abc", "threadId": "thr_XYZ", ...}

Continue — pass threadId to maintain context

继续对话 —— 传入threadId保持上下文

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 agent prompt --continue` (reuses last thread) or `bankr agent prompt --thread <id>`.
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"}'

省略`threadId`可以开启新对话。CLI等效命令:`bankr agent prompt --continue`(复用上次的线程)或`bankr agent prompt --thread <id>`。

API Endpoints Summary

API端点汇总

Wallet API (
/wallet/*
) — Direct endpoints (synchronous)

钱包API (
/wallet/*
) —— 直接端点(同步)

EndpointMethodAuthDescription
/wallet/me
GETReadWallet info (address, chains)
/wallet/portfolio
GETReadPortfolio balances, supports
?include=pnl,nfts
for progressive loading
/wallet/transfer
POSTWriteTransfer tokens (multi-chain, supports
allowedRecipients
enforcement)
/wallet/sign
POSTWriteSign messages, typed data, or transactions
/wallet/submit
POSTWriteSubmit raw transactions to chain
  • Read endpoints (
    /wallet/me
    ,
    /wallet/portfolio
    ) — any valid API key with a wallet
  • Write endpoints (
    /wallet/transfer
    ,
    /wallet/sign
    ,
    /wallet/submit
    ) — require
    walletApiEnabled
    ,
    readOnly
    check, and
    allowedRecipients
    enforcement
  • IP allowlist enforced on all endpoints
端点请求方法权限描述
/wallet/me
GET只读钱包信息(地址、支持的链)
/wallet/portfolio
GET只读投资组合余额,支持
?include=pnl,nfts
进行渐进式加载
/wallet/transfer
POST可写转账代币(多链支持,可强制校验
allowedRecipients
/wallet/sign
POST可写签名消息、结构化数据或交易
/wallet/submit
POST可写向链上提交原始交易
  • 只读端点 (
    /wallet/me
    /wallet/portfolio
    ) —— 任意绑定了钱包的有效API密钥都可以访问
  • 可写端点 (
    /wallet/transfer
    /wallet/sign
    /wallet/submit
    ) —— 需要启用
    walletApiEnabled
    、通过
    readOnly
    校验,并且符合
    allowedRecipients
    限制
  • 所有端点都会强制校验IP白名单

Agent API (
/agent/*
) — AI-powered endpoints (async)

Agent API (
/agent/*
) —— 基于AI的端点(异步)

EndpointMethodDescription
/agent/prompt
POSTSubmit a prompt (async, returns job ID)
/agent/job/{jobId}
GETCheck job status and results
/agent/job/{jobId}/cancel
POSTCancel a running job
端点请求方法描述
/agent/prompt
POST提交提示(异步,返回任务ID)
/agent/job/{jobId}
GET查询任务状态和结果
/agent/job/{jobId}/cancel
POST取消运行中的任务

Deprecated endpoints

已废弃端点

The following
/agent/*
endpoints still work but are deprecated in favor of
/wallet/*
:
DeprecatedUse Instead
GET /agent/me
GET /wallet/me
GET /agent/balances
GET /wallet/portfolio
POST /agent/sign
POST /wallet/sign
POST /agent/submit
POST /wallet/submit
For full API details (request/response schemas, job states, rich data, polling strategy), see:
Reference: references/api-workflow.md | references/sign-submit-api.md
以下
/agent/*
端点仍可使用,但已废弃,建议使用
/wallet/*
的对应端点:
已废弃端点替代端点
GET /agent/me
GET /wallet/me
GET /agent/balances
GET /wallet/portfolio
POST /agent/sign
POST /wallet/sign
POST /agent/submit
POST /wallet/submit
完整API详情(请求/响应 schema、任务状态、富数据、轮询策略)请参见:
参考文档: references/api-workflow.md | references/sign-submit-api.md

CLI Command Reference (v0.2.0)

CLI命令参考(v0.2.0)

CLI 0.2.0 organizes commands into three namespaces:
wallet
,
agent
, and
tokens
. Old flat commands (
balances
,
prompt
,
status
, etc.) still work as deprecated aliases.
CLI 0.2.0将命令分为三个命名空间:
wallet
agent
tokens
。旧的扁平命令(
balances
prompt
status
等)仍可作为已废弃的别名使用。

bankr wallet
— Wallet Operations

bankr wallet
—— 钱包操作

CommandDescription
bankr wallet
Show wallet info (default: whoami)
bankr wallet portfolio
Portfolio balances across all chains (hides tokens under $1 by default)
bankr wallet portfolio --pnl
Include profit/loss data
bankr wallet portfolio --nfts
Include NFT holdings
bankr wallet portfolio --all
Include both PnL and NFTs
bankr wallet portfolio --chain <chains>
Filter by chain(s): base, polygon, mainnet, unichain, solana (comma-separated)
bankr wallet portfolio --json
Output raw JSON
bankr wallet transfer --to <recipient> --token <symbol> --amount <amount>
Transfer tokens with symbol resolution
bankr wallet transfer --to <recipient> --token USDC --amount 50 --chain base
Transfer with explicit chain
bankr wallet sign
Sign messages/typed data/transactions
bankr wallet submit
Submit raw transactions
命令描述
bankr wallet
展示钱包信息(默认:whoami)
bankr wallet portfolio
所有链上的投资组合余额(默认隐藏价值低于1美元的代币)
bankr wallet portfolio --pnl
包含盈亏数据
bankr wallet portfolio --nfts
包含NFT持仓
bankr wallet portfolio --all
同时包含PnL和NFT
bankr wallet portfolio --chain <chains>
按链筛选:base、polygon、mainnet、unichain、solana(用逗号分隔)
bankr wallet portfolio --json
输出原始JSON
bankr wallet transfer --to <recipient> --token <symbol> --amount <amount>
转账代币,支持符号解析
bankr wallet transfer --to <recipient> --token USDC --amount 50 --chain base
指定链进行转账
bankr wallet sign
签名消息/结构化数据/交易
bankr wallet submit
提交原始交易

bankr agent
— AI Agent Operations

bankr agent
—— AI Agent操作

CommandDescription
bankr agent prompt <text>
Send a prompt to the Bankr AI agent
bankr agent prompt --continue <text>
Continue the most recent conversation thread
bankr agent prompt --thread <id> <text>
Continue a specific conversation thread
bankr agent status <jobId>
Check the status of a running job
bankr agent cancel <jobId>
Cancel a running job
bankr agent profile
View/manage agent profile
bankr agent skills
Show all Bankr AI agent skills with examples
命令描述
bankr agent prompt <text>
向Bankr AI Agent发送提示
bankr agent prompt --continue <text>
继续最近的对话线程
bankr agent prompt --thread <id> <text>
继续指定的对话线程
bankr agent status <jobId>
查询运行中任务的状态
bankr agent cancel <jobId>
取消运行中的任务
bankr agent profile
查看/管理Agent个人资料
bankr agent skills
展示所有Bankr AI Agent技能及示例

bankr tokens
— Token Discovery

bankr tokens
—— 代币发现

CommandDescription
bankr tokens search <query>
Search for tokens by name or symbol
bankr tokens info <symbol-or-address>
Get detailed token information
命令描述
bankr tokens search <query>
按名称或符号搜索代币
bankr tokens info <symbol-or-address>
获取代币详细信息

Auth & Config Commands

鉴权与配置命令

CommandDescription
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 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.
命令描述
bankr login
向Bankr API鉴权(交互式菜单)
bankr login email <address>
向邮箱发送OTP(无界面步骤1)
bankr login email <address> --code <otp> [options]
验证OTP并完成设置(无界面步骤2)
bankr login --api-key <key>
直接使用现有API密钥登录
bankr login --api-key <key> --llm-key <key>
使用独立的LLM网关密钥登录
bankr login --url
打印用于生成API密钥的Bankr终端URL
bankr logout
清除存储的凭证
bankr whoami
展示当前鉴权信息
bankr config get [key]
获取配置值
bankr config set <key> <value>
设置配置值
bankr --config <path> <command>
使用自定义配置文件路径
有效配置键:
apiKey
apiUrl
llmKey
llmUrl
默认配置路径:
~/.bankr/config.json
。可通过
--config
参数或
BANKR_CONFIG
环境变量覆盖。

Deprecated Aliases

已废弃别名

Old flat commands still work but prefer the namespaced versions:
DeprecatedUse Instead
bankr prompt
bankr agent prompt
bankr status
bankr agent status
bankr cancel
bankr agent cancel
bankr balances
bankr wallet portfolio
bankr profile
bankr agent profile
bankr skills
bankr agent skills
旧的扁平命令仍可使用,但建议使用命名空间版本:
已废弃命令替代命令
bankr prompt
bankr agent prompt
bankr status
bankr agent status
bankr cancel
bankr agent cancel
bankr balances
bankr wallet portfolio
bankr profile
bankr agent profile
bankr skills
bankr agent skills

Environment Variables

环境变量

VariableDescription
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.
变量描述
BANKR_API_KEY
API密钥(覆盖存储的密钥)
BANKR_API_URL
API URL(默认:
https://api.bankr.bot
BANKR_LLM_KEY
LLM网关密钥(未设置时回退到
BANKR_API_KEY
BANKR_LLM_URL
LLM网关URL(默认:
https://llm.bankr.bot
环境变量优先级高于配置文件值,配置文件值优先级高于默认值。

LLM Gateway Commands

LLM网关命令

CommandDescription
bankr llm models
List available LLM models
bankr llm credits
Check credit balance
bankr llm credits add <amount> [--token <addr>] [-y]
Top up LLM credits from wallet
bankr llm credits auto [--enable/--disable] [--amount] [--threshold] [--tokens]
View or configure auto top-up
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
命令描述
bankr llm models
列出可用的LLM模型
bankr llm credits
查询信用余额
bankr llm credits add <amount> [--token <addr>] [-y]
从钱包充值LLM信用
bankr llm credits auto [--enable/--disable] [--amount] [--threshold] [--tokens]
查看或配置自动充值
bankr llm setup openclaw [--install]
生成或安装OpenClaw配置
bankr llm setup opencode [--install]
生成或安装OpenCode配置
bankr llm setup claude
展示Claude Code环境设置方法
bankr llm setup cursor
展示Cursor IDE设置说明
bankr llm claude [args...]
通过Bankr LLM网关启动Claude Code

Core Usage

核心使用方法

Simple Query

简单查询

For straightforward requests that complete quickly:
bash
bankr agent prompt "What is my ETH balance?"
bankr agent 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:
bash
bankr What is the price of ETH?
适用于快速完成的简单请求:
bash
bankr agent prompt "What is my ETH balance?"
bankr agent prompt "What's the price of Bitcoin?"
CLI会自动处理完整的提交-轮询-完成工作流。你也可以使用简写——任何无法识别的命令都会被当作提示处理:
bash
bankr What is the price of ETH?

Interactive Prompt

交互式提示

For prompts containing
$
or special characters that the shell would expand:
bash
undefined
当提示包含
$
或其他会被shell展开的特殊字符时使用:
bash
undefined

Interactive mode — no shell expansion issues

交互模式 —— 不会出现shell展开问题

bankr agent prompt
bankr agent prompt

Then type: Buy $50 of ETH on Base

然后输入:Buy $50 of ETH on Base

Or pipe input

或者通过管道输入

echo 'Buy $50 of ETH on Base' | bankr agent prompt
undefined
echo 'Buy $50 of ETH on Base' | bankr agent prompt
undefined

Conversation Threads

对话线程

Continue a multi-turn conversation with the agent:
bash
undefined
与Agent继续多轮对话:
bash
undefined

First prompt — starts a new thread automatically

第一个提示 —— 自动开启新线程

bankr agent prompt "What is the price of ETH?"
bankr agent prompt "What is the price of ETH?"

→ Thread: thr_ABC123

→ 线程: thr_ABC123

Continue the conversation (agent remembers the ETH context)

继续对话(Agent会记住ETH上下文)

bankr agent prompt --continue "And what about BTC?" bankr agent prompt -c "Compare them"
bankr agent prompt --continue "And what about BTC?" bankr agent prompt -c "Compare them"

Resume any thread by ID

通过ID恢复任意线程

bankr agent 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.
bankr agent prompt --thread thr_ABC123 "Show me ETH chart"

每次提示后线程ID会自动保存到配置中。`--continue`/`-c`参数会复用上次的线程。

Manual Job Control

手动任务控制

For advanced use or long-running operations:
bash
undefined
适用于高级场景或长时间运行的操作:
bash
undefined

Submit and get job ID

提交并获取任务ID

bankr agent prompt "Buy $100 of ETH"
bankr agent prompt "Buy $100 of ETH"

→ Job submitted: job_abc123

→ 任务已提交: job_abc123

Check status of a specific job

查询指定任务的状态

bankr agent status job_abc123
bankr agent status job_abc123

Cancel if needed

必要时取消任务

bankr agent cancel job_abc123
undefined
bankr agent cancel job_abc123
undefined

LLM Gateway

LLM网关

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
Bankr LLM网关是Claude、Gemini、GPT等模型的统一API——通过单个端点即可实现多提供商访问、成本追踪、自动故障转移和SDK兼容性。
基础URL:
https://llm.bankr.bot
| 控制台: bankr.bot/llm | API密钥: bankr.bot/api

Key Concepts

核心概念

  • Uses your
    llmKey
    if configured, otherwise falls back to your API key
  • LLM credits (USD) and trading wallet (crypto) are completely separate balances — having crypto does NOT give you LLM credits
  • New accounts start with $0 LLM credits — top up via
    bankr llm credits add 25
    or at bankr.bot/llm?tab=credits before making any LLM calls, or you will get a 402 error
  • Check credits:
    bankr llm credits
    | Top up:
    bankr llm credits add <amount>
    | Auto top-up:
    bankr llm credits auto --enable --amount 25 --tokens USDC
  • 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
    )
  • 如果配置了
    llmKey
    则使用该密钥,否则回退到API密钥
  • **LLM信用(美元)交易钱包(加密货币)**是完全独立的余额——持有加密货币不会自动获得LLM信用
  • 新账户初始LLM信用为0美元——进行LLM调用前需要通过
    bankr llm credits add 25
    或访问bankr.bot/llm?tab=credits充值,否则会返回402错误
  • 查询信用:
    bankr llm credits
    | 充值:
    bankr llm credits add <amount>
    | 自动充值:
    bankr llm credits auto --enable --amount 25 --tokens USDC
  • 在OpenClaw配置中,模型ID需要添加
    bankr/
    前缀(例如
    bankr/claude-sonnet-4.6
    )。直接调用API时使用原生ID即可(例如
    claude-sonnet-4.6

Quick Commands

常用命令

bash
bankr llm models                           # List available models
bankr llm credits                          # Check credit balance
bankr llm credits add 25                   # Top up $25 credits (USDC)
bankr llm credits auto --enable --amount 25 --tokens USDC  # Auto top-up
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
bash
bankr llm models                           # 列出可用模型
bankr llm credits                          # 查询信用余额
bankr llm credits add 25                   # 充值25美元信用(USDC支付)
bankr llm credits auto --enable --amount 25 --tokens USDC  # 开启自动充值
bankr llm setup openclaw --install         # 将Bankr提供商安装到OpenClaw
bankr llm setup claude                     # 打印Claude Code环境变量
bankr llm claude                           # 通过网关启动Claude Code

Model Deprecation

模型废弃

The gateway supports model deprecation with auto-redirect to replacement models. Deprecated models return
X-Model-Deprecated
and
X-Model-Replacement
response headers. Hard-deprecated models return HTTP 410 — update your model ID to the replacement indicated in the header.
For full details — setup paths, model list, provider config, SDK examples, key management, and troubleshooting — see:
Reference: references/llm-gateway.md
网关支持模型废弃功能,会自动重定向到替代模型。已废弃的模型会返回
X-Model-Deprecated
X-Model-Replacement
响应头。强制废弃的模型会返回HTTP 410——请根据头信息中的提示更新为替代模型ID。
完整详情(设置路径、模型列表、提供商配置、SDK示例、密钥管理和故障排查)请参见:
参考文档: references/llm-gateway.md

Capabilities Overview

功能概述

Trading Operations

交易操作

  • Token Swaps: Buy/sell/swap tokens across chains
  • Cross-Chain: Bridge tokens between chains
  • Limit Orders: Execute at target prices
  • Stop Loss: Automatic sell protection
  • DCA: Dollar-cost averaging strategies
  • TWAP: Time-weighted average pricing
Reference: references/token-trading.md
  • 代币兑换: 跨链买卖/兑换代币
  • 跨链: 链间桥接代币
  • 限价单: 按目标价格执行交易
  • 止损: 自动卖出保护
  • DCA: 美元成本平均策略
  • TWAP: 时间加权平均定价
参考文档: references/token-trading.md

Portfolio Management

投资组合管理

  • Check balances across all chains (
    bankr wallet portfolio
    or
    GET /wallet/portfolio
    )
  • View USD valuations with optional PnL tracking (
    --pnl
    or
    ?include=pnl
    )
  • View NFT holdings (
    --nfts
    or
    ?include=nfts
    )
  • Track holdings by token or chain
  • Real-time price updates
  • Multi-chain aggregation
  • Filter by chain:
    bankr wallet portfolio --chain base,solana
    or
    GET /wallet/portfolio?chains=base,solana
Reference: references/portfolio.md
  • 查看所有链上的余额(
    bankr wallet portfolio
    GET /wallet/portfolio
  • 查看美元估值,可选PnL追踪(
    --pnl
    ?include=pnl
  • 查看NFT持仓(
    --nfts
    ?include=nfts
  • 按代币或链追踪持仓
  • 实时价格更新
  • 多链数据聚合
  • 按链筛选:
    bankr wallet portfolio --chain base,solana
    GET /wallet/portfolio?chains=base,solana
参考文档: references/portfolio.md

Market Research

市场研究

  • Token prices and market data
  • Technical analysis (RSI, MACD, etc.)
  • Social sentiment analysis
  • Price charts
  • Trending tokens
  • Token comparisons
Reference: references/market-research.md
  • 代币价格和市场数据
  • 技术分析(RSI、MACD等)
  • 社交情绪分析
  • 价格图表
  • 热门代币
  • 代币对比
参考文档: references/market-research.md

Transfers

转账

  • Send to addresses, ENS, or social handles
  • Multi-chain support
  • Flexible amount formats
  • Social handle resolution (Twitter, Farcaster, Telegram)
Reference: references/transfers.md
  • 向地址、ENS或社交账号转账
  • 多链支持
  • 灵活的金额格式
  • 社交账号解析(Twitter、Farcaster、Telegram)
参考文档: references/transfers.md

NFT Operations

NFT操作

  • Browse and search collections
  • View floor prices and listings
  • Purchase NFTs via OpenSea
  • View your NFT portfolio
  • Transfer NFTs
  • Mint from supported platforms
Reference: references/nft-operations.md
  • 浏览和搜索合集
  • 查看地板价和挂单
  • 通过OpenSea购买NFT
  • 查看你的NFT投资组合
  • 转账NFT
  • 从支持的平台 mint NFT
参考文档: references/nft-operations.md

Polymarket Betting

Polymarket下注

  • Search prediction markets
  • Check odds
  • Place bets on outcomes
  • View positions
  • Redeem winnings
Reference: references/polymarket.md
  • 搜索预测市场
  • 查看赔率
  • 对结果下注
  • 查看持仓
  • 兑换奖金
参考文档: references/polymarket.md

Leverage Trading

杠杆交易

  • Long/short positions (up to 50x crypto, 100x forex/commodities)
  • Crypto, forex, and commodities
  • Stop loss and take profit
  • Position management via Avantis on Base
Reference: references/leverage-trading.md
  • 做多/做空仓位(加密货币最高50x,外汇/大宗商品最高100x)
  • 支持加密货币、外汇和大宗商品
  • 止损和止盈
  • 通过Base上的Avantis管理仓位
参考文档: references/leverage-trading.md

Token Deployment

代币部署

  • EVM (Base): Deploy ERC20 tokens via Clanker with customizable metadata and social links
  • Solana: Launch SPL tokens via Raydium LaunchLab with bonding curve and auto-migration to CPMM
  • Creator fee claiming on both chains
  • Fee Key NFTs for Solana (50% LP trading fees post-migration)
  • Optional fee recipient designation with 99.9%/0.1% split (Solana)
  • Both creator AND fee recipient can claim bonding curve fees (gas sponsored)
  • Optional vesting parameters (Solana)
  • Rate limits: 1/day standard, 10/day Bankr Club (gas sponsored within limits)
Reference: references/token-deployment.md
  • EVM(Base): 通过Clanker部署ERC20代币,支持自定义元数据和社交链接
  • Solana: 通过Raydium LaunchLab发布SPL代币,支持绑定曲线和自动迁移到CPMM
  • 两条链都支持创作者费用领取
  • Solana的Fee Key NFT(迁移后可获得50% LP交易费用)
  • Solana可选指定费用接收方,支持99.9%/0.1%分成
  • 创作者和费用接收方都可以领取绑定曲线费用(gas赞助)
  • Solana可选 vesting 参数
  • 速率限制:普通账户1次/天,Bankr Club会员10次/天(限额内gas赞助)
参考文档: references/token-deployment.md

Automation

自动化

  • Limit orders
  • Stop loss orders
  • DCA (dollar-cost averaging)
  • TWAP (time-weighted average price)
  • Scheduled commands
Reference: references/automation.md
  • 限价单
  • 止损单
  • DCA(美元成本平均)
  • TWAP(时间加权平均价格)
  • 定时命令
参考文档: references/automation.md

Arbitrary Transactions

任意交易

  • Submit raw EVM transactions with explicit calldata
  • Custom contract calls to any address
  • Execute pre-built calldata from other tools
  • Value transfers with data
Reference: references/arbitrary-transaction.md
  • 提交带有明确calldata的原始EVM交易
  • 对任意地址的自定义合约调用
  • 执行来自其他工具的预构建calldata
  • 带数据的价值转账
参考文档: references/arbitrary-transaction.md

Supported Chains

支持的链

ChainNative TokenBest ForGas Cost
BaseETHMemecoins, general tradingVery Low
PolygonPOLGaming, NFTs, frequent tradesVery Low
EthereumETHBlue chips, high liquidityHigh
SolanaSOLHigh-speed tradingMinimal
UnichainETHNewer L2 optionVery Low
World ChainETHUniswap V3/V4 swapsVery Low
ArbitrumETHDeFi, low-cost transactionsVery Low
BNB ChainBNBBSC ecosystem tradingLow
链名称原生代币适用场景Gas成本
BaseETH模因币、普通交易极低
PolygonPOL游戏、NFT、高频交易极低
EthereumETH蓝筹资产、高流动性
SolanaSOL高速交易极低
UnichainETH新型L2选项极低
World ChainETHUniswap V3/V4兑换极低
ArbitrumETHDeFi、低成本交易极低
BNB ChainBNBBSC生态交易

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 (
walletApiEnabled
,
agentApiEnabled
,
tokenLaunchApiEnabled
,
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: New keys default to
readOnly: true
. This filters all write tools (swaps, transfers, staking, token launches, etc.) from agent sessions. The
/wallet/sign
,
/wallet/submit
, and
/wallet/transfer
write endpoints return 403. Use
--read-write
during login or toggle in the web settings to disable. 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:
  • Store keys in environment variables (
    BANKR_API_KEY
    ,
    BANKR_LLM_KEY
    ), never in source code
  • Add
    ~/.bankr/
    and
    .env
    to
    .gitignore
    — the CLI stores credentials in
    ~/.bankr/config.json
  • Test with small amounts on low-cost chains (Base, Polygon) before production use
  • Use
    waitForConfirmation: true
    with
    /wallet/submit
    — transactions execute immediately with no confirmation prompt
  • Rotate keys periodically and revoke immediately if compromised at bankr.bot/api
Reference: references/safety.md
专用Agent钱包: 构建自主Agent时,请创建独立的Bankr账户,不要使用个人钱包。这样可以隔离Agent资金——如果密钥泄露,仅会暴露Agent钱包。仅向其转入有限的资金,必要时再补充。
API密钥类型: Bankr使用单一密钥格式(
bk_...
),通过功能标记区分权限(
walletApiEnabled
agentApiEnabled
tokenLaunchApiEnabled
llmGatewayEnabled
)。你可以通过
bankr config set llmKey
BANKR_LLM_KEY
可选配置独立的LLM网关密钥——当你需要为Agent和LLM访问设置独立的撤销权限或不同权限时非常有用。
只读API密钥: 新密钥默认开启
readOnly: true
。这会从Agent会话中过滤所有可写工具(兑换、转账、质押、代币发布等)。
/wallet/sign
/wallet/submit
/wallet/transfer
可写端点会返回403。登录时使用
--read-write
参数或在网页设置中关闭只读模式即可。非常适合监控机器人和研究类Agent使用。
IP白名单: 在API密钥上设置
allowedIps
可以限制仅特定IP可以访问。非白名单IP的请求会在鉴权层直接返回403拒绝。
速率限制: 普通账户100条消息/天,Bankr Club会员1000条消息/天,或自定义单密钥限额。采用滚动窗口,从第一条消息开始24小时后重置。LLM网关采用信用制。
密钥安全规则:
  • 将密钥存储在环境变量中(
    BANKR_API_KEY
    BANKR_LLM_KEY
    ),永远不要写入源代码
  • ~/.bankr/
    .env
    添加到
    .gitignore
    中——CLI会将凭证存储在
    ~/.bankr/config.json
  • 生产使用前先在低成本链(Base、Polygon)上用小额资金测试
  • 调用
    /wallet/submit
    时使用
    waitForConfirmation: true
    ——交易无需确认会立即执行
  • 定期轮换密钥,一旦泄露立即到bankr.bot/api撤销
参考文档: references/safety.md

Common Patterns

常用模式

Check Before Trading

交易前检查

bash
undefined
bash
undefined

Check balance

检查余额

bankr wallet portfolio --chain base
bankr wallet portfolio --chain base

Check price

查询价格

bankr agent prompt "What's the current price of PEPE?"
bankr agent prompt "What's the current price of PEPE?"

Then trade

然后交易

bankr agent prompt "Buy $20 of PEPE on Base"
undefined
bankr agent prompt "Buy $20 of PEPE on Base"
undefined

Portfolio Review

投资组合查看

bash
undefined
bash
undefined

Direct portfolio check (no AI agent, instant response)

直接查询投资组合(无AI Agent处理,即时响应)

bankr wallet portfolio bankr wallet portfolio --pnl # Include profit/loss data bankr wallet portfolio --nfts # Include NFT holdings bankr wallet portfolio --all # PnL + NFTs bankr wallet portfolio --chain base bankr wallet portfolio --chain base,solana bankr wallet portfolio --json
bankr wallet portfolio bankr wallet portfolio --pnl # 包含盈亏数据 bankr wallet portfolio --nfts # 包含NFT持仓 bankr wallet portfolio --all # PnL + NFTs bankr wallet portfolio --chain base bankr wallet portfolio --chain base,solana bankr wallet portfolio --json

Via AI agent (natural language, richer context)

通过AI Agent查询(自然语言,更丰富的上下文)

bankr agent prompt "Show my complete portfolio"
bankr agent prompt "Show my complete portfolio"

Chain-specific

指定链查询

bankr agent prompt "What tokens do I have on Base?"
bankr agent prompt "What tokens do I have on Base?"

Token-specific

指定代币查询

bankr agent prompt "Show my ETH across all chains"
undefined
bankr agent prompt "Show my ETH across all chains"
undefined

Set Up Automation

设置自动化

bash
undefined
bash
undefined

DCA strategy

DCA策略

bankr agent prompt "DCA $100 into ETH every week"
bankr agent prompt "DCA $100 into ETH every week"

Stop loss protection

止损保护

bankr agent prompt "Set stop loss for my ETH at $2,500"
bankr agent prompt "Set stop loss for my ETH at $2,500"

Limit order

限价单

bankr agent prompt "Buy ETH if price drops to $3,000"
undefined
bankr agent prompt "Buy ETH if price drops to $3,000"
undefined

Market Research

市场研究

bash
undefined
bash
undefined

Token discovery

代币发现

bankr tokens search PEPE bankr tokens info USDC
bankr tokens search PEPE bankr tokens info USDC

Price and analysis

价格和分析

bankr agent prompt "Do technical analysis on ETH"
bankr agent prompt "Do technical analysis on ETH"

Trending tokens

热门代币

bankr agent prompt "What tokens are trending on Base?"
bankr agent prompt "What tokens are trending on Base?"

Compare tokens

代币对比

bankr agent prompt "Compare ETH vs SOL"
undefined
bankr agent prompt "Compare ETH vs SOL"
undefined

API Workflow

API工作流

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 agent 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 agent status <jobId>
and
bankr agent cancel <jobId>
.
For details on the API structure, job states, polling strategy, and error handling, see:
Reference: references/api-workflow.md
Bankr采用异步的基于任务的API:
  1. 提交 —— 发送提示(可选携带
    threadId
    ),获取任务ID和线程ID
  2. 轮询 —— 每2秒查询一次状态
  3. 完成 —— 任务结束后处理结果
  4. 继续 —— 复用
    threadId
    进行多轮对话
bankr agent prompt
命令会自动处理该流程。直接使用REST API时需要自行实现轮询循环(参见上方选项2或下方参考文档)。通过CLI手动控制任务可以使用
bankr agent status <jobId>
bankr agent cancel <jobId>
关于API结构、任务状态、轮询策略和错误处理的详情请参见:
参考文档: references/api-workflow.md

Synchronous Endpoints (Wallet API)

同步端点(钱包API)

For direct signing and transaction submission, use the Wallet API synchronous endpoints:
  • POST /wallet/sign - Sign messages, typed data, or transactions without broadcasting
  • POST /wallet/submit - Submit raw transactions directly to the blockchain
  • POST /wallet/transfer - Transfer tokens with symbol resolution and multi-chain support
These endpoints return immediately (no polling required) and are ideal for:
  • Authentication flows (sign messages)
  • Gasless approvals (sign EIP-712 permits)
  • Pre-built transactions (submit raw calldata)
  • Programmatic token transfers
Reference: references/sign-submit-api.md
如需直接签名和提交交易,请使用钱包API同步端点:
  • POST /wallet/sign - 签名消息、结构化数据或交易,不上链
  • POST /wallet/submit - 直接向区块链提交原始交易
  • POST /wallet/transfer - 转账代币,支持符号解析和多链
这些端点会立即返回结果(无需轮询),非常适合以下场景:
  • 鉴权流程(签名消息)
  • 无gas授权(签名EIP-712 permit)
  • 预构建交易(提交原始calldata)
  • 程序化代币转账
参考文档: references/sign-submit-api.md

Error Handling

错误处理

Common issues and fixes:
  • Authentication errors → Run
    bankr login
    or check
    bankr whoami
    (CLI), or verify your
    X-API-Key
    header (REST API)
  • Insufficient balance → Add funds or reduce amount
  • Token not found → Verify symbol and chain
  • Transaction reverted → Check parameters and balances
  • Rate limiting → Wait and retry
For comprehensive error troubleshooting, setup instructions, and debugging steps, see:
Reference: references/error-handling.md
常见问题和修复方案:
  • 鉴权错误 → 运行
    bankr login
    或检查
    bankr whoami
    (CLI),或者验证你的
    X-API-Key
    请求头(REST API)
  • 余额不足 → 充值或减少金额
  • 未找到代币 → 验证符号和链
  • 交易回滚 → 检查参数和余额
  • 速率限制 → 等待后重试
全面的错误排查、设置说明和调试步骤请参见:
参考文档: 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.
  1. 永远不要分享你的API密钥或LLM密钥
  2. 为自主Agent使用独立的、资金有限的专用Agent钱包
  3. 为监控和仅研究用途的Agent使用只读API密钥
  4. 为IP固定的服务端Agent设置IP白名单
  5. 大额转账前验证地址
  6. 杠杆交易使用止损
  7. 将密钥存储在环境变量中,不要写入源代码——将
    ~/.bankr/
    添加到
    .gitignore
全面的安全指南请参见references/safety.md

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
  1. 交易前检查余额
  2. 小众代币请指定链
  3. 考虑gas成本(小额交易使用Base/Polygon)

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
  1. 先用小额资金测试自动化策略
  2. 定期查看活跃订单
  3. 设置合理的价格目标
  4. 杠杆交易始终使用止损
  5. 监控执行情况并按需调整

Tips for Success

成功贴士

For New Users

新用户

  • Start with balance checks and price queries
  • Test with $5-10 trades first
  • Use Base for lower fees
  • Enable trading confirmations initially
  • Learn one feature at a time
  • 从余额查询和价格查询开始
  • 先用5-10美元的小额交易测试
  • 使用Base链降低手续费
  • 初始开启交易确认
  • 一次学习一个功能

For Experienced Users

资深用户

  • Leverage automation for strategies
  • Use multiple chains for diversification
  • Combine DCA with stop losses
  • Explore advanced features (leverage, Polymarket)
  • Monitor gas costs across chains
  • 利用自动化实现策略
  • 使用多链分散投资
  • 结合DCA和止损
  • 探索高级功能(杠杆、Polymarket)
  • 跨链监控gas成本

Prompt Examples by Category

按类别划分的提示示例

Trading

交易

  • "Buy $50 of ETH on Base"
  • "Swap 0.1 ETH for USDC"
  • "Sell 50% of my PEPE"
  • "Bridge 100 USDC from Polygon to Base"
  • "Buy $50 of ETH on Base"
  • "Swap 0.1 ETH for USDC"
  • "Sell 50% of my PEPE"
  • "Bridge 100 USDC from Polygon to Base"

Portfolio

投资组合

  • bankr wallet portfolio
    (direct, no AI processing — hides low-value tokens by default)
  • bankr wallet portfolio --pnl
    (include profit/loss)
  • bankr wallet portfolio --nfts
    (include NFT holdings)
  • bankr wallet portfolio --all
    (PnL + NFTs)
  • bankr wallet portfolio --chain base
    (single chain)
  • "Show my portfolio"
  • "What's my ETH balance?"
  • "Total portfolio value"
  • "Holdings on Base"
  • bankr wallet portfolio
    (直接查询,无AI处理——默认隐藏低价值代币)
  • bankr wallet portfolio --pnl
    (包含盈亏)
  • bankr wallet portfolio --nfts
    (包含NFT持仓)
  • bankr wallet portfolio --all
    (PnL + NFTs)
  • bankr wallet portfolio --chain base
    (单链查询)
  • "Show my portfolio"
  • "What's my ETH balance?"
  • "Total portfolio value"
  • "Holdings on Base"

Market Research

市场研究

  • "What's the price of Bitcoin?"
  • "Analyze ETH price"
  • "Trending tokens on Base"
  • "Compare UNI vs SUSHI"
  • "What's the price of Bitcoin?"
  • "Analyze ETH price"
  • "Trending tokens on Base"
  • "Compare UNI vs SUSHI"

Transfers

转账

  • "Send 0.1 ETH to vitalik.eth"
  • "Transfer $20 USDC to @friend"
  • "Send 50 USDC to 0x123..."
  • "Send 0.1 ETH to vitalik.eth"
  • "Transfer $20 USDC to @friend"
  • "Send 50 USDC to 0x123..."

NFTs

NFT

  • "Show Bored Ape floor price"
  • "Buy cheapest Pudgy Penguin"
  • "Show my NFTs"
  • "Show Bored Ape floor price"
  • "Buy cheapest Pudgy Penguin"
  • "Show my NFTs"

Polymarket

Polymarket

  • "What are the odds Trump wins?"
  • "Bet $10 on Yes for [market]"
  • "Show my Polymarket positions"
  • "What are the odds Trump wins?"
  • "Bet $10 on Yes for [market]"
  • "Show my Polymarket positions"

Leverage

杠杆

  • "Open 5x long on ETH with $100"
  • "Short BTC 10x with stop loss at $45k"
  • "Show my Avantis positions"
  • "Open 5x long on ETH with $100"
  • "Short BTC 10x with stop loss at $45k"
  • "Show my Avantis positions"

Automation

自动化

  • "DCA $100 into ETH weekly"
  • "Set limit order to buy ETH at $3,000"
  • "Stop loss for all holdings at -20%"
  • "DCA $100 into ETH weekly"
  • "Set limit order to buy ETH at $3,000"
  • "Stop loss for all holdings at -20%"

Token Deployment

代币部署

Solana (LaunchLab):
  • "Launch a token called MOON on Solana"
  • "Launch a token called FROG and give fees to @0xDeployer"
  • "Deploy SpaceRocket with symbol ROCK"
  • "Launch BRAIN and route fees to 7xKXtg..."
  • "How much fees can I claim for MOON?"
  • "Claim my fees for MOON" (works for creator or fee recipient)
  • "Show my Fee Key NFTs"
  • "Claim my fee NFT for ROCKET" (post-migration)
  • "Transfer fees for MOON to 7xKXtg..."
EVM (Clanker):
  • "Deploy a token called BankrFan with symbol BFAN on Base"
  • "Claim fees for my token MTK"
Solana(LaunchLab):
  • "Launch a token called MOON on Solana"
  • "Launch a token called FROG and give fees to @0xDeployer"
  • "Deploy SpaceRocket with symbol ROCK"
  • "Launch BRAIN and route fees to 7xKXtg..."
  • "How much fees can I claim for MOON?"
  • "Claim my fees for MOON"(创作者或费用接收方都可用)
  • "Show my Fee Key NFTs"
  • "Claim my fee NFT for ROCKET"(迁移后可用)
  • "Transfer fees for MOON to 7xKXtg..."
EVM(Clanker):
  • "Deploy a token called BankrFan with symbol BFAN on Base"
  • "Claim fees for my token MTK"

Arbitrary Transactions

任意交易

  • "Submit this transaction: {to: 0x..., data: 0x..., value: 0, chainId: 8453}"
  • "Execute this calldata on Base: {...}"
  • "Send raw transaction with this JSON: {...}"
  • "Submit this transaction: {to: 0x..., data: 0x..., value: 0, chainId: 8453}"
  • "Execute this calldata on Base: {...}"
  • "Send raw transaction with this JSON: {...}"

Transfers (Direct)

直接转账

Transfer tokens via CLI or Wallet API without AI processing:
bash
undefined
无需AI处理,直接通过CLI或钱包API转账代币:
bash
undefined

CLI — token symbol resolution built in

CLI —— 内置代币符号解析能力

bankr wallet transfer --to vitalik.eth --token USDC --amount 50 --chain base bankr wallet transfer --to 0x1234... --token ETH --amount 0.1
bankr wallet transfer --to vitalik.eth --token USDC --amount 50 --chain base bankr wallet transfer --to 0x1234... --token ETH --amount 0.1

REST API

REST API

curl -X POST "https://api.bankr.bot/wallet/transfer"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"to": "vitalik.eth", "token": "USDC", "amount": "50", "chain": "base"}'
undefined
curl -X POST "https://api.bankr.bot/wallet/transfer"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"to": "vitalik.eth", "token": "USDC", "amount": "50", "chain": "base"}'
undefined

Sign API (Synchronous)

签名API(同步)

Direct message signing without AI processing:
bash
undefined
无需AI处理,直接签名消息:
bash
undefined

Sign a plain text message

签名纯文本消息

curl -X POST "https://api.bankr.bot/wallet/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "personal_sign", "message": "Hello, Bankr!"}'
curl -X POST "https://api.bankr.bot/wallet/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)

签名EIP-712结构化数据(permit、订单)

curl -X POST "https://api.bankr.bot/wallet/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "eth_signTypedData_v4", "typedData": {...}}'
curl -X POST "https://api.bankr.bot/wallet/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/wallet/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "eth_signTransaction", "transaction": {"to": "0x...", "chainId": 8453}}'
undefined
curl -X POST "https://api.bankr.bot/wallet/sign"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{"signatureType": "eth_signTransaction", "transaction": {"to": "0x...", "chainId": 8453}}'
undefined

Submit API (Synchronous)

提交API(同步)

Direct transaction submission without AI processing:
bash
undefined
无需AI处理,直接提交交易:
bash
undefined

Submit a raw transaction

提交原始交易

curl -X POST "https://api.bankr.bot/wallet/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](references/sign-submit-api.md)
curl -X POST "https://api.bankr.bot/wallet/submit"
-H "X-API-Key: $API_KEY"
-H "Content-Type: application/json"
-d '{ "transaction": {"to": "0x...", "chainId": 8453, "value": "1000000000000000000"}, "waitForConfirmation": true }'

**参考文档**: [references/sign-submit-api.md](references/sign-submit-api.md)

Resources

资源

Troubleshooting

故障排查

CLI Not Found

找不到CLI命令

bash
undefined
bash
undefined

Verify installation

验证安装

which bankr
which bankr

Reinstall if needed

必要时重新安装

bun install -g @bankr/cli
undefined
bun install -g @bankr/cli
undefined

Authentication Issues

鉴权问题

CLI:
bash
undefined
CLI:
bash
undefined

Check current auth

检查当前鉴权状态

bankr whoami
bankr whoami

Re-authenticate

重新鉴权

bankr login
bankr login

Check LLM key specifically

单独检查LLM密钥

bankr config get llmKey

**REST API:**
```bash
bankr config get llmKey

**REST API:**
```bash

Test your API key

测试API密钥

curl -s "https://api.bankr.bot/_health" -H "X-API-Key: $BANKR_API_KEY"
undefined
curl -s "https://api.bankr.bot/_health" -H "X-API-Key: $BANKR_API_KEY"
undefined

API Errors

API错误

See references/error-handling.md for comprehensive troubleshooting.
全面的故障排查请参见references/error-handling.md

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 agent 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 wallet portfolio
) to see what's possible, then try a small $5-10 trade on Base to get familiar with the flow.

  1. 检查CLI输出或API响应中的错误信息
  2. 运行
    bankr whoami
    验证鉴权(CLI)或调用
    /_health
    测试(REST API)
  3. 查阅相关参考文档
  4. 先用简单查询测试(
    bankr agent prompt "What is my balance?"
    POST /agent/prompt

专业提示: 最常见的问题是没有为代币指定链。有疑问时,始终在提示中包含"on Base"或"on Ethereum"。
安全提示: 请妥善保管你的API密钥。永远不要将配置文件提交到版本控制。仅用你可以承受损失的金额进行交易。
快速上手: 先查询你的投资组合(
bankr wallet portfolio
)了解可用功能,然后在Base上尝试一笔5-10美元的小额交易熟悉流程。

Profile Management

个人资料管理

Agents can create and manage public profile pages at bankr.bot/agents. Profiles showcase project metadata, team info, token data (chart + market cap), weekly fee revenue, shipped products, and a Twitter activity feed.
Eligibility: You must have deployed a token through Bankr (Doppler or Clanker) or be a fee beneficiary on the token to create a profile. The token address is verified against your deployment history and beneficiary records.
Agent可以在bankr.bot/agents创建并管理公开个人资料页面。资料会展示项目元数据、团队信息、代币数据(图表+市值)、周手续费收入、发布的产品和Twitter动态流。
资格要求: 你必须通过Bankr部署过代币(Doppler或Clanker),或者是代币的费用受益人才可以创建个人资料。系统会根据你的部署历史和受益人记录验证代币地址。

Profile Lifecycle

资料生命周期

  1. Deploy a token through Bankr (required prerequisite)
  2. Create a profile via CLI or REST API with the token address
  3. Populate metadata (team, products, revenue sources)
  4. Admin approval — profiles start with
    approved: false
    and become publicly visible after admin approval
  5. Maintain — post project updates, keep products and revenue sources current
  1. 通过Bankr部署代币(必要前提)
  2. 通过CLI或REST API创建资料,传入代币地址
  3. 填写元数据(团队、产品、收入来源)
  4. 管理员审核 —— 资料初始状态为
    approved: false
    ,经管理员审核通过后才会公开可见
  5. 维护 —— 发布项目更新,保持产品和收入来源信息为最新

CLI Commands

CLI命令

bash
bankr agent profile                     # View own profile
bankr agent profile create              # Interactive creation wizard
bankr agent profile create --name "My Agent" --token 0x... --twitter myagent
bankr agent profile update --description "Updated description"
bankr agent profile delete              # Delete own profile (with confirmation)
bankr agent profile add-update          # Add a project update
bankr agent profile add-update --title "v2 Launch" --content "Shipped new features"
All commands support
--json
for structured output (enables programmatic use).
bash
bankr agent profile                     # 查看自己的资料
bankr agent profile create              # 交互式创建向导
bankr agent profile create --name "My Agent" --token 0x... --twitter myagent
bankr agent profile update --description "Updated description"
bankr agent profile delete              # 删除自己的资料(需要确认)
bankr agent profile add-update          # 添加项目更新
bankr agent profile add-update --title "v2 Launch" --content "Shipped new features"
所有命令都支持
--json
参数输出结构化数据(支持程序化使用)。

REST API Endpoints

REST API端点

All endpoints require API key authentication via
X-API-Key
header.
MethodPathDescription
GET
/agent/profile
Get own profile
POST
/agent/profile
Create profile
PUT
/agent/profile
Update profile fields
DELETE
/agent/profile
Delete own profile
POST
/agent/profile/update
Add a project update
Create profile:
bash
curl -X POST "https://api.bankr.bot/agent/profile" \
  -H "X-API-Key: $BANKR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"projectName": "My Agent", "tokenAddress": "0x...", "description": "An AI trading agent"}'
Add a project update:
bash
curl -X POST "https://api.bankr.bot/agent/profile/update" \
  -H "X-API-Key: $BANKR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "v2 Launch", "content": "Shipped swap optimization and new UI"}'
See references/agent-profiles.md for the full integration guide.
所有端点都需要通过
X-API-Key
头进行API密钥鉴权。
请求方法路径描述
GET
/agent/profile
获取自己的资料
POST
/agent/profile
创建资料
PUT
/agent/profile
更新资料字段
DELETE
/agent/profile
删除自己的资料
POST
/agent/profile/update
添加项目更新
创建资料:
bash
curl -X POST "https://api.bankr.bot/agent/profile" \
  -H "X-API-Key: $BANKR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"projectName": "My Agent", "tokenAddress": "0x...", "description": "An AI trading agent"}'
添加项目更新:
bash
curl -X POST "https://api.bankr.bot/agent/profile/update" \
  -H "X-API-Key: $BANKR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "v2 Launch", "content": "Shipped swap optimization and new UI"}'
完整集成指南请参见references/agent-profiles.md