--- name: bankr description: AI-powered crypto trading agent, wallet API, and LLM gateway via natural language. Use when the user wants to trade crypto, trade tokenized stocks and ETFs (spot or leveraged), check portfolio balances (with PnL and NFTs), view token prices, search tokens, research token holders, transfer crypto, manage NFTs, use leverage (Hyperliquid or Avantis), bet on Polymarket, deploy tokens, check and claim onchain incentive rewards (Merkl), set up automated trading, sign and submit raw transactions, call or deploy x402 paid API endpoints, browse the web, store and query files on their wallet's filesystem, or access LLM models through the Bankr LLM gateway funded by your Bankr wallet — including zero-data-retention and TEE-private inference tiers, plus topping up and sending LLM credits to another Bankr user. Supports Base, Ethereum, Polygon, Solana, Unichain, World Chain, Arbitrum, BNB Chain, and Robinhood Chain. 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. 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 ## 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. ```bash # 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 --key-name "My Agent" ``` This creates a wallet, accepts the Terms of Service, and generates an API key — no browser needed. **Completing step 2 accepts the [Terms of Service](https://bankr.bot/terms) on the user's behalf** (headless login implies `--accept-terms`), so share that link and tell the user that logging in means accepting the Terms before you run it — see "First-Time Setup" below. New keys get the same defaults as the [bankr.bot/api-keys](https://bankr.bot/api-keys) create form: Wallet API, Agent API, and Token Launch on, read-write, LLM gateway off. Before running step 2, ask the user which of those to change (`--no-wallet-api`, `--no-agent-api`, `--no-token-launch`, `--read-only`, `--llm`) and their preferred key name. > **MFA-enabled accounts get a browser step.** Minting an API key requires a passkey step-up when MFA is on, and a passkey can't run in a terminal. Step 2 prints an approval link (`https://bankr.bot/mfa/confirm/`), opens it when interactive, and waits up to **five minutes** for the user to verify with their passkey there, then continues. Show the user the link and wait; don't retry step 2. If it expires, the CLI exits with `MFA_STEP_UP_REQUIRED` guidance — fall back to Option B: create the key in the Bankr Terminal, then `bankr login --api-key bk_...`. Requires **@bankr/cli 0.3.38+** (`bankr update`); older versions fail step 2 outright on MFA accounts. > **Step 2 is single-use.** The OTP is consumed when it is verified. From **@bankr/cli 0.3.39+** the CLI retries the OTP verify, wallet and terms steps on its own after a dropped connection or a gateway 5xx (an invalid code or a 429 is not retried), so never re-run step 2 with the same code — if it fails outright, start again from step 1 to get a fresh code. **Option B: Bankr Terminal** 1. Visit [bankr.bot/api-keys](https://bankr.bot/api-keys) 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. ## Option 1: Bankr CLI (Recommended) ### Install ```bash bun install -g @bankr/cli ``` Or with npm: ```bash 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. If the user has MFA enabled on their Bankr account, step 2 adds a browser approval: the CLI prints a `bankr.bot/mfa/confirm/...` link and waits (up to five minutes) for the user to verify with their passkey there. Surface that link to the user as soon as it appears and keep the command running — the CLI continues on its own once approved. If the user can't approve in time, use "Login with existing API key" below instead. **Step 1 — Send verification code** ```bash bankr login 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. **Terms of Service (REQUIRED)** — Share the [Terms of Service](https://bankr.bot/terms) link and state plainly that **by completing this login the user accepts Bankr's Terms of Service**. Headless login accepts the Terms as part of logging in (no flag needed), so the user's go-ahead is the only gate. Say something like: "By completing this login you accept Bankr's Terms of Service (https://bankr.bot/terms). Send me the code to continue, or tell me if you don't accept and I'll stop here." **If the user does not accept, stop — do not run step 2.** 3. **Which APIs do they need?** - **Wallet API** — enabled by default, use `--no-wallet-api` to disable - **Agent API** — enabled by default (AI-powered prompts and natural language operations), use `--no-agent-api` to disable - **Token Launch** — enabled by default, use `--no-token-launch` to disable - **Read-only?** — new keys are read-write by default. Add `--read-only` for a research or monitoring key that must never transact 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 declined the Terms of Service or hasn't answered** — ask again if needed. Running step 2 accepts the Terms on their behalf: ```bash # Default key: wallet + agent + token launch, read-write (AI can execute transactions) bankr login email --code --key-name "Trading Agent" # Same, plus LLM gateway access bankr login email --code --key-name "My Agent" --llm # Research agent: read-only (prices, balances, research — no transactions), no token launch bankr login email --code --key-name "Research Agent" --read-only --no-token-launch # Wallet API only (no AI prompts): direct /wallet/* calls from your own code bankr login email --code --key-name "Wallet Client" --no-agent-api --no-token-launch # LLM-only (no wallet, no token launch) bankr login email --code --key-name "LLM Client" --no-wallet-api --no-token-launch --llm ``` #### Login options reference | Option | Description | |--------|-------------| | `--code ` | OTP code received via email (step 2) | | `--accept-terms` | Accept [Terms of Service](https://bankr.bot/terms) without prompting. Implied by headless login (`--code` / `--ni`) on **@bankr/cli 0.3.39+**, where it is a no-op kept for older scripts; on 0.3.38 and older, new accounts must still pass it or step 2 fails | | `--key-name ` | Display name for the API key (e.g. "My Agent"). Prompted if omitted; headless runs default to `CLI--