Skip to main content
SiteGPT has a developer surface for each direction of integration: control the widget on your page, get events out, and drive the platform programmatically.

Pick your path

JavaScript SDK

Control the widget from your page: open and close it, send messages, inject CSS, identify logged-in users.

Tracking events

The widget emits analytics events (chat opened, lead submitted, and more) to GTM, GA4, or your own code.

Webhooks

SiteGPT POSTs messages, leads, and escalations to your endpoint as they happen.

Agent API (v2)

A full REST API over chatbots, knowledge, conversations, leads, and settings. OpenAPI spec included.

CLI

Create and manage chatbots from the command line, or let coding agents do it. Includes an onboarding flow that goes from URL to working chatbot in one command.

MCP server

Connect AI agents (Claude, Cursor, and others) to your SiteGPT account through the Model Context Protocol.

Credentials: the Agents page

Programmatic access is authenticated with API tokens, managed on the Agents page in the top navigation. Tokens are scoped: you choose which permissions they carry and which chatbots they can touch. The same page manages MCP connections. See API tokens & MCP for the full model, and note that the legacy v0 API uses a separate account API key; the v0 reference covers it.

The five-minute tour

The fastest way to feel the surface, assuming the widget is already installed:
  1. Open your site with the widget and run $sitegpt.push(['open']) in the browser console. The chat opens; the SDK is live on your page.
  2. Add a listener: $sitegpt.push(['on', 'conversation_started', console.log]) and start a chat. That is tracking events.
  3. Point a webhook lane at a request inspector and send a message; the ADD_MESSAGE payload arrives.
  4. Create a token on Agents and call curl -H "Authorization: Bearer sgpt_..." https://sitegpt.ai/api/v2/me. That is the Agent API.