The question seems to boil down to this...
Is an AI the kind of entity that would qualify for basic human rights?
What qualifies humans for rights? The arguments I've seen include rationality and sentience, so let's look at those.
Rationality doesn't hold up as even the severely mentally impaired have rights. While their rights may seem curtailed (such as them being institutionalized), those are considered measures for their own protection.
Sentience is questionable. Those who are comatose or brain-dead are arguably not sentient, yet there is intense debate about pulling the plug on them. Do these arguments stem from the possibility that they are sentient or may regain sentience? Admittedly, the debate gets less intense if it's agreed that they will never recover, but it still goes on.
What if our capacity to feel pain or pleasure contributes to our rights? In this view, we could argue that our rationality increases our ability to feel both and thus qualifies us for more rights. For instance, we have plans, goals, ideals and dreams that make things like imprisonment painful, even if we were imprisoned in comfort. Thus caging a human qualitatively differs from caging a lion.
Those are among the questions that need to be answered. However, is this how we decide on rights? Or do we simply give rights to biological humans and then use post hoc reasoning to justify our decision?
To give this answer a further philosophical wrinkle... if we use a pain/pleasure requirement for rights, then this fits a Consequentialist Philosophy of ethics, such as Utilitarianism. Utilitarians focus on maximizing pleasure and minimizing pain so their decision would hinge on the AI's capability to experience these. Sentience does not imply affect, so if an AI can't feel either, then it needs no rights for it cannot suffer from their lack and vice versa.