SiteGPT supports OAuth Device Authorization Grant for local CLIs, scripts, and personal AI agents. This is the protocol used byDocumentation Index
Fetch the complete documentation index at: https://sitegpt.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
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
| Field | Required | Description |
|---|---|---|
client_id | Yes | Use sitegpt-cli for the first-party SiteGPT CLI/device flow. |
scope | No | Space-separated SiteGPT scopes. If omitted, SiteGPT requests standard CLI access. See available scopes. |
full_access | No | Default: false. Set to true to request all self-service scopes the approving user’s dashboard role can issue. Do not send this with scope. |
token_name | No | Token name shown in the dashboard. |
name | No | Alias for token_name. |
expires_in_days | No | Token lifetime in days. Valid range: 1-365. Default: 90. |
chatbot_id | No | Restrict access to one chatbot. Repeat for multiple chatbots. |
chatbot_ids | No | Comma-separated chatbot IDs. |
/oauth/token
| Field | Required | Description |
|---|---|---|
grant_type | Yes | Must be urn:ietf:params:oauth:grant-type:device_code. |
client_id | Yes | Use the same client ID used to start authorization. For the SiteGPT CLI, use sitegpt-cli. |
device_code | Yes | The device_code returned by /oauth/device_authorization. |
Error responses
| Error | Meaning |
|---|---|
authorization_pending | The user has not approved the browser prompt yet. Wait and poll again. |
slow_down | The client is polling too quickly. Increase the polling interval. |
access_denied | The user denied the request. Stop polling. |
expired_token | The device code expired. Start a new login. |
invalid_grant | The device code is invalid, consumed, or no longer usable. |
invalid_scope | One or more requested scopes are not valid or not self-service. |
invalid_request | Required fields are missing or malformed. |
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.