In a medium sized bowl, toss together the diced potatoes, olive oil, salt, garlic powder, chili powder (if using), and pepper.
Use a rubber spatula to make sure the potatoes are completely coated in seasoning.
Add the potatoes to your air fryer basket in a single layer.
Set the temperature to 390º and cook for 10 minutes. Give the basket a shake after 5 minutes.
While the potatoes cook, add your diced onion to the bowl where the potatoes were seasoned. Toss the onions around in the remaining seasoning until evenly coated.
After the potatoes have been cooking for 10 minutes, give them another shake and then add the seasoned onions to the potatoes. Continue cooking for 5-10 more minutes.
The potatoes are done when they are crispy, fork tender, and the onions are soft.
Serve and enjoy while warm.