Authentication
RequestHunt supports two authentication methods: browser login (primary) and manual API keys (for CI and automation).
Browser Login (Recommended)
The fastest way to authenticate. The CLI displays a short verification code and opens your browser. Enter the code to approve, and credentials are saved locally.
requesthunt auth login
# Visit: https://requesthunt.com/device
# Code: ABCD-EFGH
# Enter the code in your browser → credentials saved
requesthunt auth status
# Shows logged-in user, email, and tierCredentials are stored in credentials.json with restricted permissions (0600). They persist until you run requesthunt auth logout.
Manual API Key (CI / Automation)
For headless environments where browser login is not available.
Getting an API Key
- Log in to your dashboard
- Navigate to the "API" tab
- Click "Create Key" and give it a name
- Copy the key immediately — it won't be shown again
Three ways to provide a manual key:
# Option 1: Environment variable
export REQUESTHUNT_API_KEY="rh_live_your_key"
# Option 2: Save to config file
requesthunt config set-key rh_live_your_key
# Option 3: Per-command flag
requesthunt --api-key rh_live_your_key search "dark mode"Credential Resolution Order
When multiple credentials are present, the CLI uses the highest priority source:
- Browser login —
credentials.jsonfromauth login - --api-key flag— per-command override
- REQUESTHUNT_API_KEY— environment variable
- config.toml — from
config set-key
REST API Authentication
For direct HTTP requests, include your API key in the Authorization header with the Bearer prefix:
curl -X GET "https://requesthunt.com/api/v1/requests" \
-H "Authorization: Bearer rh_live_your_api_key_here" \
-H "Content-Type: application/json"API Key Format
rh_live_[32 random characters]Example: rh_live_k9tcn0zs48v311krjx1m1d6emuiah6z3
Error Response
If authentication fails, you'll receive a 401 response:
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}