Xanax, also known by its generic name alprazolam, is a prescription medication used to treat anxiety disorders, panic disorders, and anxiety caused by depression. It belongs to a class of medications called benzodiazepines, which work by enhancing the effects of a neurotransmitter called gamma-aminobutyric acid (GABA) in the brain.