First: this one belongs to your doctor
Obstructive sleep apnea means your airway repeatedly narrows or closes while you sleep. It is linked with high blood pressure, heart disease, stroke and diabetes, and with falling asleep at the wheel. CPAP is the most reliable treatment, and there are others.
If you have been diagnosed, do not stop or change your treatment because you changed your diet. If you have not been diagnosed but recognize the signs, start there.
Trial one: two weeks of keto
Twenty patients with obesity hypoventilation syndrome, a serious condition in which breathing is too shallow to clear carbon dioxide, ate their usual diet for a week, a ketogenic diet for two weeks, then their usual diet again. On keto their sleep apnea severity and overnight oxygen improved and they lost 3.4 kg.
There was no control group, the condition is not the same as ordinary snoring, and the main benefit reversed once the regular diet resumed. An editorial in the same journal summed it up as interesting physiology with a long way to go.
Trial two: keto on top of CPAP
Seventy patients with obesity and sleep apnea who were waiting for weight-loss surgery were randomly assigned to four weeks of CPAP alone or CPAP plus a low-calorie ketogenic diet. Breathing pauses improved in both groups. Adding the diet made no further difference to the pauses, though the diet group lost weight and lowered their blood pressure and an inflammation marker.
What weight loss does in general
The larger body of evidence is about weight loss by any method. A pooled analysis of 27 studies found that a 20% reduction in body mass index went with about a 57% reduction in breathing pauses, with a wide margin of uncertainty. That is a large improvement, and it is still partial for most people. Only a repeat sleep study can tell you where you stand.
If you use CPAP
Keep using it. If you lose a meaningful amount of weight, tell your sleep doctor and ask whether your settings should be rechecked. That is their call, not a diet book's.