Cefalexin, also spelled cephalexin, is an antibiotic that can treat a number of bacterial infections. Cefalexin can treat a number of bacterial infections including: otitis media, streptococcal pharyngitis, bone and joint infections, pneumonia, cellulitis, and urinary tract infections. It can also be used for the prevention of recurrent urinary-tract infections, bacterial endocarditis.