/api/v2 routes.
Authentication methods
- OAuth device login
- Existing token
- Environment variable
Recommended for humans and local AI assistants:OAuth device login opens a browser approval page and creates a scoped token after you approve access. The CLI uses
client_id=sitegpt-cli with SiteGPT’s OAuth device authorization endpoints.Manual dashboard-token login
Manual token login is useful when you want to choose permissions in the dashboard first, then connect the CLI afterward.1
Create a token in the dashboard
Open the SiteGPT dashboard, go to Agents, click Create token, and choose the access level, scopes, and chatbot access.
2
Copy the token
Copy the plaintext token immediately. SiteGPT stores only a secure hash and cannot show the same token again.
3
Save it in the CLI
4
Use a named profile when needed
sitegpt login --token <token> or set SITEGPT_API_TOKEN for one-off commands.
OAuth device flow for agents
sitegpt login uses the OAuth Device Authorization Grant. This is the recommended browser-approved flow for local CLIs and personal AI agents because it does not require pasting an API token into chat.
The first-party CLI uses this public client identifier:
client_id identifies the application requesting access. It is not a secret, and it is the same for all users of the SiteGPT CLI.
Discovery endpoints:
Access levels
Token issuance is role-aware. A user can only create tokens for scopes and chatbots they are allowed to manage in the dashboard.
Available scopes
Token commands
Create options
Reference: token scopes and API token commands.
Token lifecycle
Newly created and rotated tokens are shown once:Least-privilege examples
Read-only chatbot inventory:Security notes
- Do not commit
~/.config/sitegpt/config.json. - Prefer chatbot-restricted tokens for agents.
- Use
--jsonfor automation so scripts do not scrape human tables. - Rotate tokens after demos, tests, and shared-agent sessions.
- Revoke tokens you no longer use: