Since 1 April 2026, brokers accept API orders only from static IP addresses registered with them, and Upstox allows one active API app per user. This page explains what you need, how the connection works, each step of connecting, the daily sign-in, the Upstox rules for API users, what QuantPower can and cannot do on your account, three worked examples, what to do when something goes wrong, and how to keep one Upstox app working for every tool you use.
A short history of API trading at Upstox
Upstox began as RKSV, a discount broker, and grew into one of India's larger brokers by active clients as low-cost online trading spread through the 2010s. Like several discount brokers, it opened a developer API so that clients' own programs could read their accounts, stream prices and place orders. Individual traders used it from Python scripts and spreadsheets, and algo platforms connected their users through it.1
SEBI's circular of 4 February 2025 on safer participation of retail investors in algorithmic trading reshaped that world. It made the broker responsible for every algo order, required static IP addresses registered with the broker for API order placement, set a threshold of 10 orders a second above which an algo must be registered with the exchange, and asked exchanges to empanel algo providers.2 After two postponements the framework came into force for every broker from 1 April 2026.3
Upstox set out how it applies the rules in notices to API users: one active app per user, order traffic only from the registered IPs, IP changes once a calendar week, and market protection on market orders.45 QuantPower gives every client two static IPs, which fill Upstox's primary and secondary slots.
How QuantPower connects to Upstox
| Part | How it works |
|---|---|
| Sign-in | Redirect sign-in: you tap Sign in in QuantPower, log in on Upstox's page with your two-factor code and come back. Your Upstox password, PIN and codes never touch QuantPower |
| Your app keys | Your Upstox API key and secret, entered once, sent over https, stored encrypted and never shown again |
| Order route | Every order goes through QuantPower's one order path, with its risk checks, then to Upstox |
| Static IPs | 2 static IPs free with every QuantPower account, a primary and a backup. If the forwarding proxy is down, orders are held, never sent from another address |
| Prices | Live prices come from your Upstox connection; with no broker connected, QuantPower shows no live prices |
| Session | An Upstox session ends early the next morning, so you sign in once each trading day |
| Money | Your funds, shares and positions stay with Upstox. QuantPower holds no money |
Upstox takes a primary and a secondary IP.5 Any broker-specific step is shown in QuantPower's broker connection screen.
How to connect Upstox to QuantPower
- Create an API app. Log in to Upstox's developer site, open My Apps and create an app. Enter the redirect URL that QuantPower shows on its Upstox connect screen. Note the API key and secret. If you already have an app used by another tool, read the section on one app below first.
- Open Brokers in QuantPower. Choose Upstox. Enter your Upstox client ID, the API key and the API secret.
- Confirm with a tap. QuantPower asks for your tap, then sends the keys once over https. They are stored encrypted and never shown again.
- Register the static IPs. The Upstox row in QuantPower shows your two static IPs. In My Apps, enter the first as the primary IP and the second as the secondary IP, and save. Upstox allows one change a calendar week, and a change ends your current session, so you sign in again afterwards.5
- Sign in. Tap Sign in on the Upstox row. Upstox's login page opens. Log in with your two-factor code, approve access, and you return to QuantPower.
- Check the account. Your funds, holdings, positions and orders should appear as Upstox holds them.
- Test before going live. Run your first strategy in forward test with test money, then switch it on live with a small size.
If you are new to broker APIs, our guide to the trading API explains how order and data APIs work. QuantPower's checklist for every broker is in broker connection requirements.
One Upstox app for every tool
Upstox allows one active API app per user. When you create a new app, the older ones are removed.4 This matters if you already use another platform or your own code with Upstox:
- If QuantPower is your only tool, create the app for QuantPower and you are done.
- If you already have an app for your own script, you can use the same app's key and secret in QuantPower instead of creating a new one. Both tools then share the app, its static IP list and its daily session.
- If another platform already uses your app, creating a new app for QuantPower will cut that platform off. Decide which tool uses the app before you create it.
Two tools on one account should never trade the same signal, or your positions will double.
Upstox API terms you will see
| Term | What it is |
|---|---|
| API key | The public identifier of your Upstox app, entered once in QuantPower |
| API secret | The private key of your app; QuantPower stores it encrypted and never shows it again |
| Redirect URL | The address Upstox sends you back to after you log in, shown on QuantPower's connect screen |
| Authorization code | A one-time code Upstox returns after your login, exchanged for the day's session |
| Access token | The day's session; it ends early the next morning, so you sign in once each trading day |
| Primary and secondary IP | The two static IPs registered for your app in My Apps |
Upstox API rules since April 2026
| Rule | What it means on Upstox |
|---|---|
| Your own API app | One active app per user; a new app removes the older ones |
| Registered static IPs | One primary and one optional secondary IP; order traffic from other addresses may be rejected |
| Changing the IPs | Once a calendar week, and the change ends the current session |
| Daily sign-in | Every API session needs a login with two-factor authentication and ends before the next trading day |
| Order rate | Algos that send more than 10 orders a second must be registered with the exchange through the broker |
| Market orders | Market and SL-M orders get market protection by default, which limits how far from the last price they can fill |
Upstox, like every broker, checks each order for price, quantity, margin and order rate before it reaches the exchange. A rejection at this stage is reported back to QuantPower with Upstox's reason, and the algo card or the order list shows it in plain words, so you can see whether the cause was margin, price bands, a closed segment or the IP check.
Every trading day
- Before 9:15 am: tap Sign in on the Upstox row and log in on Upstox's page. The row shows "signed in" and when the session ends.
- Algos that enter later today switch on without the sign-in, and their card says "Sign in to your broker before the entry". If the entry comes while Upstox is signed out, the entry is refused with the reason.
- Algos that would enter now cannot be switched on live while Upstox is signed out.
- Before each entry: check free margin. Option buyers pay the full premium upfront, and sellers need SPAN and exposure margin.
- On expiry day: short index options expiring that day carry an extra 2% extreme loss margin under SEBI's rules of October 2024.6
- After the close: the session ends early the next morning, and the next trading day starts with a fresh sign-in.
Nothing signs in for you: QuantPower never stores your Upstox password and never logs in on your behalf.
What QuantPower can and cannot do on your Upstox account
| QuantPower can | QuantPower cannot |
|---|---|
| Show your funds, holdings, positions and orders as Upstox holds them | Withdraw money from your Upstox account |
| Place, modify and cancel orders that you or your algos send | Change your bank account, address or nominee |
| Run algos that enter and exit by your rules once you switch them on | See the password, PIN or code you type on Upstox's page |
| Square off positions when your MTM stop loss or Smart Exit is hit | Trade after your session has ended |
| Refuse new orders once your daily loss limit is reached | Send orders from any address other than your two static IPs |
| Stop trading in a segment until its next session with the kill switch | Place an order from an AI app without your confirmation |
These controls cover your whole QuantPower account. If you connect Upstox and another broker, the daily loss figure adds up both, and each position's exit goes to the broker that holds it.
Market data from Upstox
QuantPower's prices come from your connected broker. With Upstox, live ticks arrive over Upstox's market data feed; QuantPower turns them into 1-minute bars and reads history from Upstox's candle service when a chart or a backtest needs it. The registered static IPs are needed for orders; check Upstox's current developer pages for which other requests they cover and whether its market data carries a fee.
Order rules at Upstox
- Stop losses in options. The NSE does not accept SL-M orders in index options, so Upstox rejects them.7 Build option strategies with limit and stop-loss limit orders, with a buffer between the trigger and the limit price.
- Market protection. Market and SL-M orders get a protection range by default, so they cannot fill far from the last price. In a fast market, a protected market order may stay partly unfilled.
- Multi-leg entries. A short straddle sends two orders at entry and an iron condor four. QuantPower sends the buy legs first and the sell legs only after the buys fill, so a refused hedge never leaves a sold option uncovered.
- Order rate. QuantPower sends one order at a time per leg, well below 10 a second, and never retries a placed order on its own.
- Freeze quantity. An order above the exchange's freeze limit is split automatically, and iceberg orders let you split a large order into 2 to 50 legs sent one at a time.
Your Upstox account inside QuantPower
- Positions show today's positions with M2M, and you can convert a product or exit a position. Exit all asks for your tap and your second factor.
- Holdings show your portfolio with profit and loss, and a holding can be pledged for margin.
- Funds show margin, collateral, cash and what can be withdrawn, as Upstox reports them.
- Orders show today's orders from every source, with a Strategy column that shows which algo placed each one.
- On the chart, your Upstox orders, positions and GTT triggers appear as lines. Drag an order line to a new price or press "+" at a price to start a new order; each action opens the order sheet for your tap.
A worked example: a Bank Nifty iron condor on Upstox
Take a weekly iron condor on Bank Nifty: sell a call and a put two strikes out of the money, buy a call and a put four strikes out of the money, enter at 9:30 am, exit at 3:10 pm, with an overall stop-loss of ₹3,000 for the algo.
- Load the Iron Condor template in the algo builder. It becomes your own algo.
- Set the sold legs to "OTM 2" and the bought legs to "OTM 4", weekly expiry, one lot each. A Bank Nifty lot is 30 units.8
- Set the entry time, the exit time and an M2M stop-loss of ₹3,000.
- Run it in Forward test on live Upstox prices for a few weeks.
- Switch it on live, choosing Upstox as the broker.
At entry the algo sends the two bought legs first, then the two sold legs once the buys fill. At the exit time it buys back the sold legs first, then sells the bought ones.
What it costs: 200 tokens per 28 days for the live algo (₹200 plus GST), with orders unlimited. Eight orders a day go to Upstox, four in and four out; at ₹20 an order that would be ₹160 a day in brokerage, plus STT of 0.15% of the premium on every option sale since 1 April 2026,9 exchange charges, stamp duty and GST. Check your Upstox plan for its actual brokerage.
A worked example: a stock signal on Upstox
Take a rule on Infosys: when the RSI(14) on 15-minute candles crosses above 30 from below, buy 40 shares intraday, with a 1% stop-loss and a 1.5% target.
- Create a signal with the condition, checked on closed 15-minute candles.
- Choose One-touch, and you get a notice with the order ready to place with one touch; or arm it as Auto, and it places the order itself with every risk check.
- The signal can also start or stop an algo instead of placing a single order.
A signal that places its own order costs no tokens.
A worked example: a chart alert to Upstox
If your alerts come from your own scanner or script, create a webhook in QuantPower, link it to one of your algos, and have your tool call the webhook's URL. When the alert fires during market hours, the linked algo switches on for today and enters; an exit alert stops it and squares off, with the orders going to Upstox from your static IPs. With an alert on an Arth.live chart, the chart, the alert and the order sit in one place. See API vs webhook for when each route suits.
Running several strategies on one Upstox account
Upstox sees one app and one session, however many strategies you run through it. A few points keep several strategies orderly:
- QuantPower's limits are 50 saved algos, 20 running at a time and 6 legs in a running algo.
- Each live algo picks a broker when you switch it on. A restart, or a start by a webhook or a signal, stays at the same broker.
- Positions add up at Upstox. Two algos on the same index make one combined position at the broker. Check the combined margin before switching both on.
- The account controls look at the total. The daily loss limit, the optional cap on orders a day and Smart Exit apply to the whole account, across every algo and every broker.
- Costs scale by algo, not by order. Each live algo is 200 tokens per 28 days however many orders it sends; Upstox's brokerage and the statutory charges apply to each executed order.
What the SEBI rules mean for an Upstox user
The framework draws a line between two kinds of automation.2
- Your own program, sending fewer than 10 orders a second from a registered static IP, does not need exchange registration. It still needs the static IP, the daily sign-in and your own care over what it does.
- A strategy offered to retail traders by a platform reaches them through a broker under the exchange's rules, registered and with its orders identified, so that the exchange and the broker can tell algo orders from manual ones.
For a trader, the practical checklist is the same either way: the registered IPs, a daily sign-in, a clear written rule for each strategy, and limits on the account. QuantPower shows every rule of every algo and keeps an activity log of each entry, exit and refusal.
A checklist before your first live algo on Upstox
- F&O is active on your Upstox account, and the margin for the strategy is free.
- Your Upstox app is the only active app, or the one shared with your other tool.
- QuantPower's two static IPs are saved as the primary and secondary IP in My Apps.
- You signed in today after any change to the IPs, and the Upstox row shows "signed in".
- The algo ran in Forward test for some weeks, and its activity log matches what you expected.
- The daily loss limit and Smart Exit are set for the account.
- The first live run is one lot.
Moving from your own Upstox script
Traders who already run Python against the Upstox API can move a strategy across rule by rule:
| In your script | In QuantPower |
|---|---|
| An OAuth login routine and a stored access token | The daily Sign in on the Upstox row |
| A machine with a fixed public address | The two static IPs that come with your account |
| Code that finds the strike two steps out of the money | A rule leg set to "OTM 2", picked fresh at each entry |
| Polling loops for stops and targets | Leg and algo exits, trailing stops and an M2M lock |
| Print statements and log files | The algo's activity log, with "Copy log" for a day |
| Your own emergency stop | The account kill switch, daily loss limit and Smart Exit |
You can also keep both: the script for research, QuantPower for the strategies you run every day.
Building Upstox strategies with Quanty and your own AI app
Quanty, the assistant in the QuantPower app, can turn a description such as "sell an iron condor on Bank Nifty two strikes out, exit at 3 pm" into an algo for you to check, backtest it, and flag a missing stop-loss or an unhedged sold option. It saves the algo switched off; only you switch it on. If you use your own AI app through Connect AI, it can read your Upstox positions as QuantPower sees them and prepare an order, which is placed only when you confirm it with a tap and your second factor. Neither gives tips or recommends a strategy.
Costs to plan for
Three kinds of cost apply when you run algos on Upstox through QuantPower:
- QuantPower tokens (1 token = ₹1, GST extra): a live algo costs 200 tokens per 28 days with orders unlimited, a Forward test algo 100, a backtest 2 after the first 10 free each week, and a signal that places its own order nothing. Charts, the option chain, the screener and the strategy builder are free, and so are the two static IPs.
- Upstox's charges: brokerage on each executed order under your Upstox plan, and any fee Upstox sets for its APIs or data. Check Upstox's current pricing pages; broker charges change.
- Statutory charges: STT, exchange transaction charges, SEBI fees, stamp duty and GST, the same at every broker. For option strategies with several legs, these and the brokerage usually cost more than the software.
Upstox and other brokers on one QuantPower account
You can connect Upstox and other brokers to the same QuantPower account. The order sheet then shows a broker picker, and nothing is ever sent to a guessed broker. Each live algo runs at the broker you chose for it. Your positions screen shows each broker's positions, and the daily loss limit, the kill switch and Smart Exit cover all of them together, so a loss at one broker counts towards the same account limit as a loss at the other.
When something goes wrong
| What you see | Likely cause | What to do |
|---|---|---|
| "Sign-in needed" on the Upstox row | Yesterday's session has ended, or the IPs were just changed | Tap Sign in and log in on Upstox's page |
| Orders rejected for IP | The static IPs are not registered, or were entered wrongly, in My Apps | Compare the IPs in the Upstox row with My Apps; remember one change a week |
| Another tool stopped working | A new app replaced the old one | Use one app for both tools, or choose which tool keeps it |
| SL-M order rejected in options | SL-M is not allowed in index options | Use a stop-loss limit order |
| Insufficient margin | The order needs more margin than is free | Add funds, reduce the size, or pledge holdings |
| Segment not enabled | F&O is not active on your Upstox account | Activate the segment with Upstox |
| Two-factor code refused | The phone's clock is off | Set the phone to automatic time |
If an algo stops, its card and activity log say why in one plain line.
Security
- Your password and codes are typed only on Upstox's page.
- Your API secret is sent once over https, stored encrypted and never shown again.
- Sensitive actions in QuantPower, such as exit all, the kill switch or confirming an order prepared by an AI app, ask for your second factor.
- Your orders leave only from your two static IPs.
- Your money never passes through QuantPower.
QuantPower is trading software. It is not a stockbroker or a SEBI-registered investment adviser or research analyst, and it gives no tips, calls or buy and sell advice. The strategies it runs are your own rules, fully visible to you. Ready-made templates, such as straddles and iron condors, load into the strategy builder, and once loaded they are your own strategy.
Where API trading at Upstox is going
The 2026 framework has made broker APIs safer and more formal: registered IPs, one app per user, daily sign-ins and exchange registration above 10 orders a second. For a retail trader the effect is that running a strategy alone now means managing an IP, a session and a broker app; platforms that handle those parts in one place take that work off the trader. What stays with you is the strategy itself and the decision to switch it on.
Frequently asked questions
Does QuantPower see my Upstox password?
No. You type your login details and two-factor code on Upstox's own page and return to QuantPower. QuantPower keeps your API key and secret encrypted and uses the day's session that Upstox issues after your login.
Which static IPs do I register with Upstox?
The two shown on the Upstox row of QuantPower's Brokers screen, as the primary and secondary IP of your app in My Apps. Any broker-specific step is shown in QuantPower's broker connection screen.
Can I have more than one Upstox API app?
No. Upstox allows one active API app per user. Creating a new app removes the older ones, so plan which tool uses it.
Why was my stop-loss order rejected on Upstox?
SL-M orders are not allowed in index options on the NSE. Use a stop-loss limit order with a buffer between the trigger and the limit price.
What happens to my session when I change the static IPs?
Upstox ends the current session when the IPs change. Sign in again from the Upstox row. You can change the IPs once a calendar week.
Can I use QuantPower and my own Upstox script together?
Yes, with the same app, as long as the two never trade the same signal.
Related guides
- Trading API: how order and data APIs work
- API vs webhook: when an alert should send the order
- Broker connection requirements: the checklist before you connect any broker
References
- Upstox, developer API documentation (upstox.com)
- SEBI, circular on safer participation of retail investors in algorithmic trading, 4 February 2025 (sebi.gov.in)
- SEBI, glide-path circular, 30 September 2025, and NSE implementation standards for retail algo trading, 5 May 2025, and operational modalities, 22 July 2025 (nseindia.com)
- Upstox community: new SEBI and exchange mandates for API trading from 1 April 2026 (community.upstox.com)
- Upstox developer announcements: static IP APIs, primary and secondary IP, one change a calendar week (upstox.com)
- SEBI, circular on measures to strengthen the equity index derivatives framework, 1 October 2024 (sebi.gov.in)
- NSE, circular on the discontinuation of stop-loss market orders in index options, 2021 (nseindia.com)
- NSE, revision of market lot sizes of index derivatives, effective from the contracts after December 2025 (nseindia.com)
- Union Budget 2026-27: STT on the sale of options raised from 0.10% to 0.15% of the premium from 1 April 2026 (incometaxindia.gov.in)