An interview Roseanne Barr gave to a celebrity rabbi in the days after her infamous twitter rant was released Sunday, showing a weeping Barr pleading for forgiveness and saying “I’m not a racist. I’m an idiot.”

Rabbi Shmuley Boteach released the emotional podcast interview, Barr’s first since ABC canceled the show “Roseanne.” Boteach, a longtime spiritual adviser for Barr, asked her why she would write something that was in such “complete contravention” of her Jewish values.

“I’m a lot of things, a loud mouth and all that stuff,” Barr said, sobbing. “But I’m not stupid for God’s sake. I never would have wittingly called any black person. . . a monkey. I just wouldn’t do that. I didn’t do that. And people think that I did that and it just kills me.”

Barr reiterated her explanation that she was medicated with the sleep drug Ambien when she posted the tweet comparing Valerie Jarrett, a former adviser to President Barack Obama, to an ape. The tweet in late May read: “muslim brotherhood & planet of the apes had a baby=vj.”

Barr told Boteach that she did not know Jarrett was black, an assertion she has also made publicly.

“When ABC called me and said ‘what is the reason for your egregious racism,’ I said, ‘Oh my God, it is a form of racism,'” Barr said. “I guess I didn’t know she was black, and I’ll cop to it, but I thought she was white.”

“But you still regret and don’t excuse what you wrote,” asked Boteach, who said he has been friends with Barr for two decades.

“Of course, no I don’t excuse it. I horribly regret it. Are you kidding? I lost everything, and I regretted it before I lost everything,” Barr responded. “And I said to God, ‘I am willing to accept whatever consequences this brings because I know I’ve done wrong. I’m willing to accept what the consequences are.'”

Barr added that many refuse to accept her apology. “I’ve made myself a hate magnet,” she said.

After Barr’s tweet about Jarrett, ABC shut down the revival “Roseanne” series starring the comedian. When Barr blamed the tweet on Ambien, the company that produces the drug responded saying, “racism is not a known side effect” of any of its medications.

Last week, three weeks after ABC abruptly canceled the show, the network said it has ordered a spinoff centered on the same family, but without Barr attached. The working title is “The Conners.”

Boteach, who The Post once called “America’s most famous rabbi,” has been a spiritual guide for the likes of Michael Jackson and Sen. Cory Booker, D-N.J. In releasing the podcast interview Sunday, he praised Barr for her “incredibly public and passionate commitment to Judaism.”

After Barr’s Twitter rant, Boteach said he “reached out to her and told her that she has a responsibility, in the name of repentance and her commitment to Judaism, to make this right.” In the interview, he asked her to affirm that she believes in the Torah values that “every human being is created equally in the image of God.”

Breaking down in tears, Barr spoke of her intense remorse: “After your heart is unfrozen and after it stops being broken from the pain you caused others, you stop being a robot and you’ve got to come back to God.”

Barr said what she did makes her “sick.” “I can’t defend it. I don’t want to defend it,” she said. The actress said she had been trying to call Jarrett to apologize to her personally.

“I caused a lot of pain. I know that, and that’s the worse feeling in the world,” she said. “I caused pain for my family, I caused pain for my mother, I caused pain to the 200 out-of-work actors that I loved, and the crew and writers. I feel so bad that they gave me another chance and I blew it.”

“But I did it,” she added. “And what can I do now except for say. . . I’m not a racist, I’m an idiot. And I might have done something that comes across as bigoted and ignorant, and I know that that’s how it came across. And you know, I just ask for forgiveness because I do love all people, I really do.”