Preheat oven to 350 degrees F (175 degrees C). Spray two 9-inch cake pans with cooking spray.
Combine flour, sugar, cocoa powder, baking powder, baking soda, and xanthan gum in a bowl; stir in mayonnaise until well mixed. Gradually pour in hot water and vanilla extract; stir until smooth. Spoon batter into the prepared cake pans.
Bake in the preheated oven until a toothpick inserted in the center of the cake comes out clean and the cake slightly pulls away from the sides of the pan, about 30 minutes. Cool in the pans for 10 minutes before removing to cool completely on a wire rack.