Skip to main content
sitegpt is the official SiteGPT SDK for Python — a small, dependable, zero-dependency client for the SiteGPT API v2 (standard library only, Python 3.9+).
  • Envelope-aware — the API responds with { ok, data, meta }; the SDK returns data directly (plain dicts and lists) and raises a SiteGPTError whenever ok is false.
  • Full API reach — convenience methods cover the highest-value groups (chatbots, knowledge, conversations, leads, messages, onboarding); every one of the 119 API v2 operations is reachable through request().

Install

Quickstart

Create a scoped API token on the Agents page, then:

Agent onboarding bootstrap (no token required)

The agent-first onboarding bootstrap is a public endpoint — an AI agent can provision a SiteGPT workspace with no credentials at all, and the response carries the temporary workspace token to use for everything that follows:
health() is public too; every other endpoint responds 401 until an api_token is set.

Error handling

Every failed call raises a SiteGPTError carrying the API’s error envelope:

Convenience namespaces

Plus sitegpt.me() and sitegpt.health().

Destructive operations require confirmation

The API requires confirm=true on delete-family endpoints, and the SDK keeps that intent explicit instead of confirming on your behalf: chatbots.delete, knowledge.delete_document, knowledge.delete_documents, knowledge.revoke_source, conversations.delete, and leads.delete take a confirm=True keyword argument and raise a CONFIRMATION_REQUIRED SiteGPTError client-side (before any request) without it:
Body fields and query filters are passed as keyword arguments using the API’s own field names (camelCase, exactly as documented in the OpenAPI document):

Every other endpoint: request()

request_with_meta() additionally returns the envelope meta — including meta["nextCursor"] for pagination:

Custom base URL

base_url defaults to https://sitegpt.ai and only needs to change if SiteGPT gives you a different API origin.
  • TypeScript SDK — the same client for TypeScript and JavaScript.
  • SiteGPT CLI — the same API from your terminal, scripts, and AI agents (includes a local MCP server).
  • API v2 reference — every endpoint, generated from the live OpenAPI document.