Heroin addicts could be getting a clean, medically supervised facility to shoot up — all at the city’s expense.

The City Council has allocated $100,000 to the Health Department for a nine-month study of whether it makes sense to open “supervised injection facilities” where intravenous drug users could get high under medical supervision.

Officials said such facilities, which already exist in dozens of cities outside the US, help prevent drug overdoses, reduce HIV and viral hepatitis transmission and connect addicts with drug-treatment options.

“It’s been done and been implemented in other areas [of the world], so we just want to look up what the viability would be in New York,” said Council Speaker Melissa Mark-Viverito.

The study comes as the city is grappling with a record 937 fatal drug overdoses in 2015, a 66 percent increase since 2010.

But state Conservative Party Chairman Michael Long said the $100,000 could “be put to better use than sending a message that it is OK to use intravenous drugs as long as you use a government-sanctioned place.”

About 100 such legal drug dens are open in Europe and Canada.

A few US cities, including Seattle and Ithaca, NY, are examining the idea.

Earlier this year, Boston opened a facility where addicts can ride out their highs under medical observation, but only after injecting themselves elsewhere.

Mark-Viverito declined to address the legality of supervised injection facilities or whether she supports them, saying she plans to await the study’s findings.

Researchers will review data on health conditions and disease transmission related to heroin and other injected drugs; evaluate existing supervised injection facilities; assess legal issues and get input from select “city officials and community experts,” according to a council memo.

The $100,000 is coming from $5.6 million set aside in the city budget to combat AIDS.

Officials would like to reduce incidents like this overdose on a public bus: