Aims. The aim of this paper is to understand the formation of the O I line at 7772 angstrom in the solar chromosphere. Methods. We used SST/CRISP observations to observe O I 7772 angstrom in several places around the solar limb. We compared the observations with synthetic spectra calculated with the RH code in the one-dimension spherical geometry mode. New accurate hydrogen collisional rates were included for the RH calculations. Results. The observations reveal a dark gap in the lower chromosphere, which is caused by variations in the line opacity as shown by our models. The lower level of the 7772 angstrom transition is populated by a downward cascade from the continuum. We study the effect of Lyman-beta pumping and hydrogen collisions between the triplet and quintet system in O I. Both have a small but non-negligible influence on the line intensity.