Energy from spacetime expansion? Are there any processes or mechanisms in the universe involving spacetime expansion where energy is produced somehow out of this expansion?
I ask this in part due to this article by Sean Carroll 1 which it says at some point:

(...) In general relativity spacetime can give energy to matter, or absorb it from matter

Therefore, could energy be produced somehow out of the Universe's expansion, continuing to be produced as long as it keeps expanding?
 A: General relativity, in an arbitrary spacetime, has local conservation of energy but not global conservation of energy. On practical scales, spacetime can be modeled as asymptotically flat. In an asymptotically flat spacetime, one can define a conserved measure of energy. So if you're going to extract energy from cosmological expansion, the expectation is that your apparatus is going to have to be cosmic in size.

in general relativity spacetime can give energy to matter, or absorb it from matter

An example of this would be that a gravitational wave detector can, in principle, gain energy from the gravitational waves it detects. That's different from harvesting energy from cosmological expansion.
A: The standard $\Lambda$CDM model of cosmology actually has 2 scenarios that would interest you, one involving energy creation and another energy destruction.
First, let's talk about how energy density evolves with the scale factor of the universe, denoted $a$. As a reminder, $a$ is the scale of the universe at a given time relative to today. So today $a$ is 1, and in an expanding universe $a$ is always increasing over time.
Let's start with the matter density $\Omega_m$ and look at how it evolves over time as the scale factor grows. Intuitively, we can see that the impact of expansion on matter is simply to "spread it out". In other words matter density will increase and decrease inversly proportionately with volume, or $a^3$. Thus we have :
$$\Omega_m \propto a^{-3}$$
Now let's take an arbitrary comoving volume $V$ of the universe, and integrate the matter density over that volume. Because it's a comoving volume, it will increase with the scale factor proportionately to $a^3$. And so we get :
$$\int_V \Omega_m \propto a^{-3} \times a^3 = 1$$
That is to say, this integral will remain fixed over time regardless of how the scale factor changes. Now let's do the same with radiation. In cosmology, we call radiation any particle whose total energy is dominated by its kinetic rather than mass energy. This was the case for most particles in the very very early days of the universe. When the universe expands, 2 things happen to the radiation energy density $\Omega_R$. First, the particles get "spread out" just as with matter. But secondly, their wavelength, which is carrying most of their energy, also gets stretched out proportionately to $a$, making them lose kinetic energy. And so we get :
$$\Omega_R \propto a^{-4}$$
And now our integral over the same comoving volume is :
$$\int_V \Omega_R \propto a^{-4} \times a^3 = a^{-1}$$
In other words, the integrated energy decreases as the universe expands ! Finally, let's look at vacuum energy, which is the $\Lambda$ in $\Lambda$CDM. It's modeled as an unchanging fixed energy density. In other words, it remains unchanged by the scale factor. So our integral becomes just some constant multiplied by the volume :
$$\int_V \Omega_{\Lambda} \propto a^3$$
And so here the integrated energy increases as the universe expands ! These are the 2 most straightforward examples of what you're asking for. You can find much more complex cases wherever the effects of general relativity are non negligible, but somewhat poetically the simplest solutions to general relativity are those applied to the universe as a whole.

More generally, expansion is modeled as a collection of effective fluids whose behavior as related to expansion is entirely determined by its equation of state relating its energy density to its pressure :
$$w = \frac{p}{\rho}$$
This single parameter $w$ governs the evolution of energy density of an effective fluid $i$ as the universe expands :
$$\Omega_i \propto a^{-3 (1+w_i)}$$
And the integrated energy is then :
$$\int_V \Omega_i \propto a^{-3 (1+w_i)} \times a^3 = a^{-3 w_i}$$
Plugging in $0$, $\frac{1}{3}$, and $-1$ as $w$ for matter, radiation, and a cosmological constant respectively, you'll find our solutions above. While matter and radiation are a given, you can find various models for dark energy where $w$ is not exactly $-1$ (though measurements show it is very close to $-1$). So you can find other scenarios just by varying $w$, and you'll get a varying integrated energy whenever $w$ is not $0$, but that's about your only wiggle room to find other such scenarios on a cosmic scale, at least if you're modeling it with the Friedmann equations, which you pretty much always are. You can also have a time varying $w$ (current observations are very bad at constraining this), but the overall logic remains the same.
You can have all sorts of fancy and exotic physics to justify various values of $w$, but the final impact on expansion will pretty much come down to its equation of state.
