Carbon and nitrogen speciation has been studied in high-pressure experiments in the C–O–H–N and C–O–H–N–Fe3C systems at 5.5 to 7.8 GPa and 1100 to 1500 °C using a split-sphere multi-anvil apparatus. Oxygen fugacity in the samples was either buffered by the Mo–MoO2 (MMO) and Fe–FeO (IW) equilibria using a double-capsule technique or left unbuffered. fO2 varied from 2 log units below to +4 log units above the iron–wüstite oxygen buffer (IW) depending on water contents in the charges and buffering. Ultra-reduced fluids contained NH3 as the dominant species, but its concentration was slightly lower, while CH4 was higher at higher temperatures. As oxygen fugacity and temperature increased to fO2 0.7 log units above IW and T≥1400°C, N2 became the predominant nitrogen species; the dominance among carbon species changed from CH4 and C2–C5 alkanes to oxygenated hydrocarbons and higher alkanes. It has been found out for the first time that the N2-rich fluid lacks methane at fO2 4 log units above IW but may bear a few percent of C2H6, C3H8, and C15–C18 alkanes and within one percent of alcohols, aldehydes, ketones, carboxylic acids, and furans. Thus, the NH3 enrichment of fluids and the nitrogen storage capacity of silicates at depths ∼200 km are expected to be the greatest in cold (1100–1200 °C) and reduced continental lithospheric mantle. In a hotter lithosphere of ∼1400 °C, the concentrations of NH3 and N2 in fluids are similar, and the nitrogen storage capacity of silicates should be relatively low. The stability of some higher alkanes and oxygenated hydrocarbons in nitrogen-rich fluids near the enstatite–magnesite–olivine–diamond/graphite (EMOG/D) equilibrium suggest that these carbon species, together with N2, can survive at the redox barrier, where silicate or silicate–carbonate melts capture them and entrain to shallow mantle.