Mr. Avenatti’s efforts have also fostered a circuslike atmosphere around a criminal inquiry into Mr. Cohen for which prosecutors have sought records of payments to Ms. Clifford and another woman who alleges she had an affair with Mr. Trump, the former Playboy model Karen McDougal.

Mr. Avenatti backed off from trying to formally involve himself in that case on Wednesday, when he withdrew a motion that would have allowed him to participate in the proceedings after being called out by the federal judge presiding over the case, Kimba M. Wood. During a hearing on the case, Judge Wood warned Mr. Avenatti that he would “not be permitted to use this court as a platform for anything.”

Also during the hearing, Mr. Cohen’s lawyers accused Mr. Avenatti of “aggrandizement” and acting unethically in releasing his report on Mr. Cohen’s finances and claiming that his law firm never represented Ms. Clifford.

It was only the latest in a series of testy exchanges between allies of Mr. Trump and Mr. Avenatti, who appears to relish the conflict and the prospect of getting under his rivals’ skin. He posted a video on Twitter of one of Mr. Trump’s lawyers, Rudolph W. Giuliani, in women’s clothing in response to Mr. Giuliani calling him a “pimp.”

But Mr. Avenatti has bristled at questions about his financing, which escalated after Ms. Clifford admitted in late April that she was not paying his fees.

Mr. Avenatti said on Thursday that Ms. Clifford initially paid him a small amount in legal fees, but is no longer footing the bill for his services, which he said are being funded entirely by donations made through a crowdfunding website.

More than $527,000 from more than 15,000 donors has been raised on the website, which states that the money will go toward attorney’s fees, arbitration, security expenses, out-of-pocket costs associated with the lawsuit and potential damages if Ms. Clifford loses.