This is not correct. The TLD alone is a valid domain name, although in most cases it must be followed by a trailing dot. "ai." is valid, "ai" may not be.
$ host "ai."
ai has address 209.59.119.34
ai mail is handled by 10 mail.offshore.ai.I'm on my phone now, if you search for the ai entry in the root zone file (https://www.iana.org/domains/root/files) you should find that IP returned by your host command.
Can you try curling "ai" and see if the content returned (if any) is the same as the one from "www.ai"?
Because http://com. Works as well.