If I use a magnet to levitate another magnet, where is the energy coming from?

By | July 12, 2018

Imagine I use one static magnet to levitate another magnet indefinitely. This levitating magnet is in a narrow tube that wont allow it to rotate and get attracted. So it will keep levitating forever, right?

Since gravity uses energy to push us down to earth, and this magnet is counteracting gravity, where is this energy to counteract gravity come from?