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.

Enable the gateway

  1. Open the agent in the builder and go to the Configuration tab.
  2. Under AI agent gateway, turn on Enable agent gateway.
  3. Optionally set a daily cap for gateway messages (default 500).
  4. 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:

  1. GET the intro URL for usage instructions and endpoint list
  2. GET or POST /ask?message=... to send a turn
  3. Save the returned conversation_token and pass it as conversation on later calls
  4. GET /messages?conversation=TOKEN to read history, including later human replies

Useful paths:

PathPurpose
/agent-gateway/{agent_id}Intro and usage instructions
/agent-gateway/{agent_id}/askSend a message and wait for a reply
/agent-gateway/{agent_id}/messagesRead conversation history
/agent-gateway/{agent_id}/manifestMachine-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:

ToolPurpose
capabilitiesDescribe the agent and how to converse
askSend a message (requires agent_name) and return a reply plus conversation_token
get_conversationRead 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.

Was this page helpful?