Abstract Optical resonances arising from quasi-bound states in the continuum (QBICs) have been recently identified in nanostructured dielectrics, showing ultrahigh quality factors accompanied by very large electromagnetic field enhancements. In this work, we design a periodic array of gallium phosphide (GaP) elliptical cylinders supporting, concurrently, three spectrally separated QBIC resonances with in-plane magnetic dipole, out-of-plane magnetic dipole, and electric quadrupole characters. We numerically explore this system for second-harmonic generation and degenerate four-wave mixing, demonstrating giant per unit cell conversion efficiencies of up to ∼ 2 W−1 and ∼ 60 W−2, respectively, when considering realistic introduced asymmetries in the metasurface, compatible with current fabrication limitations. We find that this configuration outperforms by up to more than four orders of magnitude the response of low-Q Mie or anapole resonances in individual GaP nanoantennas with engineered nonlinear mode-matching conditions. Benefiting from the straight-oriented electric field of one of the examined high-Q resonances, we further propose a novel nanocavity design for enhanced spectroscopies by slotting the meta-atoms of the periodic array. We discover that the optical cavity sustains high-intensity fields homogeneously distributed inside the slot, delivering its best performance when the elliptical cylinders are cut from end to end forming a gap, which represents a convenient model for experimental investigations. When placing an electric point dipole inside the added aperture, we find that the metasurface offers ultrahigh radiative enhancements, exceeding the previously reported slotted dielectric nanodisk at the anapole excitation by more than two orders of magnitude.