Generating an API Key
API keys in Liona are different from access keys. While access keys are used by end users to authenticate with AI providers, API keys are used by your backend systems to interact with Liona’s management API. This guide explains how to generate and use API keys for backend integration.
API keys have administrative privileges and should be kept secure. Never expose API keys in client-side code or public repositories.
Understanding API Keys vs. Access Keys
Before generating an API key, it’s important to understand the difference between the two types of authentication Liona uses:
Type | Purpose | Used by | Scope |
---|---|---|---|
API Key | Manage Liona resources | Your backend | Administrative access to create users, policies, etc. |
Access Key | Access AI providers | End users | Limited to specific policies and providers |
Generating an API Key
Navigate to API Keys section
From your Liona dashboard, navigate to the API Keys section.
- Sign in to your Liona dashboard
- Click on your profile icon in the top-right corner
- Select “API Keys” from the dropdown menu
Create a new API key
Click the “Generate New API Key” button to create a new key.
Set a description and expiration
For better security and management:
- Enter a meaningful description (e.g., “Production Backend”, “User Management Service”)
- Set an expiration date for the key (recommended)
- Click “Generate Key”
Copy your API key
The API key will be displayed only once. Make sure to copy it immediately and store it securely.
The API key will only be shown once. If you lose it, you’ll need to generate a new one and revoke the old key.
Next Steps
Now that you have an API key, you can:
- Create access tokens programmatically
- Retrieve usage statistics
- Set up automated user provisioning
- Integrate Liona with your user management system