Spray the inside of a 7-inch air fryer-safe cake pan with baking spray, then line with a 9-inch round piece of parchment paper, making sure it drapes up the sides a bit. Spray with more cooking spray and set aside.
In a large bowl, whisk together the sugar, flour, cocoa powder, baking powder, baking soda, and salt. Add the egg, buttermilk, vegetable oil, and vanilla extract. Mix for 2 minutes, until well combined. Stir in the boiling water to create a thin batter.
Pour the batter into the prepared pan and place it in the air fryer basket.
Cook for 25 minutes, or until the cake is baked through, leaving no crumbs on an inserted toothpick. Cool in the pan for 10 minutes, then remove to a wire rack to cool completely.