AI can't launch nukes if it doesn't have the launch codes, so don't give them to it.
More seriously though, there's no direct API, but playing a recording of a massive $enemy attack, AI-faked broadcasts, cutting off comms as cities in the broadcasts get "nuked", and deepfaked AI calls authorising launches, and you don't need a REST API.