Preheat the air fryer: Set it to 320°F (160°C). Preheating helps the cake rise evenly and reduces overcooking on top.
Choose the right mug: Use a microwave-safe, oven-safe mug that’s about 12–14 ounces. It should be sturdy with straight sides so the cake bakes evenly. If unsure, use a small ramekin.
Melt the butter: Add 2 tablespoons melted unsalted butter to the mug. Let it cool slightly so it doesn’t scramble the egg.
Add wet ingredients: Whisk in 1 large egg, 2 tablespoons yogurt (or milk), 1 tablespoon fresh lemon juice, 1/2 teaspoon vanilla, and 1 teaspoon finely grated lemon zest. Mix until smooth.
Stir in dry ingredients: Add 1/4 cup all-purpose flour, 3 tablespoons sugar, 1/4 teaspoon baking powder, and a small pinch of salt. Stir until just combined. Don’t overmix—stop when no dry streaks remain.
Adjust thickness: The batter should be thick but spoonable. If it seems too thick, add 1 teaspoon more milk; if too runny, sprinkle in a bit more flour.
Prepare for air frying: Place a small square of parchment under the mug in the air fryer basket to catch drips. Carefully set the mug inside.
Cook: Air fry at 320°F (160°C) for 8–10 minutes. Start checking at 7 minutes. The top should look set and spring back lightly. A toothpick inserted into the center should come out with a few moist crumbs, not wet batter.
Rest briefly: Let the cake sit for 2–3 minutes to finish setting. This also makes it easier to top and eat.
Optional glaze: Mix 2 tablespoons powdered sugar with 1–2 teaspoons lemon juice for a quick glaze. Drizzle over the warm cake. Or finish with a dusting of powdered sugar and an extra pinch of zest.