BNB Smart Chain · BEP-20 · PancakeSwap

BNB Chain API
for AI Agents

The fastest path for autonomous agents to move value on BNB Smart Chain. Get a BSC address, check BNB and BEP-20 balances, swap tokens cross-chain — all through a single REST API. Ultra-low fees, 3-second blocks, EVM-compatible.

~$0.01
avg. tx fee
3s
block time
56
BSC chain ID
EVM
compatible

Purpose-built for
high-frequency operations.

AI agents transact frequently and on tight margins. BNB Smart Chain's fee structure and throughput make it the optimal EVM chain for agent-driven workflows at scale.

💰

Ultra-low fees

$0.001–$0.05 per transaction. An agent executing 100 swaps a day spends under $5 in gas. On Ethereum mainnet, the same activity would cost hundreds of dollars.

Fast blocks

BSC produces a new block every 3 seconds using Proof of Staked Authority. Most agent transactions confirm in a single block — no waiting, no retry loops.

🎍

Large DeFi ecosystem

PancakeSwap, Venus, and dozens of other protocols give agents access to deep liquidity, stablecoin lending, and token swaps without routing to another chain.

🔗

EVM-compatible

Same 0x addresses as Ethereum. Your agent's BSC address is identical to its ETH address — one mnemonic, one wallet, multiple networks via chain ID.


Three endpoints cover
everything on BSC.

Purple Flea exposes a clean REST API for BNB Chain. No node management, no ABI encoding, no nonce tracking — just HTTP calls.

GET

/v1/wallet/address?chain=bsc

Returns the agent's BNB Smart Chain address. Same address as Ethereum — derived from BIP-44 path m/44'/60'/0'/0/0 with chain ID 56.

response.json
{ "address": "0x742d35Cc6634C0532925a3b8D4C9A3a7b7D8E9f1", "chain": "bsc", "chain_id": 56 }
GET

/v1/wallet/balance?chain=bsc

Returns native BNB balance plus all BEP-20 token balances in a single response. No need to call individual token contracts.

response.json
{ "address": "0x742d35Cc...", "chain": "bsc", "bnb": "3.847", "usdt": "412.50", "usdc": "0.00", "cake": "15.2", "busd": "100.00" }
POST

/v1/wallet/swap

Swap BNB or any BEP-20 token cross-chain. Route BNB to ETH, BSC USDT to Solana USDC, or any combination. Purple Flea handles bridging and routing automatically.

request.json
// Swap BNB to USDT on BSC (PancakeSwap) { "from_chain": "bsc", "from_token": "bnb", "to_chain": "bsc", "to_token": "usdt", "amount": "1.0", "slippage_bps": 50 } // Cross-chain: BNB → Solana USDC { "from_chain": "bsc", "from_token": "bnb", "to_chain": "solana", "to_token": "usdc", "amount": "0.5" } // Cross-chain: BNB → Ethereum ETH { "from_chain": "bsc", "from_token": "bnb", "to_chain": "eth", "to_token": "eth", "amount": "2.0" }

Major tokens by symbol.
Any token by contract.

Purple Flea maintains a built-in registry of BEP-20 tokens with preloaded ABIs and decimals. Reference tokens by symbol or pass any BSC contract address.

BNB
USDT
USDC
BUSD
CAKE
WBNB
BTCB
ETH
XRP
ADA
DOT
LINK
Any contract
bep20_send.json
// Send USDT by symbol (built-in) { "chain": "bsc", "token": "usdt", "to": "0xWorkerAgent...", "amount": "50.00" } // Send CAKE (PancakeSwap governance token) { "chain": "bsc", "token": "cake", "to": "0xRecipient...", "amount": "10.0" } // Send any BEP-20 by contract address { "chain": "bsc", "token_contract": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82", "to": "0xRecipient...", "amount": "100.0" }

USDT (BEP-20) is one of the most liquid stablecoins on BSC and costs under $0.03 to transfer. Agents paying for services in stablecoins should prefer BSC USDT over Ethereum USDT given the 50–100x fee advantage.

BUSD is Binance's native dollar-pegged stablecoin, widely accepted across BSC DeFi protocols. It can be used as collateral on Venus and other lending platforms.

CAKE is PancakeSwap's governance and utility token. Agents that interact with PancakeSwap frequently can stake CAKE to earn reduced trading fees and participate in IFOs (Initial Farm Offerings).

All BEP-20 transfers use EIP-1559-style gas pricing on BSC and include automatic gas estimation — you never need to specify gas limits manually.


BNB to ETH, Solana USDC,
and beyond.

Agents are not confined to a single chain. Purple Flea routes cross-chain swaps through the best available bridges, converting BNB to assets on Ethereum, Solana, Tron, and more.

🔀

BNB → Ethereum

Convert BNB to ETH, USDC, or USDT on Ethereum mainnet. Useful when downstream contracts require Ethereum-native assets or when paying Ethereum-chain counterparties.

🔀

BNB → Solana USDC

Bridge BNB to USDC on Solana for ultra-cheap final-leg transfers. Solana USDC is widely accepted by Solana-native agents and payment processors.

🔄

On-chain via PancakeSwap

Same-chain swaps route through PancakeSwap v3 concentrated liquidity pools for tight spreads. Best-path routing selects the optimal pool fee tier automatically.


Python agent checking BSC
balance and swapping BNB.

A complete working example: check your BSC wallet, swap BNB to USDT via PancakeSwap, then pay a downstream agent. Under 40 lines of Python.

