What, staying out of the clink wasn’t enough?

The teen charged with head-butting a cop during the weekend’s melee at a Brooklyn housing project was given a sweetheart deal that let him walk out of court with no bail and no jail — and then had the gall to demand a job.

Guillermo Lopez, 17, was arrested Sunday for assaulting an officer during a massive police response to the Marcy Houses Saturday night in which three others were arrested and 11 people were summonsed for not complying with cops’ orders to disperse.

Prosecutors sought a $10,000 bail amount, but Brooklyn criminal court Judge Claria Daniels-DePeyster cut Guillermo Lopez loose as part of the city’s supervised release program.

But as the program was being explained to the teen, he shot back that he wanted a gig.

“They just told me to go and talk to the social worker. They told me don’t miss a day of that program, and I told them give me a job,” Lopez told The Post on Monday. “I gotta do a program. Either jail or that.”

The program, run by the Center for Court Innovation since 2014, gives judges discretion to keep eligible suspects out of jail — but does not guarantee jobs for participants.

According to the Center for Court Innovation, Lopez was released under the Pretrial Youth Engagement Program, which was expanded to Brooklyn in March 2018. Defendants who are younger than 19 and who are facing charges that include second-degree assault and second-degree robbery are eligible to take part.

The judge did not respond to a request for comment, but the NYPD was less than pleased.

“Any attack on our police officers is unacceptable,” Chief of Department Terence Monahan told The Post, reacting to the news about Lopez. “We need our court system to take assaults on cops seriously. People must be held accountable if they lay a hand on any police officer.”

Lopez was one of four people arrested in the weekend melee at the Bedford-Stuyvesant housing project that injured three cops. The NYPD said nine shots were fired into the air, which law enforcement sources described as a “F–k you’ to the cops.”

The unrest began around 11 p.m. Saturday when officers responded to reports of a large and unruly crowd at the Bedford-Stuyvesant housing complex. Police said the crowd became increasingly unruly when they took one person into custody.

Police responded to a call of a disturbance, and found that tenants had open barbecue grills on city property and party goers drinking in public. But the situation got out of control when cops tried to break it up – with the tenants blaming the officers.

Naomi Colon, president of the Marcy tenants association, said it was “an outright lie” that the tenants started the brawl.

“We had a beautiful family day and after we shut down the grills, you can’t just take them up into your houses. They have to cool down,” Colon said. “We had them out there and I think the cops were too insistent, too pushy. They didn’t call me or anything.”

“They were pushing these young people around,” she said. “It didn’t have to go that way.”

Janay Graham said she needed five staples to close a gash in her head after she was smacked with a police nightstick, leaving her covered in blood. She said her nephew, Jeffrey Lloyd, was among those arrested by police.

“It was frantic,” Graham said. “There were so many cops, I’ve never seen that many. There were like 10 precincts there.”

Lawyer Sandy Rubenstein, who said he was representing tenants involved in the melee, said he would ask for a probe of police conduct.

“I will be turning over all video my clients have to the Brooklyn district attorney and requesting that the bureau that reviews police misconduct begin an investigation,” he said.

Lopez’s lawyer, Legal Aid attorney Samuel Getz, did not return a call for comment.

Additional reporting by Andrew Denney and Julia Marsh