The abundance of metals in galaxies is a key parameter which permits to distinguish between different galaxy formation and evolution models . Most of the metallicity determinations are based on optical line ratios . However , the optical spectral range is subject to dust extinction and , for high- z objects ( z > 3 ) , some of the lines used in optical metallicity diagnostics are shifted to wavelengths not accessible to ground based observatories . For this reason , we explore metallicity diagnostics using far-infrared ( IR ) line ratios which can provide a suitable alternative in such situations . To investigate these far-IR line ratios , we modeled the emission of a starburst with the photoionization code cloudy . The most sensitive far-IR ratios to measure metallicities are the [ O iii ] 52 \mu m and 88 \mu m to [ N iii ] 57 \mu m ratios . We show that this ratio produces robust metallicities in the presence of an AGN and is insensitive to changes in the age of the ionizing stellar . Another metallicity sensitive ratio is the [ O iii ] 88 \mu m/ [ N ii ] 122 \mu m ratio , although it depends on the ionization parameter . We propose various mid- and far-IR line ratios to break this dependency . Finally , we apply these far-IR diagnostics to a sample of 19 local ultraluminous IR galaxies ( ULIRGs ) observed with Herschel and Spitzer . We find that the gas-phase metallicity in these local ULIRGs is in the range 0.7 < Z _ { gas } / Z _ { \odot } < 1.5 , which corresponds to 8.5 < 12 + \log ( { O / H } ) < 8.9 . The inferred metallicities agree well with previous estimates for local ULIRGs and this confirms that they lie below the local mass-metallicity relation .