API Keys Guide
Learn how to generate, manage, and secure your API keys
API keys are unique identifiers that authenticate your application when making requests to our API. They act as a secure way to identify your project and ensure only authorized applications can access your bot configurations and data.
Before generating API keys, you need to create a bot that the keys will authenticate access to.
Bot Creation Process:
- Choose a unique bot name and description
- Select an AI model (GPT-3.5, GPT-4, etc.)
- Configure system prompts (optional)
- Upload training data for context
Access the API Keys management dashboard to view and create keys for your bots.
Dashboard → API Keys → Select Your Bot
Create a new API key with customizable security settings.
Configuration Options:
Descriptive identifier
Limit to specific domains
Control usage frequency
Optional expiration date
Security Features:
Secure key creation
Instantly disable keys
Track key activity
Follow best practices for API key storage and management.
Do's
- Store in environment variables
- Use secure key management services
- Rotate keys regularly
- Use different keys for different environments
Don'ts
- Commit keys to version control
- Hardcode in application source
- Share keys in plain text
- Use in client-side code
# Environment Variables (.env)
CHATBOT_API_KEY=cb_86dff3cd_d88c309be3490c5aa981cd0007a4d4c5ce95f88140becc2876480da17a5fe6f5
CHATBOT_BOT_ID=676c86dc0b95b800088f76a5
# Usage in your application
const apiKey = process.env.CHATBOT_API_KEY;
const botId = process.env.CHATBOT_BOT_ID;
Verify that your API key is working correctly.
# Test API key with curl
curl -X GET \
-H "Authorization: Bearer cb_86dff3cd_d88c309be3490c5aa981cd0007a4d4c5ce95f88140becc2876480da17a5fe6f5" \
/api/auth/verify
# Expected response
{
"valid": true,
"keyId": "api_key_123",
"permissions": ["chat", "training-data"],
"rateLimit": {
"requests": 1000,
"window": "1h"
}
}
Quick Test
You can also use our SDK Test Page to quickly verify your API key and bot ID combination.
Integrate your API key with our JavaScript or React SDKs.
JavaScript SDK
React SDK
Regenerate Keys
Rotate your API keys regularly for security
Monitor Usage
Track API key usage and rate limits
Revoke Access
Immediately disable compromised keys