Two-dimensional nonlinear optical materials with mechanical flexibility and strong second-harmonic generation capability have been increasingly recognized as a research focus in the field of nano-integration, owing to the rapid development of flexible optoelectronics and devices. Herein, the mechanical, electronic, and optical properties of CuBiP2X6 (X = S, Se) are studied systematically. The low elastic modulus indicates that CuBiP2X6 exhibits high structural flexibility, making it a promising candidate for flexible electronic devices. Meanwhile, an absorption coefficient as high as 4.2 × 105 cm−1 is observed in the near-ultraviolet region. CuBiP2X6 exhibits excellent absorption performance in the visible to near-ultraviolet range, characterized by multiple distinct absorption peaks. These characteristics are beneficial for efficient light harvesting and suitable for use in ultrathin optoelectronic devices. In addition, the material exhibits a strong second-harmonic response in the visible range, and this response exhibits a pronounced dependence on the azimuthal angle. This study not only enhances the understanding of the optoelectronic properties of CuBiP2X6 (X = S, Se) but also provides a theoretical basis and direction for the design and application of devices based on this material.