Thousands of tenants living in city-subsidized housing would be barred from smoking in their own apartments under a City Council bill being introduced Thursday.

The bill, which is sponsored by Councilman Donovan Richards (D-Queens), would only apply to residential buildings that receive city subsidies for affordable housing, said Richards’ Deputy Chief of Staff Jerrel Burney.

Richards noted it would also apply to the 178,000 apartments in the Housing Authority, which are largely federally funded.

“We’re introducing it to push the conversation,” Burney said. “We don’t want it to contribute to [tenant] displacement or harassment — this is really about clean air.”

In newly-constructed buildings, the ban would be included in the terms of the lease and could be enforced through rent penalties.

Burney said the councilman is in discussions with the mayor’s office on how enforcement would work in existing buildings, where leases don;t include such a ban.

Mayor de Blasio has vowed to create and preserve f 200,000 units of affordable housing.

If he reaches the goal and Richards’ legislation passes, the apartment smoking ban would be the most extensive in the nation.

But enforcing new smoking bans on tenants who’ve lived in a building before new rules were put into place could be tricky.

Jeffrey Brodsky, vice chairman of the Related Companies, which controls 50,000 smoke-free apartments throughout the country, said landlords of rent-stabilized properties in New York can’t evict tenants who smoke because of state laws.

“The easiest is new construction,” he said, referring to the implementation of smoking bans.

Audrey Silk, president of the smokers’ advocacy group NYC CLASH, predicted that many tenants would resist.

“It’s old-fashioned discrimination,” she said. “This is class warfare. If you can’t afford your own house, you’re the slave living in the master’s house.”

But the city Health Department was more receptive.

“Exposure to secondhand smoke at home is a serious health issue,” said department spokesperson Carolina Rodríguez.

“The Health Department looks forward to reviewing the legislation and to adding to the discussion around this important topic.”

At least two individual buildings with city-subsidized affordable housing are already smoke free — the 124-unit Arbor House in The Bronx and 84-unit Utica Place in Brooklyn.

At Utica Place, smoking is prohibited in individual units, common areas and within 25 feet of its exterior. A spokesman for C&C Apartment Management, which oversees the property, declined to comment on enforcement.

New York would not be the first city to issue a blanket smoking ban in apartments in subsidized housing if the bill is adopted. Numerous other cities have banned smoking in the apartments of public housing, including Los Angeles, Phoenix and San Diego.