A patient interface mask for use with a breathing assistance apparatus includes a seal that, in use, circumscribes a nose, mouth, or nose and mouth of a patient and defines an interior space of the mask. The mask includes an inlet into the interior space and an outlet from the interior space. A sensor is positioned outside of the interior space and in the path of exit gases exiting the interior space through the outlet. The sensor detects a parameter of the exit gases, such as temperature, humidity or both.