Get Your API key
Sign up at console.hopx.dev to get your free API key. After creating an account, navigate to the API Keys section in your dashboard to create and manage keys.Your API key is shown only once when created. Make sure to save it securely. If you lose your key, you’ll need to create a new one from the dashboard.
API key Format
HopX API keys follow this format:- Prefix:
hopx_live_(indicates a live/production key) - Key ID: 12-character alphanumeric identifier (public, used for identification)
- Secret: 32-byte cryptographically random secret (base64url encoded)
Authentication Methods
The HopX API supports two authentication header formats:Method 1: Authorization Header (Recommended)
Include your API key in theAuthorization header using Bearer authentication:
Replace
$HOPX_API_KEY with your actual API key from console.hopx.dev, or set it as an environment variable: export HOPX_API_KEY="your-API key-here"Method 2: X-API key Header
Alternatively, use theX-API key header:
Replace
$HOPX_API_KEY with your actual API key from console.hopx.dev, or set it as an environment variable: export HOPX_API_KEY="your-API key-here"Complete Request Example
Here’s a complete authenticated request to create a sandbox:Security Best Practices
1. Use Environment Variables
Store your API key in an environment variable rather than hardcoding it:2. Use Least Privilege
Only grant API keys the minimum permissions needed for your use case. If you’re only reading sandbox information, don’t use a key with full write access.3. Rotate Keys Regularly
Periodically rotate your API keys, especially if you suspect they may have been compromised. Create new keys in the dashboard and update your applications.4. Monitor Key Usage
Review API key usage in your dashboard to detect any unauthorized access. If you see unexpected activity, revoke the key immediately.Authentication Errors
401 Unauthorized
If your API key is missing, invalid, or expired, you’ll receive a 401 error:- Missing
AuthorizationorX-API keyheader - Invalid API key format
- Revoked or expired API key
- Verify your API key is correct
- Check that the key hasn’t been revoked in your dashboard
- Ensure you’re using the correct header format
403 Forbidden
If your API key doesn’t have permission for the requested operation:- Verify your API key has the required permissions
- Check your account’s access level in the dashboard
Public Endpoints
The following endpoints do not require authentication:GET /health- Health check endpoint
Related
- [API key Management](/API key) - Manage API keys in the dashboard
- Python SDK Quickstart - Get started with the Python SDK
- JavaScript SDK Quickstart - Get started with the JavaScript SDK
- API Quickstart - Make your first API request
- CLI Reference - Command-line interface
Next Steps
- Quickstart - Create your first sandbox with a complete example
- Control Plane API - Learn about sandbox management endpoints
- [Get API key](/API key) - Detailed guide on obtaining and managing API keys

