Gawker is negotiating a truce to its decade-long war with Silicon Valley billionaire Peter Thiel, The Post has learned.

A bankruptcy attorney for the shuttered website is in settlement talks with representatives for Thiel, according to Manhattan federal court records.

Gawker has already paid legendary wrestler Hulk Hogan $31 million to settle a $140 million jury award for publishing his sex tape. Thiel, who co-founded PayPal, was not named in that deal even though he funded Hogan’s lawsuit.

Thiel’s war with Gawker founder Nick Denton started in 2007 when one of Gawker’s sister sites outed the entrepreneur as gay.

Last month Galardi had two, 30-minute phone calls with attorneys for Thiel to discuss a “potential settlement,” according to a fee statement filed in Manhattan bankruptcy court this week.

Galardi told The Post the talks are focused on a motion Gawker filed in October for documents and testimony from Thiel about his support of the Hogan litigation and other lawsuits against the gossip website.

Forbes revealed last year that Thiel had secretly paid for Hogan’s lawyers. The resulting $140 million award drove Gawker and Denton into bankruptcy last summer.

Now both Denton and Thiel want to put their beef behind them, a source said. An eventual deal would likely protect Denton from future lawsuits funded by Thiel, the source said.

Denton dismissed the significance of the discussions, saying they were about “a few loose ends.” He added, “As far as I’m concerned, my decade-long involvement with Peter Thiel is over. Other journalists can pick up that particular chalice.”

A lawyer for Thiel declined to comment.

Denton bailed himself out of bankruptcy Wednesday. He’s expected to walk away with around $16 million cash after selling Gawker.com’s sister websites Deadspin and Jezebel to Univision for $135 million and settling with Hogan for $31 million.

Hogan’s attorney, Daniel Tabak, said, “We’re pleased that this matter was resolved and everybody can move on with their lives now.”

But Gawker remains in bankruptcy as the IRS conducts an audit of the company’s 2014 and 2015 tax returns.

The IRS has said Gawker owes $2.5 million in federal income tax liabilities, but Galardi is contesting the claim.

Manhattan Bankruptcy Court Judge Stuart Bernstein said he would keep Gawker’s case open at least for another three months while the IRS completes its probe.