Developers
MonGPT API
Everything the dashboard does, as a REST API — plus a hosted MCP server so AI agents like Claude can manage your bots directly. Available on the Growth plan and higher.
Authentication
Create a token in Dashboard → API. Tokens are scoped (choose exactly what they can do), can be limited to specific bots, and can expire. Pass them as a bearer header:
curl https://mongpt-api.mongpt.workers.dev/v1/bots \ -H "Authorization: Bearer mgpt_your_token_here"
Endpoints
| Method | Path | Scope | Description |
|---|---|---|---|
| GET | /v1/bots | bots:read | List bots |
| POST | /v1/bots | bots:write | Create a bot (plan-limited) |
| GET | /v1/kb?chatbotId=… | kb:read | List knowledge-base documents |
| POST | /v1/kb/ingest | kb:write | Add knowledge from a URL or raw text (queued) |
| POST | /v1/chat | chat:invoke | Chat with a bot — SSE streaming, counts toward quota |
| GET | /v1/conversations | conversations:read | List conversations (?q= search) |
| GET | /v1/conversations/{sessionId} | conversations:read | Full transcript of one session |
| GET | /v1/analytics | analytics:read | 30-day analytics summary |
| GET | /v1/openapi.json | — | This API as an OpenAPI 3.1 spec (no auth) |
Full schemas: openapi.json
Chat (streaming)
POST /v1/chat returns Server-Sent Events with OpenAI-style chunks. Pass a stable sessionId to group turns into one conversation in your dashboard.
curl https://mongpt-api.mongpt.workers.dev/v1/chat \
-H "Authorization: Bearer mgpt_…" \
-H "Content-Type: application/json" \
-d '{
"message": "What is your refund policy?",
"chatbotId": "…",
"sessionId": "user-42",
"language": "hi-IN"
}'
data: {"choices":[{"delta":{"content":"हमारी"}}]}
data: {"choices":[{"delta":{"content":" रिफंड"}}]}
…MCP server (for AI agents)
MonGPT hosts a remote MCP server, so Claude and other MCP-capable agents can list bots, add knowledge, ask questions, and read conversations & analytics — using the same scoped tokens. Tools exposed match your token's scopes.
{
"mcpServers": {
"mongpt": {
"url": "https://mongpt-api.mongpt.workers.dev/mcp",
"headers": { "Authorization": "Bearer mgpt_…" }
}
}
}Tools: list_bots · list_knowledge · add_knowledge · ask_bot · list_conversations · get_conversation · get_analytics
Limits & errors
- Per-token rate limits follow your plan tier;
429includesRetry-After. 401invalid/expired/revoked token ·402plan doesn't include API access or a quota is reached ·403missing scope or bot restriction.- Chat messages sent via the API count toward your monthly message quota, same as widget messages.
Get an API key in 2 minutes
Start the free trial, open Dashboard → API, create a token.
Start free trial