Dhan API Static IP: Fix Your Cloud Bot After the SEBI Deadline

QuotaGuard Engineering
April 12, 2026
5 min read
Pattern

Important Update: Other QG Customers w/ Shared IPs Could Reject Yours (April 3, 2026)

Since the SEBI deadline hit on April 1, we've seen a surge of Indian algo traders signing up for QuotaGuard. That's great, but it's created an unexpected side effect. Because brokers require each IP to be uniquely tied to one trader, a shared static IP can be rejected if another QuotaGuard customer has already registered it with the same broker. The more customers we onboard, the more likely this becomes.

Our recommendation: For the most reliable setup, use our Shield Enterprise plan, which gives you a dedicated proxy with IPs that are exclusively yours. Lower-tier plans (Starter, Production, Business) can still work, and many customers are connecting successfully, but if your assigned IP has already been claimed by another QuotaGuard customer at your broker, you'll need a fresh one.

How the Enterprise setup works:

  1. Sign up for the Shield Enterprise plan.
  2. Reach out to our team.
  3. We'll build your dedicated proxy infrastructure.
  4. We'll work with you to rotate through IPs until we find ones that haven't been previously registered with your broker. QuotaGuard has been operating for 13 years with over 100,000 customers, so some IPs in our pool may have been registered by past users. We keep rotating until we find clean ones.
  5. Once we find two working IPs, they're yours exclusively. No one else will ever be assigned them.

Have questions or want help choosing the right plan? Contact us and we'll get you sorted.


Route your Dhan API calls through QuotaGuard Shield's static IP proxy, register that IP in your Dhan dashboard, and your cloud-deployed bot works again. SSL passthrough keeps your credentials and order data encrypted end-to-end.

SEBI's static IP mandate took effect April 1, 2026. If you're running a Dhan trading bot on Heroku, Render, Railway, or any other cloud platform with dynamic IPs, your order placement calls are now failing. The fix is straightforward. You need a static outbound IP, and you need to register it with Dhan.

Verified: QuotaGuard Shield Connects to Dhan's API

We tested this on April 2, 2026. A request to api.dhan.co routed through QuotaGuard Shield's proxy on AWS returned HTTP 401 Unauthorized. That's the result you want to see. It means the connection reached Dhan's servers. No CDN block. No IP-level rejection. The 401 is a clean authentication error. It's Dhan saying "I received your request but you haven't registered this IP yet." Register the IP, and authenticated requests go through.

QuotaGuard tip: A 401 response is the best possible outcome for a connectivity test. It proves the network path works end to end. The only remaining step is registration on Dhan's side.

Why Cloud Deployments Broke on April 1

On February 4, 2025, SEBI issued circular SEBI/HO/MIRSD/MIRSD-PoD/P/CIR/2025/0000013. It requires all retail algo trading API access to be tied to a static, whitelisted IP. The deadline was extended once via SEBI/HO/MIRSD/MIRSD-PoD/P/CIR/2025/132, then made final at April 1, 2026. That date has passed.

SEBI's exact requirement:

"not permit open APIs and allow access only through a unique vendor client specific API key and static IP whitelisted by the broker to ensure identification and traceability of the algo provider and the end user"

SEBI Circular SEBI/HO/MIRSD/MIRSD-PoD/P/CIR/2025/0000013, February 4, 2025

NSE followed with circular NSE/INVG/67858, which set the enforcement timeline for brokers. Dhan implemented IP whitelisting at the API level. It's not optional on their end. Your API key won't authorize order placement until you've registered a static IP.

Heroku, Render, Railway, Fly.io, and most PaaS platforms don't assign static outbound IPs. Every time your dyno or container runs, it may use a different IP. You can't whitelist a moving target. That's why your bot broke.

Get a Static IP With QuotaGuard Shield (Step by Step)

QuotaGuard Shield is an egress proxy that runs on AWS. It gives your cloud app a static outbound IP. You route your Dhan API calls through it. They exit from an IP that never changes. You register that IP with Dhan. Order placement works again.

QuotaGuard Shield uses SSL passthrough. It routes your encrypted traffic without decrypting it. Your Dhan credentials and order data are never exposed to the proxy. This is the right product when financial data flows through the connection.

On the Enterprise plan, each account gets a dedicated IP that is exclusively yours. SEBI's requirement is traceability: the IP must map to you specifically. Lower-tier plans assign static IPs, but those IPs may be shared across customers. As we've discovered, Indian brokers are rejecting IPs that were previously registered by another user. See the important update at the top of this post.

