Authentication
Claro uses API keys to authenticate requests. API keys are workspace-scoped and can be managed from your workspace settings.Creating an API Key
1
Navigate to API Keys
Log into Claro and click API Keys from the sidebar
2
Create New API Key
Click Create API Key and provide a descriptive name:
Development- For local developmentProduction- For production deploymentsCI/CD- For automated testing and deployments
3
Save Your Key Securely
Copy the API key immediately - it will only be shown once
Using API Keys
Environment Variables (Recommended)
Store API keys in environment variables:.env Files (Development)
For local development, use a.env file:
.env
Direct Initialization (Not Recommended)
You can pass the API key directly, but this is not recommended for production:API Key Permissions
API keys have the following permissions by default:prompts:read- Read prompts and their versionsprompts:list- List all prompts in the workspacecontext:download- Download attached context files
API keys inherit the permissions of the user who created them. If you need different permissions, create the key from a user account with the appropriate access level.
REST API Authentication
When using the REST API directly, include your API key in theAuthorization header:
Security Best Practices
Rotate API Keys Regularly
Rotate API Keys Regularly
Rotate your API keys every 90 days or immediately if compromised:
- Create a new API key
- Update your applications with the new key
- Delete the old API key
Use Separate Keys per Environment
Use Separate Keys per Environment
Create different API keys for each environment:
- Development keys for local testing
- Staging keys for pre-production
- Production keys for live applications
Monitor API Key Usage
Monitor API Key Usage
Check your API key usage regularly in Settings → Security:
- Last used timestamp
- Request count
- Error rates
Restrict Access
Restrict Access
Follow the principle of least privilege:
- Only give API keys to services that need them
- Create keys from service accounts, not personal accounts
- Delete unused API keys immediately
Troubleshooting
Invalid API Key Error
- API key not set or set incorrectly
- Extra spaces or quotes around the key
- API key was deleted or revoked
- Using a key from a different workspace
Permission Denied Error
- Verify the user who created the API key has the necessary permissions
- Check workspace membership and roles
- Create a new API key from an account with appropriate access
API Key Lifecycle
1
Creation
API keys are created in workspace security settings
2
Active
Keys remain active until explicitly revoked or deleted
3
Revocation
Revoked keys immediately stop working across all applications
There is no automatic expiration for API keys. Implement your own rotation policy based on your security requirements.