We present a perturbative derivation of the T-system that is believed to encode the exact spectrum of planar N = 4 SYM. The T-system is understood as an operator identity between some special line operators, the quantum transfer matrices. By computing the quantum corrections in the process of fusion of transfer matrices, we show that the Tsystem holds up to first order in a semi-classical expansion. This derivation does not rely on any assumption. We also discuss the extension of the proof to other theories, including models describing string theory on various AdS spaces.