Skip to main content

Base URL

Use the externally advertised chat-gateway host. Published agent rows include publicUrl when CHAT_GATEWAY_PUBLIC_HOST is set on the conductor:
All routes require:
The bearer is minted from the conductor publish API for one published profile. It is scoped to the URL tenant and agent slug, checked against allowed origins when Origin is present, and rate-limited per key.

Send a Chat Message

Runs one message against a published agent. The gateway creates a conversation when conversation_id is omitted, otherwise it reuses the existing conversation’s runtime session.
Successful synchronous responses include the durable conversation and public run ids:
If the run exceeds the published agent’s syncMaxDurationSeconds, the endpoint returns 504 with sync_timeout, conversation_id, and public_run_id; use the run or stream endpoints below to resume.

Stream a Chat Message

Starts a run and streams public Server-Sent Events. The request body is the same as Send a Chat Message.
Events: The gateway also sends : ping heartbeat comments about every 15 seconds.

Get a Public Run

Returns the terminal output for a public run, or 202 Accepted while it is still dispatching or running.
error runs return 502; lost runs return 410.

Resume a Public Run Stream

Subscribes to an in-flight public run when its watcher is still alive. If the run is already terminal, the gateway emits one reconstructed done or error event from stored conversation history.

Get a Conversation

Returns recent conversation messages for the published agent. Query params:

Operations

The gateway requires the same Postgres cluster as the conductor, Redis, the published-agent API key pepper, and a private conductor URL: The gateway refuses to start when the Postgres role is a SUPERUSER or has BYPASSRLS, because published_agents and gateway_runs reads are tenant-scoped by RLS. Use the same application-role pattern as the conductor. Health endpoints: