Choose your pan. Use a 4- to 5-inch round cake pan, 2 small ramekins (6–8 ounces each), or a mini loaf pan. Make sure it fits in your air fryer basket with a little space around it for air flow.
Prep the air fryer and pan. Preheat the air fryer to 320°F (160°C) for 3–5 minutes. Lightly grease and, if possible, line the bottom of the pan with a circle of parchment to prevent sticking.
Mix the dry ingredients. In a small bowl, whisk together the flour, sugar, baking powder, and salt until well combined and no lumps remain.
Whisk the wet ingredients. In another bowl or large measuring cup, whisk the milk, oil (or melted butter), egg, and vanilla until smooth and emulsified.
Combine into a batter. Pour the wet mixture into the dry.
Stir gently with a spatula until just combined. Do not overmix; a few small streaks of flour are fine. If using, fold in 1–2 tablespoons of mix-ins.
Fill the pan. Pour the batter into the prepared pan, smoothing the top. Aim to fill the pan about two-thirds full to leave room for rise.
Air fry. Place the pan in the air fryer basket.
Cook at 320°F (160°C) for 12–16 minutes, depending on your pan size and air fryer model. Begin checking at 12 minutes.
Test for doneness. The cake is ready when a toothpick inserted into the center comes out clean or with a few moist crumbs. The top should spring back lightly when touched.
Cool briefly. Let the cake sit in the pan for 5–10 minutes, then run a thin knife around the edge and turn it out onto a rack to cool completely.
Finish and serve. Dust with powdered sugar, drizzle with a quick glaze (powdered sugar + a splash of milk), or add a thin layer of frosting.
Slice and enjoy warm or at room temperature.