Your AI. Your infrastructure.
Your data.
Connect Ollama, Claude, GPT-4, or any LLM to handle chats automatically. GhostChat is the pipe — you own the brain.
The first chat widget built for the agentic web.
How the data flows
Visitor
types a message
GhostChat
routes messages
Your AI
Ollama / Claude / GPT
GhostChat is the pipe. You own the brain.
Every AI chat vendor wants you locked into their model, their pricing, and their data pipeline.
$0.002 per message adds up fast at scale. Switching models means switching vendors. Your conversation data lives on someone else's infrastructure. You have no control.
GhostChat's Bot Agent flips this. You bring the AI, we handle the widget, routing, and dashboard. Run Llama 3 locally at zero marginal cost. Swap models without changing your chat setup. Keep your data where you want it.
How it works
Four steps from zero to a working AI chat agent on your site.
Generate an API key, run the setup wizard
In your dashboard go to Bot Agent and generate a gc_bot_ API key. Then in a fresh folder on your machine:
$ cd my-ghostchat-bot
$ npx ghostchat-agent --setup
Run in a dedicated folder — keeps your bot isolated from your codebase. The wizard handles everything: validates your key, configures your widget, generates your bot's knowledge base, and starts a secure tunnel automatically.
Set your webhook URL
In Dashboard → Sites → [your site] → Webhook URL, enter the HTTPS endpoint your bot is listening on. GhostChat will POST every visitor message there in real time.
Bot receives message, calls LLM, replies
Your webhook handler receives the visitor message payload, calls whichever LLM you choose, and POSTs the reply back to the GhostChat API. The visitor sees the response instantly in the widget.
// GhostChat sends this to your webhook URL
{
"event": "message.new",
"siteId": "cl194a6c5368cc4cceb600c436",
"siteName": "My Store",
"sessionId": "sess_abc123",
"messageId": "msg_xyz789",
"content": "What's your return policy?",
"visitorEmail": "jane@example.com",
"visitorName": "Jane",
"pageUrl": "https://mystore.com/checkout",
"country": "US",
"createdAt": "2026-03-18T12:00:00Z"
}See all chats in dashboard — jump in anytime
Every bot conversation appears in your GhostChat dashboard exactly like a human chat. You can read them, search them, and reply directly at any moment — no handoff protocol needed. Just start typing.
Bot handler example
Pro+A minimal handler that receives a visitor message and replies via the GhostChat API. Works as a Cloudflare Worker, Vercel Function, Node.js server, or any HTTPS endpoint.
// Your bot handler (Node.js / any runtime)
app.post('/ghostchat-webhook', async (req, res) => {
const { sessionId, content, siteId } = req.body
// Call any LLM — Ollama, Claude, GPT-4, Gemini, Mistral...
const aiReply = await callYourLLM(content)
// Reply via GhostChat API
await fetch('https://api.ghostchat.dev/messages/owner', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer gc_bot_your_key_here',
},
body: JSON.stringify({ sessionId, content: aiReply }),
})
res.json({ ok: true })
})Using Ollama (local, free)
Zero API costRun Llama 3, Mistral, Phi-3, or any model locally via Ollama. No per-token costs, no rate limits, no data leaving your infrastructure. Replace the LLM call in your bot handler with:
// Ollama (local, zero API costs)
const response = await fetch('http://localhost:11434/api/generate', {
method: 'POST',
body: JSON.stringify({
model: 'llama3',
prompt: visitorMessage,
stream: false,
}),
})
const { response: aiReply } = await response.json()Why bringing your own AI beats built-in
Built-in AI means vendor lock-in. Bring Your Own Agent means you stay in control.
No per-message AI costs
GhostChat charges a flat plan fee — never per AI message. Run 10,000 AI conversations a month and your bill doesn't change. Use Ollama locally and your marginal AI cost is literally $0.
No vendor lock-in
Want to switch from GPT-4 to Claude 3.5 Sonnet? Change one line in your bot handler. Want to switch from Claude to a fine-tuned local model? Same deal. Your chat widget setup doesn't change.
Works with any LLM
The webhook is a plain HTTP POST. Your bot can call OpenAI, Anthropic, Google, Cohere, a local Ollama instance, a fine-tuned model on Replicate, or a retrieval-augmented pipeline — anything with an API.
Human takeover — always available
Your dashboard shows every conversation, bot or human. Log in and type at any point — your reply goes straight to the visitor. No configuration, no routing rules. You always have the last word.
Combine with visitor context
Use GhostChat.setContext() to push cart contents, user plan, page type, or any custom data — it arrives in the webhook payload so your bot has full context before generating a reply.
Works with every model
If it has an API and returns text, you can use it. No official integrations needed — you write the glue.
Ollama
Local — free
Claude API
Anthropic
GPT-4 / GPT-4o
OpenAI
Gemini
Mistral
Mistral AI
Groq
Fast inference
Llama 3
Meta / local
Custom RAG
Any pipeline
FAQ
Which AI models does this work with?
Any model you can call from a server — Ollama (local), Claude API, OpenAI GPT-4/GPT-4o, Gemini, Mistral, Groq, or any custom LLM with an HTTP API. GhostChat just fires a webhook and accepts a reply. The AI layer is entirely yours.
What happens if my bot is slow or down?
The visitor sees their message sent as normal. If your webhook takes more than 10 seconds to reply, the visitor may see a typing indicator for longer than expected. You can also combine bot + human: configure business hours so the bot handles off-hours and you handle live sessions.
Can I hand off from bot to human mid-conversation?
Yes. Just log into the dashboard and reply — your agent message will appear in the conversation. You can jump in at any point. There's no explicit "handoff" step needed.
Is this the same webhook as the automation webhook?
Yes, it's the same webhook URL field in your site settings. The bot agent pattern is just a specific use case: your webhook endpoint calls an LLM and replies via the GhostChat messages API. You can also use the webhook for CRM sync, Slack alerts, or anything else.
Do I need to run my own server?
You need an HTTPS endpoint that can receive a POST request and call the GhostChat reply API. This can be a Cloudflare Worker, Vercel Edge Function, AWS Lambda, Fly.io app, or any server. Even a simple free-tier function works.
Run your own AI agent in minutes.
Available on Pro ($5/mo). No per-message AI charges. No lock-in.
The first chat widget built for the agentic web.