How long the opening has to be
The IRC asks for 6 ft 8 in of headroom over a stair, measured straight up from the line that joins the tread nosings. That line falls one riser for every tread from the top of the stair, so under an opening it is lowest below the header at the far end: the clear height there is the opening's length × riser ÷ tread, less the depth of the floor at the header. A stair of 7½ in risers and 10 in treads, under an opening 120 in long in a floor 10 in deep, has 120 × 7½ ÷ 10 − 10 = 80 in: 6 ft 8 in, just enough.
Turned round, the shortest opening is (80 + floor depth) × tread ÷ riser: (80 + 10) × 10 ÷ 7½ = 120 in, 10 ft. An opening of 110 in leaves 72½ in, 7½ in short; with steeper risers the same opening clears more. Hung flush, with the top tread level with the floor, the whole flight sits a tread further out, and the opening needs a tread more: 130 in here.
What to measure
Measure the opening from the header the stair hangs on, back over the stair to the header at the far end. The floor depth is from the top of that floor to the bottom of the header: the flooring, the subfloor, the joist or the header itself and any ceiling under it — 10 in, for example, for 2×10 joists, 9¼ in deep, under a ¾ in subfloor. Pick "Stair under an opening" for the flight on any stair page to add these two boxes, and the IRC row for headroom stops saying "Not checked".
An opening longer than the flight leaves the floor below as the low point: a floor-to-floor rise of 105 in under a floor 10 in deep has 95 in at most, however long the opening. Where the rise is less than 6 ft 8 in plus the floor depth, no opening is long enough, and the page says so.
What this page does not count
The IRC lets the edge of the opening project up to 4¾ in into the headroom where the nosings at the side of the flight run under it, and gives spiral stairs 6 ft 6 in. This page uses neither, and on those two it can only call a stair short that your inspector passes. A beam, a duct or a light below the header is not in it at all, and any of them takes headroom away: measure to the lowest thing over the stair, not to the floor framing. The clause is R311.7.2 in IRC 2021 and R318.7.2 in IRC 2024, with the same 6 ft 8 in.