A cell for gas generation is provided, particularly for the operation of a lubricant dispenser. The cell has two electrodes to be connected to a circuit containing a power source, and an aqueous electrolyte fluid located between the two electrodes, containing an azide having the formula XN3, for electrochemical generation of a gas containing nitrogen (N2). The electrolyte fluid contains a magnesium salt as an additive, for chemical binding of hydroxide ions that are formed during the electrochemical reaction.