While one can manually check margin for hedged options using Zerodha calculator, how can margin benefit be calculated programmatically for option buy to hedge short options, 'before' placing the orders. This is also equally important in case of margin computation for entire position which might have multiple short / long position for different strike and different expiry.
We have added basket order margin API to the python official package, you can upgrade to the latest version using pip install kiteconnect --upgrade. You can refer to the example here.
pip install kiteconnect --upgrade
. You can refer to the example here.