Gabapentin is a prescription medication used to treat epilepsy, seizures, and nerve pain. This medication is in a class of drugs called anticonvulsants. Gabapentin may also be used to treat anxiety disorders, restless leg syndrome, and depression. Gabapentin is also used to treat pain caused by shingles (a painful rash that often follows a chickenpox infection). Gabapentin may be taken as a capsule or tablet. This medication should be taken with food.