Controlling the formation and stoichiometric content of the desired phases of materials has become of central interest for a variety of fields. The possibility of accessing metastable states by initiating reactions by X-ray-triggered mechanisms over ultrashort time scales has been enabled by the development of X-ray free electron lasers (XFELs). Utilizing the exceptionally high-brilliance X-ray pulses from the EuXFEL, we report the synthesis of a previously unobserved yttrium hydride under high pressure, along with nonstoichiometric changes in hydrogen content as probed at a repetition rate of 4.5 MHz using time-resolved X-ray diffraction. Exploiting non-equilibrium pathways, we synthesize and characterize a hydride in a Weaire-Phelan structure type at pressures as low as 125 GPa, predicted using a crystal structure search, with a hydrogen content of 4.0-5.75 hydrogens per cation, that is enthalpically metastable on the convex hull.