The present invention relates to optimized gas supply utilizing photoplethysmography. Flow rate, pressure or amount of gas is adjusted as a function of blood oxygen saturation data, photoplethysmography signals, or both, obtained from the pulse oximeter probe.