The optical constants of AlxGa1-xAs as a function of temperature in the range 1.24-5.00 eV have been measured using spectroscopic ellipsometry (SE) in situ immediately after growth in a specially designed molecular-beam epitaxy chamber. Because of a lack of native oxides, capping layer, and other surface adsorbates a simple two-phase (thin film/vacuum) model was used to calculate the optical constants directly from the SE data. In the photon energy region where the Alx Ga1-xAs layer became transparent, the dielectric function oscillates due to interference effects between the substrate and the thin film. The ε2 value in this oscillating region was assigned a value of zero and the Kramers-Kronig dispersion relation was then used to calculate ε1 for ε2. The dielectric functions, ε1 and ε2, of AlxGa1-xAs around the band gap region was determined by the three phase model (vacuum/thin film/substrate) with the knowledge of the layer thickness from transmission electron microscopy.