That's a little different part of the value chain then I typically work at but this is my guess. Sometimes there is a company that owns the data center and they would rent space inside the data center. Then the AI companies like openai and Anthropic would rent that space, put in their own servers and other equipment and pay the electricity charges either to the data center operator who would pay the utility or to the electric utility directly.
For smaller companies, they are renting server time from Amazon or Google or Microsoft and a few others. That server time includes electricity charges. Its not a separate line item. Then Amazon would pay the utility for electricity.
That may be wildly inaccurate. There may be a few other middlemen in there. I can really only speak to what I do. I buy server time from Google and I also buy AI question and responses from Anthropic. The electricity is included somewhere in those charges but not separated out.