IBM 5150 - Keyboard support
What was supplied
The keyboard that IBM supplied with the IBM 5150 is pictured at here. In IBM's technical documentation, it is referred to as the '83-key keyboard'.
( Later, when IBM introduced the IBM 5160 [IBM XT], the same keyboard was used. )
AT-class 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.
'Model M' keyboards
Be wary if you hear that the auto-switching versions of 'Model M' keyboards will work with the IBM 5150. I write that because I have a particular auto-switching 'Model M', the 52G9658, and although it works attached to my 5160s, it does not work attached to my 5150s.