API Reference
Create, edit and remove bookmaker accounts, turn an account into an API session, list which of your PCs are online, and read per-account PnL — all with your API key, no dashboard clicks required.
Base URL: https://api.b337.ai · Header: X-API-Key: YOUR_API_KEY
Three ideas to keep apart:
pc_id.
Sessions are bound to a PC; bets only place while that PC's client is online.Unlike the /v3 betting routes, these endpoints answer HTTP 200 with
{"status": "fail", "message": "..."} when a request can't be honoured
(account not found / not owned, retired bookie). Check status, not just the
HTTP code. Auth errors are the usual 401 (bad key), 403 (lapsed
subscription) and 422 (missing X-API-Key header).
The typical onboarding flow:
POST /accounts/add_account — add a bookmaker accountStores one bookmaker login under your key. The password is encrypted at rest.
| Field | Type | Required | Description |
|---|---|---|---|
bookie | string | Yes | Bookmaker slug, e.g. tab, sportsbet, neds. Stored lowercase whatever you send. |
username | string | Yes | Your login at the bookmaker (email or account number). |
password | string | No | Login password. Leave it out to reuse the password already stored for this same (bookie, username) — handy when re-adding an account you deleted. |
nickname | string | No | Display label on the dashboard. |
proxy | string | No | Proxy this account's session should use: host:port or host:port:user:pass. |
proxy_type | string | No | http (default) or socks5. Keep proxy as the bare host:port / host:port:user:pass string, never a socks5:// URL. SOCKS5 needs the latest bot version; older versions can't connect through it. |
bonus_liability | number | No | Per-bet bonus winnings cap for this account. Must not be negative. |
bwm | string | No | Sportsbet "Bet with Mates" group name, exactly as Sportsbet shows it. Only for accounts that really bet through a named group. |
Usernames and passwords are trimmed and cleaned of invisible characters that ride along with some copy-pastes, so a pasted credential is stored the way the bookmaker expects it.
Keep account_id — it is the handle every other endpoint on this page takes.
A closed-down bookmaker is refused:
{"status": "fail", "message": "<bookie> has closed and no longer accepts new accounts."}.
POST /accounts/update_account — edit an accountPartial update: only the fields you send change. A field you omit is left
exactly as it was; a field you send as null is cleared. (So never echo back
a whole account object with nulls in it — that clears those fields.)
| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | Yes | The account to edit. |
username | string | No | New login username. |
password | string | No | New password. |
nickname | string | No | New display label. |
proxy | string | No | New proxy string (host:port or host:port:user:pass); null clears it. |
proxy_type | string | No | http (default) or socks5. Clearing proxy resets it to http; setting a new proxy without proxy_type also means http. |
bonus_liability | number | No | New bonus winnings cap; null clears it. |
bookie is not editable — it is the account's identity. Delete and re-add
instead.
Response: {"status": "success"}, or
{"status": "fail", "message": "Account not found or not owned by this user"} —
a fail means nothing was written, so do not assume the edit landed.
POST /accounts/delete_account — remove an accountRemoves an account you own and its sessions. The row is soft-deleted (bet
history keeps resolving), and re-adding the same account later can pick its old
password back up (see add_account).
| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | Yes | The account to remove. |
Response: {"status": "success"}, or
{"status": "fail", "message": "Could not delete account (not found or not owned)"}.
POST /accounts/create_api_session — make an account bettableTurns an owned account into an API-strategy session — the kind
/v3/sessions lists and
/v3/place_bet targets. This is the
programmatic equivalent of adding an API session on the dashboard's Sessions
page.
| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | Yes | The account to attach. |
pc_id | string | Yes | Which of your PCs runs the session (see Finding your pc_id). |
use_bypass | bool | No | Default false. TAB number-login path (skips the bot-protection check behind most TAB 403s); works for email-login TAB accounts too — one normal login harvests the account number, then Bypass applies from the next launch. On an idempotent reuse, true turns it on; it is never turned off this way — turn it off from the dashboard toggle or recreate with force_new. Racing (Classic Racing) sessions take the same field on POST /accounts/create_racing_session, where it works in both directions on reuse: an explicit true/false sets it, leaving it out changes nothing. Read at session start — stop and relaunch after changing it. No effect outside TAB. |
force_new | bool | No | Default false. Retire any existing API session on this (account, PC) and mint a fresh session_id — recovery lever for a stuck session that cancel + recreate keeps handing back. |
Idempotent per (account_id, pc_id): calling it again returns the same
session_id instead of creating a duplicate.
Then launch it with
POST /v3/start_session and it
is ready for bets. A fail
("Could not create api session (account not found or not owned)") creates
nothing.
pc_idA pc_id identifies one machine running the desktop client. Two ways to get
it:
GET /v3/sessions returns carries
the pc_id it runs on.POST /dashboard/online-pcs — which of your PCs are connectedLists the pc_ids of your machines whose client has heartbeated in the last
~90 seconds. No request body.
An empty list means no client of yours is connected right now — sessions can
still be created against a known pc_id, but nothing launches or bets until
that PC's client comes online.
GET /accounts/pnl_summary — PnL per accountAggregated profit/loss for every account of yours that has at least one bet, across all strategies and bet types (not just one strategy's slice).
pnl is settled profit/loss in dollars (unsettled bets count 0 until they
settle). An account with no bets yet does not appear.
There is no public proxy-management endpoint: the dashboard's Proxies page is
dashboard-internal. From the API, a proxy is a property of an account — set
it with the proxy field on add_account / update_account
(host:port or host:port:user:pass), and the account's sessions use it.
/v3/sessions