sitegpt login.
Use this page when you are building an agent or integration that wants to authenticate without asking the user to copy a token manually.
Most users should run
sitegpt login instead of calling these endpoints directly. The CLI handles device authorization, polling, profile storage, and API token use.Discovery
Agents can discover SiteGPT’s OAuth device flow from the authorization-server metadata:Client ID
Use this client ID for the first-party SiteGPT CLI/device flow:client_id identifies the application requesting access. It is not a secret and does not identify the user. All users of the SiteGPT CLI use the same client_id.
Start device authorization
Send a form-encoded request to/oauth/device_authorization:
verification_uri_complete in a browser. The signed-in SiteGPT user reviews the requested access and approves or denies the request.
Poll for the token
Poll/oauth/token with the device code:
interval before polling again. If you poll too quickly, SiteGPT can return:
access_token as the bearer token for /api/v2 requests:
Request fields
/oauth/device_authorization
/oauth/token
Error responses
Security notes
- Do not put
access_tokenin prompts, shared chats, source code, or logs. - Use the smallest scope set needed for the agent.
- Use
chatbot_idrestrictions for chatbot-specific agents. - Rotate or revoke tokens after demos and shared sessions.
- For normal CLI usage, prefer
sitegpt login; it stores the token in a local profile.