Gravitational waves from stellar-mass binary black hole mergers can come from different formation environments, such as star clusters, active galactic nuclei (AGN) disks, or isolated binary evolution in the field. Some intrinsic characteristics of the gravitational-wave signal, such as eccentricity, spins and phase shifts, can give clues about formation channels. However, some of these characteristics can be found in more than one environment, which can make it difficult to tell them apart. Gravitational lensing by an object inside the environment (self-lensing) can help distinguish their origin by imprinting additional signatures on the waveform. In this talk, we quantify the probability of self-lensing and its detectability for LIGO-Virgo-KAGRA and Einstein Telescope sources. While most self-lensing by stellar-mass black holes is undetectable, central massive black hole lenses can imprint detectable signatures and a few (1-10) of these self-lensed events could be detected in next generation detectors. The combination of self-lensing imprints with other characteristic signatures of each environment can give additional information to reveal their origin.