Below is as per the documentation:
You won't be able to generate or alter PKey. However, you may use Custom keys
if the profile resource has been extended with a custom key field.
Which API you're trying? It would be worth knowing the use case here for max length of the PKey, are you running into any issues due to its length?