The K-energy functional is extended to complexified K\"ahler classes, providing a variational approach to study the scalar curvature equation with B-field introduced by Schlitzer and Stoppa. The extended K-energy is convex along geodesics in the space of almost calibrated representatives of the complexified K\"ahler class. This fact is used to show that, in some situations, solutions of the scalar curvature equation with B-field are unique in their class, up to pullbacks by reduced automorphisms of the manifold.PDF: A K-energy functional for complexified K\"ahler classes.pdf