IBM 5150 - Keyboards
What was supplied
The keyboard that IBM supplied with the IBM 5150 (IBM PC) is pictured at here. In IBM's later technical documentation, it is referred to as the '83-key keyboard'.
The same later documentation refers to two types of this 83-key keyboard; type 1 and type 2. At power-on time, the type 1 keyboard is reset by the 5150 motherboard (diagram here), whereas the type 2 keyboard resets itself. Both types will work with an IBM 5150.
If you suspect that you have a faulty cable in your 83-key keyboard, the diagram at here will assist you in 'metering out' the cable. In some 83-key keyboards of type 2, the reset wire in the cable is connected up, even though not needed by keyboards of type 2.
A word of warning. After complete disassembly, reassembly is 'painful', specifically, mating the curved circuit board with the curved metal plate. Keep a large swear jar handy. This can be seen at the 30-minute mark into the video at here.
The IBM 83-key keyboard was reused for the IBM 5160 (IBM XT).
'Model F'
Some people incorrectly refer to the 83-key keyboard as the 'model F' keyboard. Refer to here. 'IBM model F' refers to a series of keyboards, which includes keyboards that will not work with an IBM 5150. The 83-key keyboard is simply an example of a 'model F' type.
AT-class only keyboards are not useable
When IBM introduced the IBM 5170 (IBM AT), they also introduced a new keyboard protocol, put into both the new 84-key keyboard and the 5170 motherboard.
The 5170's 84-key keyboard (only supports the AT protocol) is not useable with the IBM 5150.
Alternatives
An option for the IBM 5150 is a third-party keyboard that can be switched between the different keyboard protocols. Example at here.
Another option is to use an AT-class keyboard together with an adapter that converts the AT keyboard protocol to a protocol that the 5150's motherboard recognises. Example at here.
Another option is to use a PS/2 keyboard together with a PS/2-to-XT keyboard adapter. An example is at here, one that is advertised as being suitable for the IBM 5150/5160.
Another option is to use a USB keyboard together with a USB-to-XT keyboard adapter. An example is detailed at here.
101-key keyboards
Be wary if you hear that the auto-switching versions of IBM 101-key keyboards will work with the IBM 5150. I write that because I used to have a particular auto-switching IBM 101-key keyboard, the 52G9658, and although it worked attached to my 5160s, it did not work attached to my 5150s.
The, "(as with all three ROM versions of the IBM PC)" shown at here, suggests an incompatibility.
I am aware of someone who says that they have an auto-switching IBM 101-key keyboard that works with the IBM 5150. My recommendation is that, if you are planning on buying an auto-switching IBM 101-key keyboard for use with your IBM 5150, get some form of guarantee that the particular unit for sale, does work with the 5150 (or get a money back guarantee). Note that any LEDs may not work, and the F11 and F12 keys are not expected to work.