Shia LaBeouf will do anything to raise money for charity.

During a recent visit to "The Ellen DeGeneres" show, the talk show host challenged LaBeouf to eat a ghost pepper, known for being one of the spiciest foods on Earth.

"I want to give you $10,000 for a charity of your choice," DeGeneres, 61 said. "But I understand you like spicey things?"

SHIA LABEOUF THANKS POLICE OFFICER WHO ARRESTED HIM IN 2017 FOR 'CHANGING MY LIFE'

LaBeouf confirmed that he enjoys spicy foods as the pepper was brought to him.

"There's water here, what else can we help you with if this pepper's really, really bad?" DeGeneres asked.

"That pepper's gone," LaBeouf said. "Say 'bye-bye pepper.' He's out of here. Bye-bye pepper."

Without hesitation, the actor, 33, chomped down on the pepper.

"That's a cute little pepper right there," LaBeouf said. "It's a cutie pie. It'll take a minute to kick in probably."

"Be careful, I don't want to throw up on your knee right there," LaBeouf joked, placing a tray in his lap just in case.

While the pepper may not have affected LaBeouf, the actor revealed to DeGeneres that his recent arrest and "head camp" did, inspiring him to write the autobiographical film "Honey Boy."

LaBeouf said he wrote "the first chunk [of the film] in this head camp they sent me to" before reuniting with his father after seven years apart and finishing the script.

"When I got home, I hadn't seen my dad in seven years and my director, Alma Har'el, who's a wizard, she was like, 'You need to go see your dad,'" LaBeouf said. "So I went and saw my dad, recorded that, came home and I had the ending, wrestled it down and that was the process."

When asked by DeGeneres what "head camp" was, LaBeouf explained: "Head camp is where the court sends you when the other option is seven years in jail, pretty much. I got arrested in Georgia for terrorizing a police officer, which is a felony charge and they said 'you've got a problem.'"

LaBeouf then discussed his experience in the "head camp," where he was diagnosed with, and began treatment for, post-traumatic stress disorder.

GLENN CLOSE SAYS EMMA STONE 'DOESN'T HAVE TO TALK TO ME' IN PREPARATION FOR DISNEY'S 'CRUELLA' FILM

"They said 'we've got a solution' and we started doing this stuff called exposure therapy," LaBeouf recounted. "Through that process, recording all those conversations, was where the movie came from."

"Honey Boy" tells the story of LaBeouf's time as a child actor on the Disney Channel show "Even Stevens," when he was supporting his "off-color" father, who worked as a clown.

Finally, LaBeouf revealed that his father didn't have many notes for the movie, but wanted it to express his "relationship he had with a chicken named Henrietta LeFowl who was the world's first daredevil chicken."

CLICK HERE TO GET THE FOX NEWS APP

LaBeouf recounted his father's clown act with Henrietta.

"My dad used to put this chicken on his head and do cartwheels," LaBeouf said. "The chicken would run from his head to his butt, from his head to his butt."

"Honey Boy" hits theaters Friday.