  We develop a two-dimensional gravity path integral formulation of the $T \bar
T + \Lambda_2$ deformation of quantum field theory. This provides an exactly
solvable generalization of the pure $T \bar T$ deformation that is relevant for
de Sitter and flat space holography. The path integral sheds light on quantum
aspects of these flows in curved space, most notably the Weyl anomaly, the
operator relation for the trace of the energy-momentum tensor, and the
renormalization of the composite $T \bar T$ operator. It also applies to both
the Hagedorn and the holographic signs of such flows. We present explicit
calculations for the torus and sphere partition functions that reproduce
previous results in the literature, now in path integral language. Finally, we
use the path integral representation in order to establish an explicit map with
3d gravity, and obtain new predictions for flat space holography.
