Running your own server

Call TraderX tools from your own code, a VPS or CI with a personal key.

Create a personal key

Servers and scripts can't sign in through a browser, so they use a personal key. It works until you revoke it.

Keep the key private

Store it in an environment variable or your app's secret settings. Never commit it or paste it into a chat. If it leaks, revoke it in Settings and make a new one.
  1. Open Settings > AI agents

    Sign in to TraderX and open Settings > AI agents.

  2. Create a key

    Give it a name you will recognise later, like the machine or app it runs on.

  3. Copy it once

    The key starts with bbtx_pat_ and is shown only once. It doesn't expire; it works until you revoke it.

Terminal
export TRADERX_API_KEY="bbtx_pat_..."

Never paste a key into a chat

An AI chat is not a safe place for a key. Give it to your server through an environment variable or a secrets manager, and give chat apps the sign-in flow instead.

Call the tools from code

Any MCP client library works. This example uses the official TypeScript SDK (@modelcontextprotocol/sdk) to list your strategies:

TypeScript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const transport = new StreamableHTTPClientTransport(
  new URL("https://mcp.bbtraderx.com/mcp"),
  { requestInit: { headers: { Authorization: `Bearer ${process.env.TRADERX_API_KEY}` } } },
);

const client = new Client({ name: "my-traderx-script", version: "1.0.0" });
await client.connect(transport);

const strategies = await client.callTool({ name: "strategy_list", arguments: {} });
console.log(strategies.content);

Tool names and what they return are in Tools. Each key can make 60 requests a minute.

Existing order API

If your server already sends orders to https://execute.bbtraderx.com with a strategy key, nothing changes: that API keeps working exactly as before. The same strategy keys can also connect to the agent server, where they see only their own strategy.

Portfolio / API ensemble: Create a strategy driven by your own backend and send orders from it.Order flow: How deposits, trading wallets and withdrawals work on TraderX.