You probably don’t want to lose a leg, but if you have to there are many options now that were unthinkable not long ago. That is, if you can afford them. A microprocessor knee — a prosthetic with some smarts in it — can run anywhere from $25,000 to well over $100,000. However [Lucas Galey], a PhD candidate at the University of Texas El Paso in a recent paper claims to be able to produce a comparable artificial knee for under $1,000. If the paper is too long to read, Amplitude has a good summary including what it means to people who need them.
Of course, the cost of making something like this is almost incidental. The cost of approvals, testing, and other factors mean that even with about $500 in parts, the retail price would be much higher. Probably not $25,000, though.
In the device is an Arduino and some sensors that monitor the user’s gait among other things. Apparently [Lucas] volunteers with an organization called LIMBS International that provides prosthetics to people in developing nations. His design in an outgrowth of a low-cost passive knee developed by the organization. That knee, however, doesn’t meet Federal standards, so you can’t get one in the United States.