Browse docs
Docs / Obtaining API Credentials

Obtaining API Credentials

To trade or pull live data you need API credentials from your broker. This app supports three brokers — you only need credentials for the one(s) you actually use. Each has its own dedicated setup page under Brokers in the sidebar:

  • Kite (Zerodha) — the default and best-tested broker. Daily OAuth login; static IP required for order placement.

  • Breeze (ICICI Direct) — recommended for multi-day historical simulations (better historical option data retention than Kite). Daily OAuth login; static IP required.

  • Dhan — newest integration. Supports automatic OAuth-style login via an API Key (recommended), or manual daily token paste as a fallback. Static IP is mandatory, enforced server-side by Dhan itself.

Enter credentials on the Auth page (top navigation bar). They are stored securely in the OS keychain — you enter them once, then just refresh the daily token.

Quick Reference

Broker Get credentials at Redirect URL to register
Kite (Zerodha) https://developers.kite.trade/ http://127.0.0.1:5000/
Breeze (ICICI Direct) https://api.icicidirect.com/apiuser/home http://127.0.0.1:5000/breeze_callback
Dhan https://web.dhan.co (My Profile → Access DhanHQ APIs → API Key) http://127.0.0.1:5000/dhan_callback

Adjust the host and port in the redirect URLs to match how you actually run the app.

API Contract Check

Every broker's token is validated immediately after exchange — the app calls the read-only endpoints it actually depends on (margins/positions/orders) before saving the token. If any call fails, the token is not saved and the Auth page shows which specific features would have broken (sizing/safety limits, reconciliation, or order retry-dedup). Re-check your credentials and retry login if you see this. Details on what's checked for each broker are on its own page above.

Applies to ThetaPrime v0.35.4 · Page last updated 2026-08-14