API keys
Create an API key with the CLI
Create an API key with the CLI to authenticate requests to a Managed Inference endpoint.
Create an API key with the CLI, and use it to authenticate requests to a Managed Inference endpoint that requires an authorization header.
Prerequisites
Before you start, make sure that you have the following.
- A running CosmicAC deployment. See Set up CosmicAC.
- The CosmicAC CLI installed and configured. See Install the CLI.
- The member role, the team lead role, or the platform administrator role in the team that the key belongs to. See Teams and roles.
Steps
Create the key
Create a key. Replace <name> with a display name for the key.
cosmicac api-keys create <name>The output shows the full key in the Value field. CosmicAC shows the full key only once, so copy it and store it somewhere safe.
You can't recover a lost key. If you lose it, revoke the key and create a new one.
Confirm the key
List your keys.
cosmicac api-keys listThe new key appears at the top of the list, with its ID, name, preview, and status.