In order for setting up a magnetic flux, energy is required but no energy is required to continue it. The magnetic field holds the supplied energy and this energy is returned to the circuit when the magnetic field collapses, but finally the energy is consumed in the electric circuit.