Learn how to generate, secure, and manage your LessToken API keys for authentication and access control.
API keys are your secure credentials for accessing the LessToken API. They authenticate your requests and track your usage, ensuring security and proper billing.
Encrypted authentication without exposing credentials
Monitor and control API consumption per key
Generate new keys and revoke old ones instantly
Go to your dashboard and click on the 'API Keys' tab in the sidebar.
Click the 'Create New API Key' button in the top right corner.
Give your API key a descriptive name (e.g., 'Production', 'Development', 'Testing').
Copy your API key immediately and store it securely. You won't be able to see it again!
Include your API key in the X-API-Key header of every request:
curl -X POST https://lesstokens.hive-hub.ai/api/compress \
-H "X-API-Key: lsk_live_1234567890abcdef..." \
-H "Content-Type: application/json" \
-d '{
"prompt": "Your text to compress",
"options": {
"jsonMinify": true,
"removeComments": true
}
}'Prefix: lsk_test_...
Use for development and testing. No charges applied.
Prefix: lsk_live_...
Use for production. All requests are billed.
Add .env files to .gitignore and use environment variables instead of hardcoding keys in your code.
Store API keys in environment variables and load them at runtime using process.env or similar.
Generate new keys periodically and revoke old ones, especially if you suspect they may be compromised.
Create separate keys for development, staging, and production to isolate and control access.
Always use environment variables to store your API keys:
# LessToken API Configuration
LESSTOKEN_API_KEY=lsk_live_your_key_here
LESSTOKEN_BASE_URL=https://lesstokens.hive-hub.ai
# Never commit this file!
# Add to .gitignore# Environment variables
.env
.env.local
.env.production
.env.*.local
# API keys
*.key
api-keys.txtYou can manage all your API keys from the dashboard:
See all your active and inactive keys
Quickly copy keys to clipboard
Delete compromised or unused keys
Key Visibility
For security reasons, you can only see the full API key once when it's created. After that, only the last 4 characters are displayed.
Now that you have your API key, you're ready to make your first request!