i7-9700K would be fine but the non-K model is going to be pretty much equivalent and may be cheaper on the used market (ebay). It really boils down to what you find a good deal on.
e.g.
HP Z2 TOWER G4 WORKSTATION | INTEL CORE I7-9700 3.0GHZ | 256GB | 16GB | NO OS | eBay - You would need to do your own windows installation.
https://www.ebay.com/itm/336262351325
https://www.ebay.com/itm/297722864442
https://www.ebay.com/itm/257182244269
If you want something
new, I'd go with something released within the last 1-2 years such as a Dell Slim Desktop with Intel Core Ultra 5 225 for $600:
Dell Slim Desktop | Dell USA Then you just add a hard drive. That machine has one 3.5" HDD bay. It'd be faster and more energy efficient, come with a warranty, etc. There are plenty of reasons to prefer new hardware if you have the budget for it.
If you want to run AI with a graphics card, probably best to build your own or buy a prebuilt gaming machine with room for a full height GPU.