We construct a quantum system which generates the finite size effects in massive integrable models of QFT. The quantum system is built on a pair of operators creating particles wrapping the space and the time directions. The two wrapping operators are given a representation as vertex operators for a pair of free bosonic fields. The partition function at finite volume is represented as the expectation value of an operator creating the ensemble of virtual particles wrapping the space direction. This operator simplifies after approximating the sum over mode numbers by an integral over the rapidities. The non-trivial measure in the rapidity space requires adding a pair of fermionic partners of the two bosonic fields. The expectation value is formulated as a path integral which localises to the critical point described by the TBA equations. We restrict ourselves to a field theory with a single particle with factorised scattering and no bound states, such as the sinh-Gordon model. Both periodic and open boundary conditions are considered. In case of periodic boundary conditions the loop effects due to bosons and fermions compensate completely while for open boundary conditions the one-loop contribution gives the universal part of the boundary free energy.