Should you eat beans while on the ketogenic diet? You can, but you have to limit the quantity. Also, some beans are higher in carbs than others. Personally I would concentrate on fresh beans like green beans and asparagus beans or other vegetables like snow peas or other peapods. There are fewer carbs and more fiber in fresh beans and peas so your intake of net carbs will be far fewer than if eating dried beans.
Most beans are too high in carbs to be staples on the keto diet. However, with careful planning, you can include small servings of beans occasionally. Always be sure to check labels for added sugars, though.
Green beans and black soybeans are keto-friendly bean options, each containing only 2 grams of net carbs per 1/2-cup (60–90-gram) serving.
Some promising keto substitutes for beans include mushrooms, eggplant, avocado, ground meat, and boiled peanuts.Healthline.com