Cephalexin is a cephalosporin (SEF a low spor in) antibiotic. It works by fighting bacteria in your body. Cephalexin is used to treat infections caused by bacteria, including upper respiratory infections, ear infections, skin infections, urinary tract infections and bone infections.