Preheat the air fryer: Set to 325°F (160°C) for 3–5 minutes. A warm basket helps the peanuts start roasting right away.
Mix the seasoning: In a small bowl, combine chili powder, smoked paprika, cayenne, garlic powder, onion powder, cumin, salt, sugar (if using), and black pepper.
Coat the peanuts: In a large bowl, toss the raw peanuts with oil until lightly coated.
Sprinkle the seasoning mix over the peanuts and toss until evenly covered. The coating should cling but not clump.
Load the basket: Spread the peanuts in a single, even layer in the air fryer basket. If your basket is small, work in two batches to avoid overcrowding.
Air fry and shake: Cook at 325°F (160°C) for 10–12 minutes, shaking the basket every 3–4 minutes. Watch closely near the end—peanuts can go from perfect to overdone quickly.
Check for doneness: Peanuts will darken slightly and smell toasty.
They may seem a bit soft when hot but will crisp up as they cool.
Cool completely: Transfer to a sheet pan or plate to cool in a single layer. If using lime juice or zest, add it lightly once they’ve cooled slightly, then let them dry fully before storing.
Adjust seasoning: Taste once cool. Add a pinch more salt or a dusting of chili powder if you want extra punch.