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:agent_auth block describing SiteGPT’s
anonymous agent-registration flow: where the agent guide lives
(https://sitegpt.ai/auth.md), the registration endpoint
(POST https://sitegpt.ai/agent/auth), and the flows supported. The
anonymous flow — the only one supported today — has a matching
anonymous_supported block with the exact request shape: JSON body, required
websiteUrl field, optional flow, agentName, and agentClientId fields
(snake_case aliases accepted), and the api_key credential type the
registration returns. Agents should read the request shape from that block
rather than hard-coding it. See
agent-first onboarding for the flow itself.
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.