Overview
Phoenix supports two types of API keys:- User API Keys: Associated with a specific user, inherits user permissions
- System API Keys: Service accounts with specific role assignments (Enterprise)
Creating API Keys
Via Web UI
Configure key
Set key properties:
- Name: Descriptive name (e.g., “Production App”, “CI/CD Pipeline”)
- Description: Optional details about usage
- Expiration: Set expiration date or leave blank for no expiration
- Permissions: Select scope (read-only, read-write, admin)
Via API
Create API keys programmatically:Using API Keys
HTTP Header Authentication
Include the API key in theAuthorization header:
api_key header:
Python SDK
Configure the Phoenix client:OpenTelemetry
Configure OTLP exporter with API key:Environment Variables
Store API keys in environment variables:API Key Scopes
Control what API keys can access with scopes:Read traces and spans
Send new traces to Phoenix
List and read project metadata
Create and modify projects
Read datasets and examples
Create and modify datasets
Read experiment results
Run experiments and evaluations
Full administrative access (user management, settings)
Scope Examples
Read-Only Analytics Key
CI/CD Pipeline Key
Application Instrumentation Key
Managing API Keys
Listing API Keys
View all API keys for your account:Revoking API Keys
Revoke a key to prevent further use:Via Web UI
- Navigate to Settings > API Keys
- Find the key to revoke
- Click menu > Revoke
- Confirm revocation
Via API
Revoked keys cannot be restored. Applications using the key will receive authentication errors.
Rotating API Keys
Best practice for rotating keys:System API Keys (Enterprise)
System API keys are service accounts with independent permissions:Creating System Keys
System API keys are available on Enterprise plans. Contact Sales to enable.
- Navigate to Settings > System API Keys (admin only)
- Click “Create System Key”
- Configure:
- Name and description
- Role (Admin, Member, Viewer)
- Project access
- Expiration
- Save and copy key
System Key Features
- Independent permissions: Not tied to user account
- Persistent: Remain active even if users leave
- Auditable: Tracked separately in access logs
- Granular access: Scope to specific projects
Use Cases
- Service accounts: Long-running background services
- CI/CD pipelines: Automated testing and deployment
- Integrations: Third-party tools and platforms
- Scheduled jobs: Cron jobs and batch processes
Security Best Practices
Monitor usage
Track API key usage in access logs:
- Review “Last Used” timestamps
- Revoke unused keys
- Alert on unexpected usage patterns
API Key Prefixes
Phoenix uses different prefixes to identify key types:px_live_: Production keyspx_test_: Development/testing keyspx_sys_: System API keys (Enterprise)
Rate Limits
API keys are subject to rate limits based on your plan:Free Tier
- Trace ingestion: 100 requests/minute
- API calls: 60 requests/minute
- Concurrent requests: 5
Pro Tier
- Trace ingestion: 1,000 requests/minute
- API calls: 300 requests/minute
- Concurrent requests: 20
Enterprise Tier
- Trace ingestion: Custom (unlimited available)
- API calls: Custom
- Concurrent requests: Custom
Rate Limit Headers
Responses include rate limit information:Monitoring API Key Usage
Usage Metrics
Track API key usage in Settings > API Keys:- Total requests
- Requests by endpoint
- Error rate
- Last used timestamp
- Geographic distribution (Enterprise)
Access Logs
View detailed access logs:Alerts
Configure alerts for:- Unused keys (no activity in 30 days)
- High error rate (>5% errors)
- Unexpected geographic access
- Keys nearing expiration
Troubleshooting
Authentication Failed
Check:- Key format: Ensure key includes prefix (e.g.,
px_live_...) - Header format: Use
Authorization: Bearer YOUR_KEYorapi_key: YOUR_KEY - Key status: Verify key hasn’t been revoked or expired
- Permissions: Check key has required scopes
Rate Limit Exceeded
Solutions:-
Implement backoff: Retry with exponential backoff
- Batch requests: Combine multiple operations
- Upgrade plan: Contact sales for higher limits
Scope Errors
If you receive a 403 Forbidden:- Check required scope for endpoint
- Verify key has necessary scope
- Regenerate key with correct scopes
API Reference
Create API Key
List API Keys
Get API Key Details
Revoke API Key
Next Steps
Authentication
Configure SSO and user management
Security
Learn about encryption and security
Configuration
View all configuration options