Documentation Index
Fetch the complete documentation index at: https://mintlify.com/helicone/helicone/llms.txt
Use this file to discover all available pages before exploring further.
API Keys
Helicone uses API keys to authenticate requests to the REST API. You can create and manage your API keys from the Helicone dashboard.Getting Your API Key
- Sign up or log in at helicone.ai
- Navigate to Settings > API Keys
- Click Create API Key
- Copy your API key and store it securely
API Key Format
Helicone API keys follow specific patterns:- Standard keys:
sk-helicone-[7chars]-[7chars]-[7chars]-[7chars] - Proxy keys:
sk-helicone-proxy-[uuid] - Rate-limited keys:
sk-helicone-rl-[7chars]-[7chars]-[7chars]-[7chars] - EU region keys:
sk-helicone-eu-[7chars]-[7chars]-[7chars]-[7chars]
Authentication Methods
There are two ways to authenticate API requests:Method 1: Authorization Header (Recommended)
Include your API key in theAuthorization header using Bearer authentication:
Method 2: Helicone-Auth Header
Alternatively, use theHelicone-Auth header:
Key Permissions
API keys can have different permission levels:| Permission | Description | Use Cases |
|---|---|---|
| rw | Read and Write (default) | Full access to all endpoints |
| r | Read-only | Query data without modification |
| w | Write-only | Log requests without reading data |
Authentication in Code
TypeScript/JavaScript
Python
cURL
Security Best Practices
Store keys securely
Store keys securely
- Use environment variables or secret management services
- Never hardcode API keys in your source code
- Don’t commit
.envfiles to version control
Rotate keys regularly
Rotate keys regularly
- Create new API keys periodically
- Delete old or unused keys
- Update your applications when rotating keys
Use minimal permissions
Use minimal permissions
- Create separate keys for different use cases
- Use read-only keys for analytics dashboards
- Use write-only keys for logging services
Monitor key usage
Monitor key usage
- Review API key activity regularly
- Set up alerts for unusual patterns
- Immediately revoke compromised keys
Troubleshooting
401 Unauthorized Error
If you receive a 401 error:- Verify your API key is correct
- Ensure you’re using
Bearerprefix in the Authorization header - Check that your API key hasn’t been deleted or revoked
- Confirm your key has the required permissions for the endpoint
Invalid Token Format
If you see “API Key is not well formed”:- Check that your API key matches the expected format
- Ensure there are no extra spaces or characters
- Verify you copied the entire key
Managing API Keys
You can manage your API keys programmatically:List API Keys
Create API Key
Delete API Key
When you create an API key, save it immediately. For security reasons, you won’t be able to view the full key again.
Next Steps
API Overview
Learn about the API structure and response formats
Request Endpoints
Explore available API endpoints
