Yes cord connected for a compressor like yours is legal.If the motor data plate says 15 amps FLA (full load amps), then a 20 amp breaker will be adequate. The breaker should be labeled HACR, meaning its motor rated.The wiring apacity rating should be 125% of the motor amps.#12 wire is close enough. Buy the proper receptacle and male cord cap rated for 20 amps at 240 volt, 2 prong plus a ground.As Ken mentioned before ,home compressors have built in overload protection so your good to go.Have fun.