Eliot Spitzer’s hooker-loving ways have cost him big — with ex-wife Silda scoring a $7.5 million cash payout and a steady stream of payments to maintain her luxurious lifestyle as part of their divorce, The Post has learned.

A “postnuptial” agreement promises 56-year-old Silda a lifetime of ease in exchange for the years of humiliation she endured married to the former governor, who resigned in disgrace after being revealed as “Client No. 9” in a federal prostitution probe.

In addition to a $7.5 million settlement dubbed a “lump sum” but payable over seven years, Silda also gets $240,000 a year in maintenance for the rest of her life — with all the cash coming after Eliot pays the taxes.

Eliot, 54 — son of ailing real-estate magnate Bernard Spitzer — further promised to “use his best efforts” to ensure that Silda gets to stay in their tony Fifth Avenue apartment at no cost to her, or else move her to “a replacement residence of similar size, location and quality.”

The deal remains in effect even if Silda starts living with someone, but she has to give up her maintenance payments and pay “all the occupancy expenses” for the apartment if she remarries.

The 31-page deal was signed Sept. 4 and filed in the Manhattan County Clerk’s Office on Feb. 5.

Related records show Eliot — who has been dating political publicist Lis Smith, 23 years his junior — can easily afford his freedom.

Silda stood by Eliot’s side throughout the hooker scandal.Photo: Getty Images

The documents, which can be seen in full at radaronline.com, show Eliot had real-estate holdings valued at up to $46 million as of the date of the agreement.

He reported adjusted gross income of $4,268,000 for 2012, while Silda’s was $112,000.

Silda had grimly stood by her cheating hubby when he quit the governor’s office in 2008 over his hooker scandal, which revealed his penchant for wearing black socks while bedding then-call girl Ashley Dupre.

Silda and Eliot finally called it quits as a couple in a public statement last year after The Post published photos of him shacking up with Smith at her Soho apartment.

Smith had served as Eliot’s spokeswoman during his failed bid for city comptroller last year.

She was later hired as communications director by Mayor Bill de Blasio during his mayoral campaign but didn’t make it with him to City Hall.

In addition to the cash and housing, Eliot agreed to pay for a host of Silda’s living expenses, including health care and medical insurance, an accountant, housekeeper and part-time assistant.

Eliot has been cozying up to publicist Lis Smith of late.Photo: Anthony J. Causi

She also gets a new car “no more than every five years,” unspecified “entertainment” costs and up to $100,000 a year to donate to charity.

In a clear nod to Eliot’s philandering, both sides had agreed, pre-divorce, not to use the farm “in any way, including choice of visitors, that would cause any of their children emotional distress, unhappiness, embarrassment, hurt or harm in any way.”

They also pledged, post-divorce, to work out a “mutually agreeable schedule . . . so that each party has an equal number of weeks and weekends in any year.”

Either one can also trigger a sale to the other, with Eliot agreeing to pay at least $2.5 million, or half the market value, plus another $200,000 after taxes, if he exercises the option.

They also put in place a confidentiality agreement that stipulates that neither they nor reps may publish anything “concerning intimate details of their marriage” or “any other intimate details of the other’s life, or the other’s business, professional or financial affairs” without written consent.

They can be fined $125,000 to $375,000 for violating that agreement.

The first $1 million of Silda’s lump sum was due within 180 days of their legal separation.

That came on Christmas Eve.

Their split was finalized in February, with Spitzer jetting off with Smith on a first-class flight to Vail, Colo.

Earlier, Smith had brought Spitzer to her parents’ Bronxville home for Christmas, after which the couple were spotted frolicking in a hot tub while on vacation at a Jamaican resort.