An apparatus for separating a gas mixture comprising carbon monoxide, nitrogen, hydrogen and methane, comprising a heat exchanger for cooling the gas mixture, means for separating the gas mixture cooled in the heat exchanger by at least one scrubbing and/or distillation and/or partial condensation step, to form a hydrogen-depleted fluid containing carbon monoxide and nitrogen, a denitrification column comprising a top condenser and a bottom reboiler, a pipe for sending the hydrogen-depleted fluid to the denitrification column, to produce a nitrogen-enriched gas at the column top and a nitrogen-depleted liquid at the column bottom, a nitrogen cycle using a nitrogen compressor comprising at least a first stage and a second stage, the entry pressure of the first stage being lower than that of the second stage, means for sending liquid of the nitrogen cycle to the condenser of the denitrification column, means for expanding bottom liquid from the denitrification column, means for sending the expanded liquid to the top condenser of the denitrification column for at least partial vaporization by heat exchanger in a heat exchanger of the condenser with the nitrogen-enriched gas, which is thereby condensed, means for sending nitrogen vaporized in the heat exchanger of the condenser to the inlet of the second stage of the nitrogen compressor, a methane and carbon monoxide separation column comprising a top condenser which is a bath vaporizer placed in a bath of liquid,
- a) means for sending the bottom liquid from the denitrification column to the methane and carbon monoxide separation column, or
- b) the methane and carbon monoxide separation column, means forming part of the means for separating the gas mixture cooled in the heat exchanger by at least one distillation step,
- the apparatus further comprising means for sending liquid nitrogen from the nitrogen cycle to the top condenser of the methane and carbon monoxide separation column.