Skip to main content

sitegpt

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/lists) and raises a SiteGPTError (with the API's error code, message, and actionable hint) whenever ok is false.
  • Full API reach — convenience methods cover the highest-value groups (chatbots, knowledge, conversations, leads, messages, onboarding); every one of the 120 API v2 operations is reachable through request().

Install

pip install sitegpt

Quickstart

Create an API token in the SiteGPT dashboard (Settings → API tokens), then:

import os

from sitegpt import SiteGPT

sitegpt = SiteGPT(api_token=os.environ["SITEGPT_API_TOKEN"])

# List your chatbots
chatbots = sitegpt.chatbots.list()["chatbots"]
chatbot_id = chatbots[0]["id"]

# Add knowledge to a chatbot
sitegpt.knowledge.add_links(
    chatbot_id, urls=["https://example.com/docs/getting-started"]
)

# Send a chat message (starts a new conversation)
reply = sitegpt.messages.send(chatbot_id, message="What are your pricing plans?")

# Review conversations and captured leads
conversations = sitegpt.conversations.list(chatbot_id, limit=20)
leads = sitegpt.leads.list(chatbot_id)

Agent onboarding bootstrap (no token required)

The 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:

from sitegpt import SiteGPT

# No API token yet — the bootstrap endpoint is public:
bootstrap = SiteGPT()
started = bootstrap.onboarding.start(websiteUrl="https://example.com")

# The response includes a temporary workspace token:
sitegpt = SiteGPT(api_token=started["apiToken"])
sitegpt.knowledge.document_stats(started["workspace"]["chatbotId"])

health() is public too; every other endpoint responds 401 until an api_token is set.

Error handling

from sitegpt import SiteGPT, SiteGPTError

try:
    sitegpt.chatbots.get("nonexistent-id")
except SiteGPTError as error:
    print(error.status)      # HTTP status, e.g. 404
    print(error.code)        # machine-readable code, e.g. NOT_FOUND
    print(error.message)     # human-readable message
    print(error.hint)        # actionable next step, when the API provides one
    print(error.request_id)  # for support and debugging

Convenience namespaces

Namespace Methods
sitegpt.chatbots list, get, create, update, delete, dashboard
sitegpt.knowledge list_documents, get_document, update_document, delete_document, delete_documents, document_stats, resync_documents, add_links, add_website, add_sitemap, add_youtube, set_text, list_sources, get_source, create_source, update_source, revoke_source, ingest_source, list_sync_jobs, get_sync_job
sitegpt.conversations list, get, create, update, delete, escalate, switch_to_ai
sitegpt.leads list, get, update, delete, run_action
sitegpt.messages send, send_to_conversation, list, update
sitegpt.onboarding start, get_workspace, claim_workspace, delete_workspace

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:

sitegpt.conversations.delete(chatbot_id, thread_id, confirm=True)
sitegpt.chatbots.delete(chatbot_id, confirm=True)

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):

sitegpt.knowledge.list_documents(chatbot_id, limit=10, source=["WEBSITE"])
sitegpt.knowledge.get_document(chatbot_id, document_id, includeContent=True)

Every other endpoint: request()

# Custom responses, personas, instructions, settings, members, tags, billing…
personas = sitegpt.request(f"/api/v2/chatbots/{chatbot_id}/personas")

sitegpt.request(
    f"/api/v2/chatbots/{chatbot_id}/settings",
    method="PATCH",
    body={"general": {"title": "Support Bot"}},
)

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

data, meta = sitegpt.request_with_meta(
    f"/api/v2/chatbots/{chatbot_id}/conversations", query={"limit": 50}
)
if meta.get("nextCursor"):
    more = sitegpt.conversations.list(chatbot_id, cursor=meta["nextCursor"])

Custom base URL

base_url defaults to https://sitegpt.ai and only needs to change if SiteGPT gives you a different API origin.

License

MIT © SiteGPT

Metadata

Release files for sitegpt 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sitegpt 0.3.0
File Size Uploaded Provenance
sitegpt-0.3.0.tar.gz 10.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sitegpt 0.3.0
File Interpreter ABI Platform
sitegpt-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.4 kB

Release files / sitegpt-0.3.0.tar.gz

Download URL sitegpt-0.3.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ba6e854bb1790abc21b64888a53b5a26d58a273091b2ed42ccc8d1b9e739d216
BLAKE2b-256 checksum
How to use checksums
61d7e8978be69d18838e3e9fced129193d638960d16859d80618fbf20ef1c3f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / sitegpt-0.3.0-py3-none-any.whl

Download URL sitegpt-0.3.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4cb0787ff70464cb4cd7c68274535583b5042d08cea4f7d4869af8e2730265b5
BLAKE2b-256 checksum
How to use checksums
05639f36d9df795171833168a5c1eadce018d76388f01c76c485c4d63f241463
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Security for sitegpt 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sitegpt-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page