We demonstrated the tuning of whispering gallery modes (WGMs) of a silica microsphere during optical levitation through the annealing process. We determined the annealing temperature from the power balance between the CO2 laser light heating and several cooling processes. Cooling caused by heat conduction through the surrounding air molecules is the dominant process. We achieved a blue shift of the WGMs as large as 1 %, which was observed in the white-light scattering spectrum from the levitated microsphere.