Bill Clinton is enjoying the private residence above his presidential library in Arkansas at the expense of taxpayers and his charity foundation — a potential violation of nonprofit regulations.

The 5,000-square-foot penthouse which sits atop the William J. Clinton Library in Little Rock is largely funded by the National Archives in Washington, which pours nearly $6 million into program and maintenance costs for the entire institution every year, a spokeswoman for the federal agency told The Post.

Costs are also offset by a $7 million endowment from the Bill, Hillary & Chelsea Clinton Foundation. Last year, the interest from the endowment amounted to just over $200,000, which was used to offset the operation and maintenance costs, the spokeswoman said.

Yet, Clinton uses the penthouse for private soirées, in some cases inviting library interns to the apartment for drinks and to give him a foot massage, writes Ed Klein in his new book “Guilty as Sin.”

If Clinton is using the apartment for personal interests above the work of the Clinton Foundation and the library, he needs to inform the IRS, a charity expert says.

“If it’s just personal, you need to declare it as a benefit on your taxes,” said Marcus Owens, an expert in nonprofit law and a former IRS official.

The apartment was completed along with the $165 million library in November 2004.