I want to point out that what keeps this 'OK' is that the little wire is so 'electrically short' compared to the actual wavelength at 1000khz (a real quarter wave antenna at that freq is like 75 meters)... and thus this limits the power of this 'transmitter' to probably nanowatts.
If the PIO pin could drive a fair amount of current at 3.3v into a long enough wire at that frequency you'd start to get into milliwatts, and AM radio is NOT a band that even amateur license operators can broadcast over a a certain power on. FCC part 15 dictates no more than a 3 meter antenna for personal devices at AM frequencies which is what does the power limiting essentially.
The harmonics fall off quick enough on such a setup that it wouldn't really be a problem - but the only way to really KNOW that is to have a real solid understanding of how this 'radio' you've just made is working, meaning how that square carrier wave is really being driven off the PIO pin, and thus you need the requisite EE knowledge and/or ham radio test equipment and experience.
I've seen more and more of these 'ChatGPT coded up a radio transmitter' posts and it kinda rubs me the wrong way. I'd like to see more calculations and disclaimers for people showing some responsibility with radio, and if it drives people to studying and taking an amateur radio license test that would be for the better...
At least you are supposed to be allowed to transmit on AM (and FM) bands at very low power, at least under FCC rules. That's how they can sell those adapters for car radios. Some other ones you definitely are not supposed to use as far as I know, like the old analog TV signals - I've seen a couple of those sorts of projects recently. On the other hand, you can go and buy an illegal TV transmitter on Amazon right now.
Also a reasonably even bet that you already own a low-quality wall power supply that will produce more interference than anything you're going to be doing with a Pico and a 4" jumper wire (I've found a couple of offending devices in my house), but I'm certainly in no position to tell you if you should or shouldn't do something.
Mea culpa.
Without the proper knowledge or measurement equipment, I observed that the audio would fade out after a 30 cm distance. Combined with running it for mere seconds to test and record a demo, I assumed to be in the clear with the spirit of the regulations. Appreciate the reminder to be responsible with RF.
I don’t know what the regulations are in your country (looks like you are maybe in Canada?), but in many countries it is straightforward to get an amateur radio license, and then you can have all sorts of fun (under the rules).
Transmitting on AM broadcast frequencies is generally prohibited unless it meets an extremely low-power exemption , even if you have amateur license(I have a Japanese amateur radio license). A practical way to reduce risk is to put a large resistor before the antenna so the radiated power stays within that exemption. You could start with 100 MΩ; if the receiver cannot pick it up, try 10 MΩ, and so on.