The use of grating as a spectral filter provides a simple way of improving wavelength tuning and stability of continuous-wave optical parametric oscillators (cw OPOs). In this paper, we discuss how to design and use such grating-cavity cw OPOs for high-resolution spectroscopy in the molecular fingerprint region at ∼3μm. The first design presented in the paper is based on a metal-coated diffraction grating, which produces fast and broad wavelength tuning and high wavelength stability. The second design uses a bulk Bragg grating for high optical power and good spectral purity. We report a new Bragg-grating OPO and demonstrate its use in a Doppler-free absorption spectroscopy of CH4 at ∼3.22μm. In addition, we describe a new balanced detection scheme, which can be used to improve the signal-to-noise ratio of absorption measurements if the measurement noise is limited by the intensity noise of the mid-infrared OPO.