On Any Platform (Direct Signup)

Sign up at quotaguard.com/products/pricing. Grab your proxy URL and static IP from the dashboard. Add it as an environment variable in your platform's settings:

QUOTAGUARDSHIELD_URL=http://username:password@proxy.quotaguard.com:9293

On Heroku

Install the add-on:

heroku addons:create quotaguardshield:starter --app your-app-name

This sets QUOTAGUARDSHIELD_URL automatically. Your static IP is in the QuotaGuard dashboard. Use that IP when registering with Dhan.

Python Code: dhanhq

import os
from dhanhq import dhanhq

# On Heroku: QUOTAGUARDSHIELD_URL is set automatically by the add-on.
# On other platforms: set it in your environment variables.
proxy_url = os.environ['QUOTAGUARDSHIELD_URL']
os.environ['HTTPS_PROXY'] = proxy_url
os.environ['HTTP_PROXY'] = proxy_url

dhan = dhanhq("client_id", "access_token")

Set HTTPS_PROXY and HTTP_PROXY before initializing the dhanhq client. The library uses requests under the hood. It reads proxy settings from environment variables. All outbound calls route through QuotaGuard Shield from that point.

Register Your Static IP With Dhan

Your static IP is in your QuotaGuard dashboard. Log in to your Dhan API dashboard at api.dhan.co and look for the IP whitelisting or static IP settings. If you don't see it or the process isn't clear, contact Dhan support directly. Don't guess at the URL or skip this step. The registration has to happen on Dhan's end before your API calls will succeed.

Once Dhan has registered your static IP, test with a simple balance or holdings call before running your full strategy. The 401 you saw earlier should resolve to a successful response.

The VPS Alternative Costs More Time Than Money

A DigitalOcean Droplet or AWS EC2 instance with a reserved IP costs roughly $6 to $12 per month. It's a legitimate option. Many developers in the Indian algo trading community use it.

Are you a trader or are you trying to run 24/7 devops as your primary goal with a little trading on the side? That's the question.

The real cost is time and maintenance. You own the server. You handle OS updates, security patches, SSH key rotation, and uptime monitoring. You need a deployment workflow to push code changes to it. If you're already on a cloud platform, you're giving up the deployment tooling you've built. If the VPS goes down during market hours, your bot goes dark.

If you want to minimize monthly spend and you're comfortable with DevOps, the VPS route works. If you want to be back online today without learning server administration, the proxy route is faster. QuotaGuard Shield's Production plan is $49/month. That's the math.

Latency Won't Affect Your Strategy

QuotaGuard Shield adds roughly 10 to 50ms per request. That number comes up in developer forums. It's worth addressing directly.

It doesn't matter for the strategies that hit this static IP wall. High-frequency trading firms don't deploy on Heroku or Render. They use NSE co-location. If you're running a cloud-based bot, you're running daily bars, hourly signals, intraday momentum, or options strategies. For those timeframes, 20 to 50ms is irrelevant. Your fill quality is determined by the market, not the proxy hop.

SEBI's static IP requirement is an identity verification layer. It runs at connection time, before any orders are placed. It's not in the critical path of execution speed. It's a handshake that proves you're a registered, traceable trader. That handshake needs to succeed. It doesn't need to be fast.

If you want to minimize overhead on execution calls, you can whitelist your static IP and connect to the Dhan API directly for order submission while routing authentication requests through QuotaGuard Shield. Both approaches work. With Shield's SSL passthrough, routing everything through adds no security exposure. For most traders, routing everything through the proxy is simpler with no meaningful downside.

Get Back to Trading

Sign up at quotaguard.com/products/pricing. Set QUOTAGUARDSHIELD_URL in your environment. Register your static IP in your Dhan API dashboard at api.dhan.co.

We confirmed the connection on April 2, 2026. api.dhan.co responds through QuotaGuard Shield's proxy. The infrastructure works. The registration step is what's left on your end.

The same static IP covers all your broker connections. If you're also running through Zerodha, Upstox, or Kotak Neo, one QuotaGuard Shield subscription handles all of them from the same IP.

QuotaGuard Static IP Blog

Practical notes on routing cloud and AI traffic through Static IPs.

Reliability Engineered for the Modern Cloud

For over a decade, QuotaGuard has provided reliable, high-performance static IP and proxy solutions for cloud environments like Heroku, Kubernetes, and AWS.

Get the fixed identity and security your application needs today.