If they are only doing this mainly at night or this is when it first started occurring, you probably don't have enough ventilation. Ammonia builds up in the air from all the pooping and irritates the lungs and eyes. Minimum of 1/2 square foot per bird of vent space in the eaves of your coop, preferably on opposing sides of the walls closest to the ceiling. After cutting more vent space, the coughing and gagging should clear up pretty quick. However symptoms of a truly sick bird can be any or all of the following, at all times of the day... Standing around hunched over, tail hanging, feathers puffed up, bubbly eyes, pale comb, diarrhea, runny nose, coughing, not eating or drinking, extreme fatigue, etc... I wouldn't medicate unless you are sure they are sick.
However for future reference if you need antibiotics you can get them from
https://www.twincitypoultrysupplies.com/