2002 Grand Prix air conditioner not working

at first, of the 5 levels, the lower levels didn’t work, then it stopped on all levels, then one day, the car was off, the key was out and the blower came on; i’ve replaced the 30amp fuse; now it doesn’t work at all, but cool air does come out, not via the blower, but via the vent when I’m on the highway

When you turn the ignition switch off, all power to accessories should be cut off. It does happen in some cars that the ignition switch is turned by the key to the off position, and the engine does turn off, but sometimes the accessories stay running and the dashboard lights stay on, just because the ignition switch is mostly off, but not entirely. You don’t mention that any of the other accessories stay on, but if say, the fan motor AND the radio and the dashboard lights all stay on, then your ignition switch is a problem.
Either way, in your case, clearly you had a failing fan motor, and I think it has failed entirely. I think you have two problems going on at the same time, a broken fan motor and a suspect ignition switch. The good news is your a/c is working fine.

You need the fan motor to work in many states to pass inspection, to defrost or prevent condensation on the interior windshield when it rains. It is a safety issue more than it is a comfort issue.
As for the ignition switch, generally the off position gets shaky. You can get by just by making sure the car is solidly in park and locking the steering wheel every time you turn the car off.

Typical fan motor. The fan speed is controlled by resistors. The low speed ones generally go first. When the motor starts to go, it demands more energy and the low speed resistors are first to burn out.

I would expect a new fan motor and resistor pack. It should not be too expensive.

thanks for the info, i am going to check to see if this is under warranty…only 68K so maybe it is.