Authorization header using Bearer authentication.
Getting Your API Key
1
Log into Claro
Navigate to claro.baytos.ai and sign in to your account
2
Access API Keys
Click API Keys from the sidebar navigation
3
Create New Key
Click Create API Key and give it a descriptive name (e.g., “Production Server”, “Development”)
4
Copy and Save
Copy the API key immediately and store it securely
API Key Format
API keys follow this format:- Prefix:
sk_live_for production keys,sk_test_for test keys - Length: 50 characters total
- Encoding: Base62 (alphanumeric)
Test keys (with
sk_test_ prefix) are not yet available but will be coming soon for sandbox environments.Making Authenticated Requests
Include your API key in theAuthorization header using the Bearer scheme:
cURL Example
Python Example
Using the SDK (recommended):JavaScript Example
Using fetch:Environment Variables
Store your API key in environment variables rather than hardcoding it:Bash/Zsh
~/.bashrc or ~/.zshrc to persist across sessions.
Python (.env file)
Node.js (.env file)
Security Best Practices
Never commit API keys to version control
Never commit API keys to version control
Add your API keys to Use environment variables or secret management services instead.
.gitignore:Use different keys for different environments
Use different keys for different environments
Create separate API keys for:
- Development/testing
- Staging
- Production
Rotate keys regularly
Rotate keys regularly
Create a new API key, update your application, then delete the old key.We recommend rotating production keys at least every 90 days.
Delete unused keys
Delete unused keys
Regularly audit your API keys in the Claro dashboard and delete any that are no longer needed.
Use server-side authentication only
Use server-side authentication only
Never expose API keys in client-side code (JavaScript in browsers, mobile apps, etc.).Always make API calls from your backend server.
Authentication Errors
401 Unauthorized
Your API key is missing or invalid:- Verify the API key is correct
- Check that you’re using the
Bearerprefix - Ensure the key hasn’t been deleted from your Claro account
403 Forbidden
Your API key is valid but doesn’t have permission to access the resource:- Verify you have access to the workspace
- Check that the prompt exists and you have permission to view it
- Ensure your workspace subscription is active