Browse documentation
API Reference
This page is for developers writing code against BrokerBridge's local API. If you just want to trade, you do not need it; see Help instead.
The local desktop service exposes JSON endpoints on http://127.0.0.1:8400. Use them to inspect health, setup, plans, positions, and activity without bypassing the product's protected execution path. Swagger UI is available at /docs.
These endpoints require the authenticated desktop app session when auth is enabled. Use the in-app Setup Wizard, Settings, and proposal controls for normal work. This public page does not provide bearer tokens or unauthenticated mutation commands.
Health
/api/healthSystem health check with service status.
{
"status": "ok",
"version": "0.1.0",
"trading_loop_active": true,
"services": {
"api": "healthy",
"ibkr": { "connected": true, "message": "" },
"anthropic": { "connected": true, "message": "" }
}
}Setup
/api/setup/statusCheck whether initial setup is complete.
/api/setup/configSave configuration from the authenticated setup wizard session.
AI provider selection
BrokerBridge creates and manages the AI provider connection for you. There is no API key to create or manage. Pick a model and buy AI credits.
/api/credentials/testTest connectivity to a selected AI provider through the authenticated desktop session.
/api/setup/providerSave the selected AI provider configuration through the authenticated setup route. Managed-credit customers do not need to supply a provider API key.
/api/credentials/statusGet connection status for all providers.
{
"providers": {
"claude": "connected",
"openai": "disconnected",
"openrouter": "disconnected",
"google": "disconnected",
"xai": "disconnected",
"ibkr": "connected"
}
}/api/credentials/ibkr/testTest IB Gateway/TWS reachability through the authenticated desktop session. A reachable port is not an authenticated account; use the Setup Wizard or Settings diagnostics for identity verification.
Trade plans (proposals)
/api/proposalsList trade plans through the authenticated desktop session. Filter by status and date.
/api/proposals/{proposal_id}Get a single trade plan with full details.
/api/proposals/{id}/approveApprove with optional modifications through the authenticated in-app approval flow.
/api/proposals/{id}/rejectReject with optional reason through the authenticated in-app proposal controls.
Positions
/api/positionsGet current open positions with unrealized P&L.
/api/positions/historyGet closed positions. Optional date filter.
Activity
/api/activityRecent activity items (newest first, max 50).
/api/activity/streamSSE stream for real-time updates. Heartbeats every 30s. Use the authenticated desktop session or a developer token when API auth is enabled.
import os
import httpx
headers = {"Authorization": f"Bearer {os.environ['BB_API_BRIDGE_TOKEN']}"}
with httpx.stream("GET", "http://127.0.0.1:8400/api/activity/stream", headers=headers, timeout=None) as r:
for line in r.iter_lines():
if line.startswith("data: "):
print(line[6:])Webhooks
/api/webhooks/stripeStripe webhook for subscription events. Requires Stripe-Signature header.