Combine the almond flour, keto brown sugar substitute, cocoa powder, protein powder, baking powder, espresso powder (if using), and salt in a medium bowl. Whisk until everything is evenly mixed and lump-free.
Pour in the sour cream, egg, avocado oil, and vanilla extract. Stir everything together thoroughly until the batter is well combined and smooth. If it seems too thick to scoop, add a little water, a tablespoon at a time, until it reaches a thick but pourable consistency.
Place 6 silicone muffin cups into an 8-inch round cake pan. Evenly divide the batter among the muffin cups. For even baking and to prevent over-browning, loosely cover the entire cake pan with aluminum foil, shiny side facing up.
Preheat your air fryer to 300°F (150°C). If your air fryer has a 'bake' function, use that setting as it often has a gentler fan. Once heated, carefully place the covered cake pan into the air fryer basket. Cook for 15 minutes.
After the initial 15 minutes, carefully remove the foil from the top of the pan. Return the pan to the air fryer and continue cooking for another 10 to 15 minutes. The cupcakes are done when they’ve risen nicely and the tops feel just firm to the touch when gently pressed.
Let your perfectly baked cupcakes cool completely in the pan before carefully removing them. Once cooled, they're ready to be topped with your favorite keto frosting for an extra special, guilt-free treat!