Alprim is used to treat infections of the urinary tract caused by bacteria. Alprim belongs to a group of medicines called antibiotics. It works by stopping the growth of the bacteria that is causing your infection.