Cephalexin is an antibiotic that belongs to the class of cephalosporins. It is commonly used to treat a variety of bacterial infections, particularly those caused by Gram-positive bacteria. Cephalexin works by inhibiting the synthesis of bacterial cell walls, thereby killing the bacteria.