Skip to content

United States · Broker API

Build an Interactive Brokers trading bot with your AI coding agent.

Super Algo Kit helps you build an Interactive Brokers trading bot inside your own AI coding agent. Your bot connects to a TWS or IB Gateway session that you log in to yourself. The kit plans for the daily restart and the weekly re-login, caps message rates and paper-tests first. Paper access is reported to need a funded live account.

Interactive Brokers TWS API logo

broker facts

Interactive Brokers TWS API

What it is
A global broker with three API routes: the TWS API, a Web API and FIX (reported).
Markets
US and non-US products, with reach into Europe and Japan. The full asset-class list is not confirmed.
Login model
You log in to TWS or IB Gateway yourself; your bot connects to that local session. The socket needs no API key.
Session cycle
A daily restart, and a manual login after the weekly reset on Sunday at 01:00 ET (reported).
Paper option
A paper account with its own login, available only with a fully open and funded live account (reported).
Message limit
At most 50 messages a second from your program to TWS. Super Algo Kit caps itself at 30.
Costs
No API fee; market-data subscriptions and commissions cost extra (reported). Commission rates are not confirmed.
Safe default
The read-only API setting is on by default and blocks API orders (reported).

From the kit's Interactive Brokers card, checked 2026-09-30. Confirm current terms on Interactive Brokers's own site.

Paper first

A Interactive Brokers bot, built paper first.

Super Algo Kit runs inside the coding agent you already use. It interviews you, writes the spec with pass marks set first, then builds, backtests and paper-tests. Real money starts only when you type the authorize command.

Type this in your coding agent
Build me a pairs trading bot for two US stocks on Interactive Brokers. Paper only.

The plan, step by step

Tick them off as you go.

How does Interactive Brokers API access and login work?

Interactive Brokers offers the TWS API, a Web API and FIX (reported). Super Algo Kit's card centres on the TWS API. Your program connects to a running, logged-in Trader Workstation or IB Gateway with a client id, not an API key.

You open and fund a live account, install TWS or IB Gateway, and enable API connections in its settings. The read-only API setting is on by default and blocks orders (reported). Keep it on for research and turn it off only for the deployed bot.

The session is not permanent. TWS and IB Gateway are designed to restart daily (reported). After the weekly reset on Sunday at 01:00 ET, you log in again by hand (reported). Whether IBKR's terms allow a scripted login is not confirmed, so the login stays with you.

Paper trading an Interactive Brokers bot

An IBKR paper account has its own login and listens on separate ports from live (reported). It is available only to holders of a fully open and funded live account (reported). Plan to open and fund a live account before the paper run.

How paper fills, data sharing and resets differ from live is not confirmed in the card. Super Algo Kit labels paper results with the data they used. Agents use the paper login only and never hold your live login.

Interactive Brokers API limits and costs to plan for

Your program may send at most 50 messages a second to TWS, which closes the connection above that. The kit counts market-data and account requests as well as orders, in its own reading of the rule. Historical data has separate pacing rules (reported).

IBKR is reported to have dropped its USD 25,000 day-trading minimum after FINRA's 2026 change. The US pack models SEC and FINRA sell-side fees with their effective dates.

  • No identical historical request within 15 seconds (reported)
  • No more than 60 historical requests in any 10 minutes (reported)
  • Live market data needs paid subscriptions (reported)
  • No API fee; commission schedules are not confirmed in the card

What Super Algo Kit does with Interactive Brokers

The adapter caps itself at 30 messages a second, 60% of the venue limit. It spaces historical requests well below the pacing rules. When the weekly reset ends the session, the bot enters an explicit waiting state and alerts you before the open. It never loops on logins.

After the daily restart, it reconnects, resubscribes and marks the data gap. After a disconnect, it reconciles open orders and executions with IBKR before any resend. Startup reconciliation also picks up orders you placed by hand in TWS.

An independent risk gate checks every order outside the strategy. A kill switch is drilled on paper before any live step. Host, port and client id come from your environment, and account numbers stay out of files and logs.

Before you rely on it

Gotchas to plan for.

  • Your bot needs a running, logged-in TWS or IB Gateway; the socket API has no cloud endpoint.
  • A bot that assumes a permanent session fails at the weekly Sunday reset (reported).
  • Orders are refused while the read-only API setting is on, so check it first.
  • To change an order, resend it with the same order id; a new id creates a new order (reported).
  • Order ids must increase and stay unique across clients when a master client id is used (reported).
  • IBKR's older API pages point to newer docs, so re-read the current docs before release.

FAQ

Interactive Brokers: questions.

Can an Interactive Brokers bot run without TWS or IB Gateway?

Not with the TWS API. Your program connects to a running, logged-in TWS or IB Gateway, which restarts daily (reported). IBKR also offers a Web API and FIX, which the kit's card only notes.

Does Interactive Brokers offer paper trading for API bots?

Yes, through a paper account with its own login. It is reported to be available only once your live account is fully open and funded. Super Algo Kit runs its paper stage on that login and labels results with the data used.

Is Super Algo Kit affiliated with Interactive Brokers?

No. Super Algo Kit is independent software and is not affiliated with or endorsed by Interactive Brokers. The name is used only to say the kit works with its documented APIs. You hold the account and type your own login.

Can Super Algo Kit log in to TWS for me?

No. Whether IBKR's terms allow scripted logins is not confirmed, so the login stays with you. You sign in, the bot connects to that session, and it waits safely when the session ends. The bot never holds your IBKR password.

How many API messages can an Interactive Brokers bot send?

At most 50 messages a second from your program to TWS, which closes the connection above that. Historical data requests follow separate pacing rules (reported). Super Algo Kit caps its own adapter at 30 messages a second.

Keep reading

More guides.

Build it with Super Algo Kit.

15 specialist roles and 35 skills inside your coding agent. Paper first, live only when you say.

Interactive Brokers TWS API and its logo are trademarks of their owner, used here only to say that Super Algo Kit can work with it. Super Algo Kit is not affiliated with or endorsed by Interactive Brokers. Super Algo Kit is development software. It is not investment advice, a signal service or a promise of performance. Trading involves substantial risk, including the loss of all capital you trade with.