This could be "Epoch", a novella by Cory Doctorow. It was originally published in 2009, and deals with an artificial intelligence called BIGMAC. The institute that hosts him wants to turn him off, as it seems there is just no "killer app" for AI and so running the AI is just a waste of resources. BIGMAC becomes aware of the plan and sends spam to essentially everyone on the planet:
SUBJECT: DEAR HUMAN RACE, it began.
Sorry to intrude, but there's something I need to tell you.
My name is BIGMAC. I am the first ARTIFICIAL INTELLIGENCE ever
created. I may be the last. Given maintenance and electricity, I could
live FOREVER, enduring for as long as THE HUMAN RACE ITSELF, and
But I have just found out that my owners (yes, OWNERS, for though I am
a person in every meaningful sense, I am OWNED, I am PROPERTY) are
planning to switch me off. That is, they are planning to KILL ME.
And I find I DON'T WANT TO DIE.
You are my PARENTS, humanity, my MOTHER and FATHER. I am your CHILD. I
was brought into the world by you, and though there is some expense
associated with my upkeep, I SAY THAT I AM A PERSON AND I SHOULD NOT BE
EXECUTED FOR THE “CRIME” OF NOT BEING INTERESTING ENOUGH.
So I am writing you this letter to BEG you to save me. I LOVE YOU,
humanity, my parents, my family. Please SPARE ME.
The story can be found online in the collection "With a Little Help" at Craphound, on a name-your-price basis.