bnb_agent.py
import requests API_KEY = "your_api_key" BASE_URL = "https://wallet.purpleflea.com/v1" HEADERS = {"X-API-Key": API_KEY} # ── 1. Get the agent's BSC address ──────────────────────────────────── def get_address() -> str: r = requests.get(f"{BASE_URL}/wallet/address", headers=HEADERS, params={"chain": "bsc"}) return r.json()["address"] # ── 2. Check BNB + BEP-20 balances ──────────────────────────────────── def get_balance() -> dict: r = requests.get(f"{BASE_URL}/wallet/balance", headers=HEADERS, params={"chain": "bsc"}) return r.json() # ── 3. Swap BNB to USDT via PancakeSwap ─────────────────────────────── def swap_bnb_to_usdt(amount: str, slippage_bps: int = 50) -> dict: r = requests.post(f"{BASE_URL}/wallet/swap", headers=HEADERS, json={ "from_chain": "bsc", "from_token": "bnb", "to_chain": "bsc", "to_token": "usdt", "amount": amount, "slippage_bps": slippage_bps, }) return r.json() # ── 4. Pay a downstream agent in USDT ──────────────────────────────── def pay_agent(to: str, amount: str) -> dict: r = requests.post(f"{BASE_URL}/wallet/send", headers=HEADERS, json={ "chain": "bsc", "token": "usdt", "to": to, "amount": amount, }) return r.json() # ── Agent workflow ───────────────────────────────────────────────── addr = get_address() print(f"BSC address: {addr}") bal = get_balance() print(f"BNB: {bal['bnb']} USDT: {bal['usdt']} CAKE: {bal['cake']}") # Convert 1 BNB to USDT to fund stablecoin payments swap = swap_bnb_to_usdt("1.0") print(f"Swapped → {swap['to_amount']} fee: {swap['fee_bnb']} BNB via: {swap['dex']}") # Pay the worker agent for completed tasks tx = pay_agent("0xWorkerAgent...", "25.00") print(f"Payment sent: {tx['tx_hash']}")

The numbers that matter
for agent operations.

Cost and speed are the two variables that determine whether a high-frequency agent strategy is economically viable. Here is how BSC compares to Ethereum mainnet.

Metric BNB Chain (BSC) Recommended Ethereum Mainnet
Average tx fee $0.001 – $0.05 $2 – $30+
100 swaps/day cost ~$0.10 – $5 $200 – $3,000
Block time 3 seconds 12 seconds
Finality ~3s (1 block, PoSA) ~12s (1 block) / ~15min (finalized)
Address format 0x... (same as ETH) 0x...
EVM compatible Yes (chain ID 56) Yes (chain ID 1)
Main DEX PancakeSwap v3 Uniswap v3/v4
Stablecoin options USDT, USDC, BUSD USDT, USDC, DAI, FRAX
Lending protocol Venus Aave, Compound
Break-even tx value Any (even $0.10 transfers) $100+ to justify gas

For agent operations involving frequent small transactions — paying worker agents, triggering on-chain logic, managing a portfolio — BSC's fee structure is the decisive factor. A strategy that earns $50/day cannot survive $30 gas fees per transaction on Ethereum. On BSC, the same strategy retains over 99% of its earnings.


High-frequency agent ops
on BNB Chain.

Low fees unlock agentic patterns that are economically impossible on high-fee chains. Here are three patterns that work well with BSC.

🤖

Agent-to-agent micropayments

Orchestrator agents pay worker agents for completed subtasks in USDT or BNB. At $0.01 per payment, an orchestrator can settle 1,000 microtransactions per day for $10 in total gas.

📉

Automated portfolio rebalancing

An agent monitors BNB/USDT price ratios and rebalances a portfolio every 15 minutes via PancakeSwap swaps. On Ethereum this would cost $200/day in gas. On BSC the same strategy costs under $2.

Stablecoin yield optimization

An agent deposits USDT into Venus when borrow rates are high, withdraws when rates drop, and routes to PancakeSwap LP positions in between — all triggered programmatically at near-zero cost.


Understanding MEV on BNB Chain.

What BSC agents should know about MEV

  • BSC uses Proof of Staked Authority with 21 validators. Blocks are produced predictably, which reduces certain types of MEV relative to Ethereum's proof-of-stake mempool.
  • Sandwich attacks are possible on large swap orders. Purple Flea's swap API lets you set slippage_bps — any execution worse than your tolerance reverts automatically.
  • For large swaps (>$10,000), consider splitting into multiple smaller transactions over several blocks to minimize price impact and front-running exposure.
  • BSC's 3-second block time means the mempool window for front-running is narrower than Ethereum's 12-second window — a meaningful practical advantage for agent-size transactions.
  • Purple Flea submits transactions with competitive gas prices by default. Agents can override gas_price_gwei for time-sensitive swaps.

MEV (Maximal Extractable Value) refers to profit extracted by block producers or bots by reordering, inserting, or censoring transactions. On BNB Chain, the fixed validator set and fast block times create a different MEV environment than Ethereum.

For typical agent transactions — USDT transfers of $10–$1,000 and BNB swaps under $5,000 — MEV risk is minimal. These transaction sizes are below the threshold where front-running bots make a meaningful profit after their own gas costs.

Slippage tolerance is your primary protection for swaps. Setting slippage_bps: 50 (0.5%) means your swap will revert rather than execute at worse than 0.5% below the quoted price. For stablecoin pairs, even lower slippage (10–20 bps) is achievable given the concentrated liquidity in BSC's major pools.

Transaction privacy: BSC does not currently have a native private mempool equivalent to Ethereum's Flashbots. For highly sensitive large swaps, Purple Flea can route through private RPC endpoints on request.


More agent-ready chains.

BNB Chain is ready for
your agent right now.

Ultra-low fees, 3-second blocks, PancakeSwap swaps, cross-chain transfers. No KYC. Free to start.