The Sloan Digital Sky Survey--III (SDSS--III) Apache Point Observatory Galactic Evolution Experiment (APOGEE) has obtained high resolution (R $sim$ 22,500), high signal-to-noise ratio ($>$ 100) spectra in the H$-$band ($sim$1.5$-$1.7 $mu$m) for about 146,000 stars in the Milky Way galaxy. We have computed spectral libraries with effective temperature ($Trm{_{eff}}$) ranging from 3500 to 8000 K for the automated chemical analy-sis of the survey data. The libraries, used to derive stellar parameters and abundances from the APOGEE spectra in the SDSS--III data release 12 (DR12), are based on ATLAS9 model atmospheres and the ASS$epsilon$T spectral synthesis code. We present a second set of libraries based on MARCS model atmospheres and the spectral synthesis code Turbospectrum. The ATLAS9/ASS$epsilon$T ($Trm{_{eff}}$ = 3500$-$8000 K) and MARCS/Turbospectrum ($Trm{_{eff}}$ = 3500$-$5500 K) grids cover a wide range of metallicity ($-$2.5 $leq$ [M/H] $leq$ $+$0.5 dex), surface gravity (0 $leq$ log $g$ $leq$ 5 dex), microturbulence (0.5 $leq$ $xi$ $leq$ 8 km~s$^{-1}$), carbon ($-$1 $leq$ [C/M] $leq$ $+$1 dex), nitrogen ($-$1 $leq$ [N/M] $leq$ $+$1 dex), and $alpha$-element ($-$1 $leq$ [$alpha$/M] $leq$ $+$1 dex) variations, having thus seven dimensions. We compare the ATLAS9/ASS$epsilon$T and MARCS/Turbospectrum libraries and apply both of them to the analysis of the observed H$-$band spectra of the Sun and the K2 giant Arcturus, as well as to a selected sample of well-known giant stars observed at very high-resolution. The new APOGEE libraries are publicly available and can be employed for chemical studies in the H$-$band using other high-resolution spectrographs.