Skip to main content
sitegpt-go is the official SiteGPT SDK for Go — a zero-dependency client for the SiteGPT API v2, mirroring the TypeScript and Python SDKs.
  • Zero dependencies — standard library only, built on net/http.
  • Structured errors — every non-2xx response returns a *sitegpt.Error carrying the API’s code, message, and hint.
  • Safe by default — destructive helpers refuse to run without confirm=true (locally, before any request), and the bearer token is stripped whenever a redirect changes scheme, host, or port.
This SDK drives the platform — creating chatbots, training knowledge, reading conversations. To embed the chat widget on your website, use the JavaScript widget SDK instead.

Install

Quickstart

Create a scoped API token on the Agents page, then:
Responses decode into sitegpt.JSON (a map[string]any of the API envelope’s data payload).

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. Pass an empty token and the client sends no Authorization header:
Health is public too; every other endpoint responds 401 until a token is set.

Error handling

Every non-2xx response returns a *sitegpt.Error carrying the API’s error envelope. Use errors.As to inspect it:

Convenience namespaces

The highest-value API groups have first-class methods: Plus client.Me(ctx) and client.Health(ctx).

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, Conversations.Delete, and Leads.Delete take a confirm bool argument and return a CONFIRMATION_REQUIRED *sitegpt.Error locally (before any request) when it is false:

Every other endpoint: Request

All API v2 operations are reachable through the low-level Request:
Paths must start with /, and the client rejects empty or dot path segments locally, so a malformed ID can never collapse the URL toward a parent route. The full endpoint contract is the OpenAPI document at sitegpt.ai/api/v2/openapi.json.

Timeouts and custom HTTP clients

Requests time out after 10 seconds by default. Pass your own *http.Client to change that — the SDK wraps its redirect policy so the cross-origin auth-stripping guarantee survives:
Per-call deadlines work through the standard context package:

Custom base URL

The 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.
  • Python SDK — the same client for Python.
  • 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.