Quick Start
Get authenticated in 3 steps:1
Get Your API Key
Create an account and generate an API key in the dashboard.
Get API Key
Sign up and create your first API key
2
Set Environment Variable
Set the
HOPX_API_KEY environment variable:- Linux/macOS
- Windows (PowerShell)
3
Use the SDK
The SDK automatically reads the API key from the environment variable:
- Python
- JavaScript/TypeScript
You’re authenticated! The SDK will automatically use your API key for all requests.
Getting Your API Key
1
Sign Up
Create an account at console.hopx.dev
2
Navigate to API Keys
Go to Settings → API Keys in the dashboard
3
Create New Key
Click “Create API Key” and give it a descriptive name (e.g., “Development”, “Production”)
4
Copy Key Immediately
Copy the full API key immediately - you won’t be able to see it again after closing the dialog!
API Key Format
Hopx API keys follow this format:- Prefix:
hopx_live_(constant) - Key ID: 12 characters (base62 alphanumeric)
- Secret: ~43 characters (base64url encoded, 32 bytes)
The secret part is only shown once when you create the key. Store it securely - it cannot be recovered if lost.
Authentication Methods
Method 1: Environment Variable (Recommended)
The SDK automatically reads theHOPX_API_KEY environment variable. This is the recommended approach for all environments.
Set the environment variable:
- Linux/macOS
- Windows (PowerShell)
- Windows (CMD)
- Python
- JavaScript/TypeScript
Method 2: Pass Directly (Quick Testing)
For quick testing or scripts, you can pass the API key directly:- Python
- JavaScript/TypeScript
Method 3: .env File (Development)
For local development, use a.env file:
Create .env file:
- Python
- JavaScript/TypeScript
Advanced Topics
Secrets Managers (Production)
Secrets Managers (Production)
For production environments, use a secrets manager:
- AWS Secrets Manager
- Google Secret Manager
- HashiCorp Vault
Multiple API Keys
Multiple API Keys
Use different keys for different environments:
- Python
- JavaScript/TypeScript
API Key Scopes
API Key Scopes
API keys can have different scopes for fine-grained access control:
Configure scopes in the dashboard.
| Scope | Permissions | Use Case |
|---|---|---|
| Full Access | Create, read, update, delete sandboxes | Production applications |
| Read-Only | List and view sandboxes | Monitoring, dashboards |
| Create-Only | Create new sandboxes only | Isolated services |
Rotating API Keys
Rotating API Keys
Rotate your API keys regularly for security:
1
Create New Key
Generate a new API key in the dashboard
2
Update Applications
Deploy new key to all applications (use blue-green deployment for zero downtime)
3
Verify
Monitor logs to ensure new key works correctly
4
Revoke Old Key
Delete old key from dashboard after 24-48 hours
Error Handling
Handle authentication errors gracefully:- Python
- JavaScript/TypeScript
| Error Code | Message | Solution |
|---|---|---|
auth_invalid_key | Invalid API key | Check key format and validity |
auth_key_expired | API key expired | Rotate to new key |
auth_insufficient_permissions | Insufficient permissions | Use key with correct scope |
auth_rate_limited | Rate limit exceeded | Wait or upgrade plan |
Security Best Practices
✅ DO: Use environment variables
✅ DO: Use environment variables
Store API keys in environment variables or secrets managers, never in code.
✅ DO: Rotate keys regularly
✅ DO: Rotate keys regularly
Rotate API keys every 90 days or when team members leave.
✅ DO: Use different keys per environment
✅ DO: Use different keys per environment
Separate keys for development, staging, and production.
✅ DO: Monitor API key usage
✅ DO: Monitor API key usage
Set up alerts for unusual activity in the dashboard.
❌ DON'T: Commit keys to version control
❌ DON'T: Commit keys to version control
Add
.env and secrets files to .gitignore.❌ DON'T: Share keys in chat/email
❌ DON'T: Share keys in chat/email
❌ DON'T: Log API keys
❌ DON'T: Log API keys
Redact keys in logs and error messages.
Testing Authentication
Verify your API key is working:- Python
- JavaScript/TypeScript
Next Steps
Quickstart
Create your first sandbox
Core Concepts
Learn about sandboxes and templates
Security Guide
Security best practices
Rate Limits
Understand API rate limits
Need help? Contact support@hopx.dev or join Discord.

