Claude Code

Run Claude Code on bInference and connect it to Binance, from key to first trade.

Get a bInference key

On binference.io, sign in with your wallet and press Create key. Turn on Limit spending and set a daily limit: it caps what this agent can spend on AI, however long it runs.

Point Claude Code at bInference

Add these to ~/.claude/settings.json, so every Claude Code session uses them:

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://binference.io/api",
    "ANTHROPIC_AUTH_TOKEN": "binf_...",
    "ANTHROPIC_API_KEY": ""
  }
}

ANTHROPIC_API_KEY stays empty so Claude Code never falls back to another key. To pick the model, add "ANTHROPIC_MODEL": "anthropic/claude-sonnet-5.5". Any model on Models that handles tools well works.

Add the Binance MCP Server

In Terminal (PowerShell on Windows), run Binance's command exactly as written:

claude mcp add binance-mcp-server --transport http https://agent.binance.com/mcp/agentic

Then start Claude Code, open the /mcp menu, select binance-mcp-server and authenticate. Binance opens its own sign-in and asks which scopes to grant. Start with the fewest:

ScopeLets the agent
Market dataRead prices, order books, candles and funding. No sign-in needed
AccountRead the Agentic sub-account's balances and positions, and optionally view your main account
TradeTrade Spot, Margin, Convert and Futures, as far as your account allows
TransferMove funds between wallets inside the Agentic sub-account only

There is no withdrawal scope: the agent can never send funds out.

Never paste the address into a chat

Don't ask Claude to install the server for you, and don't open the address in a browser. Binance asks you to run the command above yourself.

Check both connections

Ask Claude Code:

Use the Binance MCP Server to show the current BTCUSDT price and 24-hour change.

The answer should show the Binance tool being used and live BTCUSDT data. That one question used both sides: the model ran on bInference, the price came from Binance. The call shows up on your Calls page within a minute.

Fund the Agentic sub-account

Your agent trades in its own sub-account, created the first time you authorize. It starts empty, and only you can fund it:

  1. On binance.com, go to Profile → Dashboard → Sub-account → Asset Management.
  2. Press Transfer and move assets from your main account to the Agentic sub-account. It's instant and free.

Put in only what you're willing to let the agent trade.

Your first session

You askWhat happens
"What's BTCUSDT trading at, and how's it moved over 24h?"Reads live data at once. Nothing to confirm
"What do I have in my Agentic account?"Reads the sub-account's balances across wallets
"Buy $100 of BNB at market on spot."Restates the order and waits for your yes. This step spends real funds
"Did that fill? What's my BNB balance now?"Checks the order and the new balance

Every order, cancel and transfer asks for your confirmation first. Reads run straight away.

Add on-chain trading

To let the same Claude Code session swap tokens on BNB Chain, Ethereum, Base or Solana, add the Agentic Wallet skill. See Agentic Wallet.

Good to know

  • Long sessions cost more per turn. Claude Code sends the whole conversation, plus Binance's tool list, on every turn. Run /compact when a session grows long. See What it costs.
  • Busy models: a busy model answers 529 overloaded_error and Claude Code moves to its fallback model on its own.
  • Big pasted images can push a request past 4 MB (413). Run /compact or /clear.
  • Two different "insufficient balance" errors. A trade that fails for funds means the Binance sub-account is empty. A 402 insufficient_balance from bInference means the AI budget is. See Troubleshooting.

On this page