Dashboard Users: The RebelFi dashboard uses internal JWT authentication for user sessions. This guide covers only
API key authentication for API integration, which is what you’ll need for programmatic access and custom agents.
API Key Authentication
Generating API Keys
- Dashboard
- API
- Navigate to Settings → API Keys
- Click Generate API Key
- Provide a descriptive name (e.g., “Production Agent”, “Dev Environment”)
- Copy and securely store the key (shown only once)
API Key Format
RebelFi API keys follow this format:rfk_test_xxxxxxxxxxx- Test/development keyrfk_live_xxxxxxxxxxx- Production key
Using API Keys
Include the API key in theX-API-Key header:
API Key Access
API keys provide full access to your organization’s resources, including:- Agent polling endpoints (
/api/agent/*) - Wallet management (
/api/core/wallets/*) - Operation management (
/api/core/operations/*) - Allocation management (
/api/v1/allocations/*)
API keys have full organization-level access. Store them securely and rotate them regularly. Create separate keys for
different environments (dev, staging, production).
Security Best Practices
API Key Management
Secure Storage
Secure Storage
DO:
- Store in environment variables
- Use secrets management (AWS Secrets Manager, HashiCorp Vault, Azure Key Vault)
- Encrypt at rest
- Commit to version control
- Store in code or configuration files
- Share via email or chat
- Log in plain text
Key Rotation
Key Rotation
Rotate API keys regularly:
- Generate new API key
- Deploy new key to production (blue/green deployment)
- Verify new key works
- Revoke old key
- Update documentation
Separate Keys Per Environment
Separate Keys Per Environment
Use different API keys for each environment:
- Development:
rfk_test_dev_xxx - Staging:
rfk_test_staging_xxx - Production:
rfk_live_prod_xxx
Least Privilege
Least Privilege
Grant minimum required scopes:
Rate Limiting
RebelFi enforces rate limits for API key authentication:- Agent Polling: 1000 requests/minute
- Transaction Reporting: 500 requests/minute
- Standard APIs: 100 requests/minute
Handling Rate Limits
Testing Authentication
Validate API Key
Test JWT Token
Troubleshooting
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
Cause: Valid credentials but insufficient permissionsSolution:
- Check API key scopes include required permissions
- Verify user has access to the organization
- Check resource ownership (e.g., accessing another org’s wallets)
429 Rate Limit Exceeded
429 Rate Limit Exceeded
Cause: Too many requests in time windowSolution:
- Implement exponential backoff
- Reduce request frequency
- Use webhooks instead of polling (where available)
- Contact support for higher limits if needed