Cephalexin, an antibiotic in the cephalosporin family, is used to treat infections caused by bacteria. Cephalexin is prescribed to treat respiratory tract, middle ear, skin, bone, and urinary tract infections (UTI). It's also used to prevent infections caused by streptococcal bacteria, including prevention of rheumatic fever. Cephalexin isn't recommended for sinus infections.