A person who issues a divorce petition can sometimes (not always) claim costs against the other spouse. Those are only the divorce costs - ie the part of the process which ends in decree absolute and dissolves the marriage. Those costs will include the court fee to issue the divorce petition and any legal costs incurred. Unless there is something unusual about the circumstances (such as the divorce actually being defended and fought out in court) these total costs are limited and should not run into thousands.
What can run into the thousands are the costs incurred in resolving the financial issues arising from the marriage if the spouses are not agreed. However, the rule in this separate set of proceedings is that each side pays its own costs. One side will only be ordered to pay the other's costs (or some portion of them) in this type of proceeding if there has ben some type of gross unreasonableness in the conduct of the proceedings.