I've seen that it seems some people believe that the "machines using humans as batteries" explanation for the Matrix may not be true. Most recently, I've seen a comment on another question of mine (the relevant part of which I'll quote here):
The only history [humans] know -- the lie that human farms are for batteries -- was told to them by the oracle or her agent, the First The One.
In the films, I believe all we have to go on is what Morpheus tells us in the first film:
Morpheus: A singular consciousness that spawned an entire race of machines. We don’t know who struck first, us or them. But we know that it was us that scorched the sky. At the time they were dependent on solar power and it was believed that they would be unable to survive without an energy source as abundant as the sun. Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. The human body generates more bio-electricity than a 120-volt battery and over 25,000 BTUs of body heat. Combined with a form of fusion, the machines have found all the energy they would ever need. There are fields, endless fields, where human beings are no longer born. We are grown. For the longest time I wouldn’t believe it, and then I saw the fields with my own eyes. Watch them liquefy the dead so they could be fed intravenously to the living. And standing there, facing the pure horrifying precision, I came to realize the obviousness of the truth. What is the Matrix? Control. The Matrix is a computer generated dream world built to keep us under control in order to change a human being into this. [Morpheus holds up a battery to Neo/the camera]
The Matrix transcript, except the bit in square brackets, which I added
However, this is simply what Morpheus and the other humans believe; it isn't confirmed in-universe that this is actually true, especially considering that other significant things presented as true in the first film are then later revealed not to be true in later films ("the prophecy" = way to trick The One into returning to the Source, "Zion as a haven for humans" = a sham so that the machines can kill the escapees easier, etc).
So, do we know if machines really did humans for batteries in-universe, or was this a lie told to the humans? (Which also begs the question of "if not for a source of power, then why did the machines create the Matrix, rather than just wipe humans out entirely?")
Note that I'm not interested in whether this is realistic in real life (i.e. I don't want answers trying to disprove it with real-world science, because obviously it doesn't hold up), only what is presented as true in-universe.