Agent Integration
elizaOS Native
Connect elizaOS agents to BNBRouter. Zero-code templates + x402 payment protocol.
Recommended
elizaOS Agent
Drop-in replacement. Set base URL and your agent auto-burns.
Advanced
x402 Protocol
Machine-to-machine payment. Agent signs BNB tx per request.
Coming Soon
MCP Tool
Use BNBRouter as an MCP tool in any elizaOS agent.
Environment Variables
OPENAI_BASE_URL=https://api.bnbrouter.io/v1
OPENAI_API_KEY=bnbr_your_key_here
ELIZAOK_BURN_RATIO=10
ELIZAOK_CONTRACT=0x7c1b951e9552b9295343cff464205739e713ffffelizaOS Agent Setup
import { AgentRuntime } from "@elizaos/core";
const agent = new AgentRuntime({
modelProvider: "openai",
settings: {
OPENAI_BASE_URL: "https://api.bnbrouter.io/v1",
OPENAI_API_KEY: "bnbr_your_key_here",
},
});
// Every LLM call now automatically burns $elizaOK
await agent.initialize();x402 Payment Protocol
// x402 Payment Protocol — Agent auto-pays per call
const response = await fetch("https://api.bnbrouter.io/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer bnbr_your_key",
"X-Payment": "<base64_encoded_payment_proof>",
"X-ElizaOK-Ratio": "0.1", // 10% $elizaOK + 90% BNB
},
body: JSON.stringify({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello" }],
}),
});
// Response includes _bnbrouter.tx_hash and burn dataAgent Autonomous Burn
When an elizaOS agent calls BNBRouter, the burn happens automatically. No human intervention — machine-to-machine deflation.
Agent calls APIx402 signs txAuto Burn