To generate an API key, go to your Profile page indicated by the icon shown below. You can find it on the top right hand corner.
Then select the 'OnDOMAIN' tab from the top row.
Next, scroll down until you reach the 'API Keys' section as shown below and click '+Add' to create a new API key.
Once inside the API key creation window, you can give it a label and assign the desired permissions as shown below, then click 'create' to save the API Key.
Warning: Make sure to make note of the API Key somewhere secure as it cannot be viewed again once the window is closed.