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
This 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
Shows your logged-in email and account tier.
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:
If your token is compromised, generate a new one:
This invalidates the old token immediately. Update all clients using the old token.
Credential Storage
Secret Service (libsecret)
Non-sensitive configuration is stored in ~/.predictor/config.yaml.
Restrict endpoint access to specific IP addresses in predictor.yaml:
Requests from non-allowed IPs receive a 403 Forbidden response.