  The $K^-/K^+$ ratio produced in heavy-ion collisions at GSI energies is
studied. The in-medium properties at finite temperature of the hadrons involved
are included, paying a special attention to the in-medium properties of
antikaons. Using a statistical approach, it is found that the determination of
the temperature and chemical potential at freeze-out conditions compatible with
the ratio $K^-/K^+$ is very delicate, and depends very strongly on the
approximation adopted for the antikaon self-energy. The use of an energy
dependent $\bar{K}$ spectral density, including both s and p-wave components of
the $\bar{K}N$ interaction, lowers substantially the freeze-out temperature
compared to the standard simplified mean-field treatment and gives rise to an
overabundance of $K^-$ production in the dense and hot medium. Even a
moderately attractive antikaon-nucleus potential obtained from our
self-consistent many-body calculation does reproduce the ``broad-band
equilibration'' advocated by Brown, Rho and Song due to the additional strength
of the spectral function of the $K^-$ at low energies.
