Generating a Model API Key
If you have enabled authentication, then you need a Model API Key to call a model. If you are not a collaborator on a particular project, then you cannot access the models within that project using the Model API Key that you generate. You need to be added as a collaborator by the admin or the owner of the project to use the Model API Key to access a model.
API Key: This is used in the CDSW-specific internal APIs for CLI automation. This can’t be deleted and neither does it expire. This API Key is not required when sending requests to a model.
Model API Key: These are used to authenticate requests to a model. You can choose the expiration period and delete them when no longer needed.
- Sign in to Cloudera Machine Learning.
- Click Settings from the left navigation pane.
- On the User Settings page, click the API Keys tab.
Select an expiry date for the Model API Key, and click Create API
An API key is generated along with a Key ID.If you do not specify an expiry date, then the generated key is active for one year from the current date, or for the duration set by the Administrator. If you specify an expiration date that exceeds the duration value set by the Administrator, you will get an error. The Administrator can set the default duration value at
To test the Model API Key:
- Navigate to your project and click Models from the left navigation pane.
On the Overview page, paste the Model API Key in the Model API Key
field that you had generated in the previous step and click
The test results, along with the HTTP response code and the Replica ID are displayed in the Results table.If the test fails and you see the following message, then you must get added as a collaborator on the respective project by the admin or the creator of the project:
"User APikey not authorized to access model": "Check APIKEY permissions or model authentication permissions"