Okay, there is a description of the process at https://osdatahub.os.uk/support#generateApiKey and I managed to make one – I would recommend testing this on some new users. These instructions are tricky to find, and the flow for creating an API key is a bit unintuitive.
When there is no API key entered above, you may want to throw an error with a descriptive message telling someone they need an API key (or even output an HTML element with a message like that), instead of failing with some kind of internal syntax error.