The cloro API uses Bearer token authentication to secure API endpoints. You’ll need to include your API key in the Authorization header of every request.
Getting your API key
Manage your API keys in the dashboard. You can create new keys, view usage, and manage your account settings.
Once you receive your API key:
- Store your API key securely - keep it confidential
- Never expose your API key in client-side code or public repositories
Never expose your API key in client-side code, public repositories, or share
it with unauthorized users.
Using your API key
Include your API key in the Authorization header with the Bearer prefix:
Authorization: Bearer YOUR_API_KEY
Example requests
curl -X POST https://api.cloro.dev/v1/monitor \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Your prompt here", "model": "CHATGPT"}'
Authentication errors
If authentication fails, you’ll receive a 401 Unauthorized response:
{
"success": false,
"error": "Invalid or missing API key"
}
Common authentication issues:
- Missing Bearer prefix: Make sure to include
Bearer before your API key
- Invalid API key: Check that you’re using the correct API key
- Expired API key: Some API keys may have expiration dates
- Rate limit exceeded: You’ve exceeded your plan’s rate limit
Environment variables
We recommend storing your API key in environment variables:
CLORO_API_KEY=your_api_key_here
API key management
Regenerating keys
If you suspect your API key has been compromised, you can revoke and generate new keys directly in the dashboard.
Multiple API keys
You can create multiple API keys in the dashboard for different purposes:
- Production: For your live application
- Development: For local development and testing
- CI/CD: For automated testing and deployment
- Team members: Individual keys for team access
Need help?
If you’re having trouble with authentication: