You are responsible to pay your attorney. That's spelled out in your contract with your attorney.

You are free to discuss with your lawyer the possibility of trying to recover attorney fees from your ex- through the divorce case.