debug_estimateStep API will estimate the required steps of the given transaction. You can create the transaction data without stepLimit and signature, and pass it to the API endpoint <scheme>://<host>/api/debug/v3. The transaction is not added to the blockchain but simply returns the estimated steps. Sample request messages will look like the bellows.
// Request message without stepLimit and signature