The energy spectrum of the cosmic microwave background (CMB) radiation is long known to be very close to a perfect blackbody, as measured by COBE/FIRAS in the 90s. Yet, several mechanisms of interaction between matter and radiation throughout the thermal history of the universe (0 < z < 2 x 10^6) release energy to CMB photons, thus causing tiny deviations from a perfect blackbody, commonly referred to as CMB spectral distortions. I will give a pedagogical overview of CMB spectral distortions, and show how the CMB energy spectrum could provide another independent piece of information on the early universe, complementing information from the usual power spectrum of CMB temperature anisotropies. If time permits, I will discuss some of my recent work on anisotropic spectral distortions (relativistic SZ effect and mu-distortion anisotropies), aiming at building new cosmological observables to constrain the content of the universe.