Stars with accurate and precise effective temperature (Teff) measurements are needed to test stellar atmosphere models and calibrate empirical methods to determine Teff. There are few standard stars currently available to calibrate temperature indicators for dwarf stars. Gaia parallaxes now make it possible, in principle, to measure Teff for many dwarf stars in eclipsing binaries. We aim to develop a method that uses high-precision measurements of detached eclipsing binary stars, Gaia parallaxes and multi-wavelength photometry to obtain accurate and precise fundamental effective temperatures that can be used to establish a set of benchmark stars. We select the well-studied binary AI Phoenicis to test our method, since it has very precise absolute parameters and extensive archival photometry. The method uses the stellar radii and parallax for stars in eclipsing binaries. We use a Bayesian approach to obtain the integrated bolometric fluxes for the two stars from observed magnitudes, colours and flux ratios. The fundamental effective temperature of two stars in AI Phoenicis are 6199 ± 22 K for the F7 V component and 5094 ± 16 K for the K0 IV component. The zero-point error in the flux scale leads to a systematic error of only 0.2% (≈ 11 K) in Teff. We find that these results are robust against the details of the analysis, such as the choice of model spectra. Our method can be applied to eclipsing binary stars with radius, parallax and photometric measurements across a range of wavelengths. Stars with fundamental effective temperatures determined with this method can be used as benchmarks in future surveys.