In this work we calculate the closed time path generating functional for the electromagnetic (EM) field interacting with inhomogeneous anisotropic matter. For this purpose, we first find a general expression for the electromagnetic field’s influence action from the interaction of the field with a composite environment consisting in the quantum polarization degrees of freedom in each point of space, at arbitrary temperatures, connected to thermal baths. Then we evaluate the generating functional for the gauge field, in the temporal gauge, by implementing the Faddeev–Popov procedure. Finally, through the point-splitting technique, we calculate closed expressions for the energy, the Poynting vector, and the Maxwell tensor in terms of the Hadam...