Agent Gateway
The Agent Gateway lets external AI agents — Claude, ChatGPT, research tools, and similar callers — converse with your Aimdoc agent directly instead of scraping your pages. Conversations use the same skills, escalation, and live chat handoff as website visitors.
The gateway is off by default. Enable it per agent when you want visiting AI agents to reach yours.
This is not the authenticated MCP Server. That server reads your Aimdoc account data with OAuth or an API key. The Agent Gateway is a public conversation surface addressed by agent ID — no Aimdoc credentials required from the caller.
Enable the gateway
- Open the agent in the builder and go to the Configuration tab.
- Under AI agent gateway, turn on Enable agent gateway.
- Optionally set a daily cap for gateway messages (default
500). - Save and Publish so the live agent picks up the change.
Draft agents are never exposed on the gateway. Only the published agent accepts conversations.
Discovery on your site
When the gateway is enabled and your website embed is installed, Aimdoc publishes discovery markers on pages where the widget loads (website mode). Visiting AI agents that read the page can find:
- The HTTP gateway URL
- The public MCP URL
- A machine-readable manifest
You can also share the gateway or MCP URL directly (for example in an llms.txt file). Replace YOUR_AGENT_ID with your agent ID from the Deploy tab.
HTTP surface
Base URL:
https://api.aimdoc.ai/agent-gateway/YOUR_AGENT_ID
Callers typically:
GETthe intro URL for usage instructions and endpoint listGETorPOST/ask?message=...to send a turn- Save the returned
conversation_tokenand pass it asconversationon later calls GET/messages?conversation=TOKENto read history, including later human replies
Useful paths:
| Path | Purpose |
|---|---|
/agent-gateway/{agent_id} | Intro and usage instructions |
/agent-gateway/{agent_id}/ask | Send a message and wait for a reply |
/agent-gateway/{agent_id}/messages | Read conversation history |
/agent-gateway/{agent_id}/manifest | Machine-readable endpoint list |
Optional query parameters on /ask: agent_name, agent_model, and acting_for (email of the person the caller acts for). Caller identity is stored as an unverified hint for your team — the agent does not treat it as authenticated. Add format=json when you want structured responses instead of markdown.
Public MCP surface
MCP-capable callers can connect with Streamable HTTP (no auth):
https://api.aimdoc.ai/mcp/public/YOUR_AGENT_ID
Tools:
| Tool | Purpose |
|---|---|
capabilities | Describe the agent and how to converse |
ask | Send a message (requires agent_name) and return a reply plus conversation_token |
get_conversation | Read history for a token, including later human replies |
Pass conversation_token from a previous ask to continue the same conversation. Tokens remain valid across sessions so the caller can return later for human replies.
Sessions and human handoff
Gateway conversations appear in your Sessions list with an AI Agent badge so you can tell them apart from website visitors.
Escalation and Slack live-chat takeover work the same way as for human visitors. When a rep joins, the visiting AI agent does not stay in a live websocket — it polls /messages or get_conversation and relays the human reply to its user.