Hot star winds are driven by the radiative force due to light absorption in lines of heavier elements. Therefore, the amount of mass lost by the star per unit of time, i.e., the mass-loss rate, is sensitive to metallicity. We provide mass-loss rate predictions for O stars with mass fraction of heavier elements 0.2 <Z/Z☉ <= 1. Our predictions are based on global model atmospheres. The models allow us to predict wind terminal velocity and the mass-loss rate just from basic global stellar parameters. We provide a formula that fits the mass-loss rate predicted by our models as a function of stellar luminosity and metallicity. On average, the mass-loss rate scales with metallicity as (Z/Z☉)0.59. The predicted mass-loss rates agree with mass-loss rates derived from ultraviolet wind line profiles. At low metallicity, the rotational mixing affects the wind mass-loss rates. We study the influence of magnetic line blanketing.