Is there a code for a 1'' air gap in a tub spout installation?

Yes and an air gap for a basin faucet and an air gap located in most dishwasher and washing machines.

The actual size of the air gap is 2 times the effective opening (supply pipe) but in no case less then 1 "