Default method, automatically opens browser for OAuth login.
bash
pbd-cli login # Browser login (default)
pbd-cli login --port 8085 # Specify callback port
pbd-cli login --base-url https://open.palebluedot.ai
Flow Description:
https://www.palebluedot.ai/login?redirect_uri=http://localhost:{port}/callbackSuccessful Login Output:
text
Opening browser for login...
If browser doesn't open, visit: https://www.palebluedot.ai/login?redirect_uri=...
Waiting for login...
Exchanging token for session...
Login successful! Logged in as user ID: 12345
Manually enter session cookie and user ID.
bash
pbd-cli login --manual
Prompts for input:
session=xxx)Log out and clear local session.
bash
pbd-cli logout
List all tokens.
bash
pbd-cli token list # Raw JSON output
Output fields:
FieldDescriptionIDToken IDNAMEToken nameQUOTARemaining quotaUSEDUsed quotaMODELSAvailable model restrictionsSTATUSStatus (enabled/disabled)
Create a new token.
bash
pbd-cli token create --name <name>
pbd-cli token create --name prod-key --quota 100000 --models gpt-4o,claude-3-5
ParameterDescription--nameToken name (required)--quotaRemaining quota (default: unlimited)--expiresExpiration timestamp--modelsModel whitelist (comma-separated)
Delete a token.
bash
pbd-cli token delete <id>
Get the plaintext key for a token.
bash
pbd-cli token get-key <id>
pbd-cli token get-key <id> -f # Formatted output
Query balance and subscription status.
bash
pbd-cli usage balance # Raw JSON output
Output:
Query usage logs.
bash
pbd-cli usage logs
pbd-cli usage logs --limit 50 --model gpt-4o
pbd-cli usage logs --page 2 --token my-token
ParameterDescription--limitItems per page (default: 20)--pagePage number (default: 1)--modelFilter by model--tokenFilter by token name
Query wallet balance.
bash
pbd-cli wallet # Raw JSON output
Output:
List available AI models.
bash
pbd-cli models list # Raw JSON output
text
Error: session expired — please run 'pbd-cli login'
Solution: Run pbd-cli login again to re-authenticate.
If automatic browser opening fails, the CLI will print the login URL. Open it manually in your browser:
text
Warning: failed to open browser: ...
Please open this URL manually: https://www.palebluedot.ai/login?redirect_uri=...
Default wait time is 5 minutes. If timeout occurs, run pbd-cli login again.
Ensure:
session=xxx)If default port range (8080-8090) is occupied, use --port to specify a port:
bash
pbd-cli login --port 9000
Configuration file is stored at ~/.pbd-cli/config.yaml with 0600 permissions (owner read/write only).
Configuration Structure:
yaml
base_url: https://www.palebluedot.ai
cookie: session=xxx
user_id: 12345
api_key: "" # Optional
FieldDescriptionbase_urlAPI base URLcookieSession cookie for authenticationuser_idUser IDapi_keyAPI Key (optional)
Security Note: Configuration file uses 0600 permissions to ensure only the current user can read sensitive information.