Getting Your API Key
- Sign up at kugelaudio.com
- Go to your Dashboard
- Navigate to Settings → API Keys
- Click Create API Key
- Copy and securely store your key
Using Your API Key
HTTP Requests
Include your API key in theAuthorization header using Bearer token format:
WebSocket Connections
For WebSocket connections, pass the API key as a query parameter:SDK Usage
- Python
- JavaScript
Environment Variables
For security, we recommend using environment variables instead of hardcoding API keys:KUGELAUDIO_API_KEY if no key is provided.
API Key Security
Never expose keys in client-side code
Never expose keys in client-side code
API keys should only be used in server-side code. Never include them in:
- Frontend JavaScript
- Mobile app source code
- Public repositories
- Client-side environment variables
Use environment variables
Use environment variables
Store API keys in environment variables, not in code:
Rotate keys regularly
Rotate keys regularly
Create new API keys periodically and delete old ones. This limits the impact of any potential key exposure.
Use separate keys for environments
Use separate keys for environments
Create separate API keys for development, staging, and production. This makes it easier to rotate keys and track usage.
Managing API Keys
Creating Keys
- Go to Dashboard → Settings → API Keys
- Click Create API Key
- Give it a descriptive name (e.g., “Production Server”)
- Copy the key immediately (it won’t be shown again)
Revoking Keys
If a key is compromised:- Go to Dashboard → Settings → API Keys
- Find the compromised key
- Click Revoke
- Create a new key
- Update your applications
Revoked keys stop working immediately. Make sure to update all applications using the key before revoking.
Key Permissions
All API keys have full access to your account’s resources. We’re working on scoped permissions for future releases.Authentication Errors
401 Unauthorized
- Missing
Authorizationheader - Invalid API key
- Revoked API key
- Malformed header format
- Check that you’re including the
Authorizationheader - Verify the API key is correct
- Check if the key has been revoked
- Ensure format is
Bearer YOUR_API_KEY
403 Forbidden
- Trying to access resources from another account
- Feature not available on your plan
- Verify you’re using the correct API key
- Check your plan includes the feature you’re trying to use