(WPRI) — A weight loss trend going viral on social media has made it harder to find a type of diabetes medication.

The drugs Ozempic and Mounjaro are used to treat type 2 diabetes. The injections are shown to improve blood sugar levels and heart function, but doctors have more recently started prescribing them to help patients lose weight.

“This is a diabetic medicine, but it is different than insulin,” Dr. Stephen Ramirez told KENS. “It lowers your sugar, but there is a safety net so that my patients’ sugars don’t get too low.”

Influencers and celebrities on TikTok are showing off their weight loss with before-and-after pictures, giving credit to the medication. Elon Musk credited Ozempic for helping him lose 30 pounds. An ad for the drug even cites weight loss as a benefit of the drug, saying the average person loses 12 pounds.

But enthusiasm for the drug has led to a lower supply of the drugs. The Food and Drug Administration lists Ozempic as “currently in shortage.” Some patients report switching to lower doses to help stretch the supply.

“At one point I had patients waiting at least three months to get the initial medication and that was if they were paying with cash,”  Dr. Ramirez said. 

If insurance doesn’t cover it, it’s also not a cheap way to lose weight. Dr. Ramirez said a one-month supply of Mounjaro costs about $1,200 out-of-pocket and Ozempic costs about $875 per month.

Ramirez hopes the medication supply catches up with the demand. Both of the medications are available by prescription only.

This type of off-label prescribing of drugs is legal, the Los Angeles Times reports, but not regulated by the FDA.

Side effects of Ozempic and Mounjaro include possible pancreas inflammation, vision changes, low blood sugar and problems with the kidneys and gallbladder.