Authentication
predictor.sh uses two types of authentication:
User Authentication - Your account credentials (for CLI operations)
Endpoint Authentication - Bearer tokens for API requests
User Authentication
Login
predictor loginThis initiates an OAuth device flow:
A URL and code are displayed in your terminal
Open the URL in your browser
Enter the code and approve access
CLI receives your credentials automatically
Verify Login
predictor whoamiShows your logged-in email and account tier.
Logout
Clears stored credentials from your system keychain.
Endpoint Authentication
Every endpoint gets a unique Bearer token for API authentication.
View Your Token
By default, the token is masked. To reveal:
Using the Token
Include the token in your API requests:
Rotate Token
If your token is compromised, generate a new one:
This invalidates the old token immediately. Update all clients using the old token.
Credential Storage
macOS
System Keychain
Linux
Secret Service (libsecret)
Non-sensitive configuration is stored in ~/.predictor/config.yaml.
IP Allowlist
Restrict endpoint access to specific IP addresses in predictor.yaml:
Requests from non-allowed IPs receive a 403 Forbidden response.
Last updated