---
title: "Create agent conversation with streaming response"
method: POST
path: "/agents/{agentKey}/conversations/stream"
tags: ["Agents"]
---

# Create agent conversation with streaming response

`POST /agents/{agentKey}/conversations/stream`

Start a new conversation with the specified agent and stream the AI
response as Server-Sent Events (SSE). The first user message is saved
and forwarded to the upstream agent backend; subsequent tokens, tool
calls, and lifecycle events are emitted on the open SSE connection.

AG-UI is the sole wire protocol. The request must include
`chatMode: quick`; see `AgentStreamSSEEvent` for the event vocabulary.

## Path parameters

- `agentKey` string, required

## Request body

- AgentStreamCreateConversationRequest — Request body for `POST /agents/{agentKey}/conversations/stream`. `query` and `chatMode: quick` are required; all other fields are optional overrides. Unknown fields are stripped during validation.
  - `query` string, required — User prompt for the first turn. Saved as the initial `user_query` message and sent to the agent backend.
  - `recordIds` string[] — Optional record ids to include as context for this turn. Each id must be a 24-character MongoDB ObjectId.
  - `filters` Filters — App connector instance ids and knowledge-base / record-group ids that narrow retrieval for a turn. For **org assistant** chat streams, send explicit `apps` / `kb` lists. For **agent** chat streams, send explicit id lists, or **omit** `filters` (and `tools`) to let the service use the agent’s stored knowledge and tool configuration. Sending `{ "apps": [], "kb": [] }` on an agent stream means **no** knowledge sources for that turn (it is not “full org default”).
    - `apps` string[] — Connector instance ids to scope retrieval for this turn. Each element must be a valid UUID (connector app id, KB app id, record-group id, etc.). Gateway validation matches Zod `appOrKbIdSchema`.
    - `kb` string[] — Knowledge-base app ids to scope retrieval for this turn. Each element must be a valid UUID.
  - `appliedFilters` AppliedFilters — Rich filter state selected by the user, used for display and persistence only. This mirrors the active selection shown in the UI and is distinct from the machine-readable `filters` field used for retrieval scoping.
    - `apps` AppliedFilterNode[] — Applied app/connector filter nodes
      - `id` string — Unique identifier of the filter node
      - `name` string — Display name of the filter node
      - `nodeType` string — Type of the node (e.g. app, recordGroup, folder, record)
      - `connector` string — Connector identifier associated with this node
    - `kb` AppliedFilterNode[] — Applied knowledge-base filter nodes
      - `id` string — Unique identifier of the filter node
      - `name` string — Display name of the filter node
      - `nodeType` string — Type of the node (e.g. app, recordGroup, folder, record)
      - `connector` string — Connector identifier associated with this node
  - `attachments` ChatAttachmentRef[] — Uploaded attachments to ground this turn. Each entry references a record id returned from the agent attachment upload endpoint.
    - `recordId` string, required — Attachment record id returned from the upload endpoint.
    - `recordName` string — Original display name of the file when known.
    - `mimeType` string — MIME type of the uploaded file.
    - `extension` string — File extension (e.g. `pdf`).
    - `virtualRecordId` string — Optional synthetic record id used by the graph layer.
  - `chatMode` 'quick', required — Required execution mode. Scoped agent conversations currently support only `quick`.
  - `modelKey` string — AI model configuration id for this turn. Omit to use the agent's default model.
  - `modelName` string — Provider model name (the underlying LLM identifier).
  - `modelFriendlyName` string — Friendly UI label for the selected model.
  - `timezone` string — Client IANA timezone, such as `America/New_York`. Helps the agent resolve relative date references in the prompt.
  - `currentTime` string, date-time — Client time in ISO 8601 / RFC 3339 format (UTC `Z` or numeric offset). Sent alongside `timezone` for time-aware answers.
  - `tools` string[] — Allowed tool ids for this turn, such as `jira.create_issue`. Omit to let the agent use its default toolset; send `[]` to disable tools for this turn.
  - `protocol` 'agui' — AG-UI is the only supported wire protocol. When present must be `"agui"`. Omitting the field is equivalent — the server always uses the AG-UI vocabulary (see `AgentStreamSSEEvent`). Kept in the schema for backward compatibility with callers that already send it.
  - `agentCapabilities` AgentCapabilities — Per-request agent capability toggles. Only meaningful when `chatMode` selects an agent mode; ignored otherwise. Each field falls back to its own `default` below when omitted — a missing flag is not uniformly `true`. Omitting the whole object applies every default.
    - `internalSearch` boolean — Whether the agent may search internal knowledge bases for this turn.
    - `webSearch` boolean — Whether the agent may perform web search for this turn.
    - `deepSearch` boolean — Whether the agent may use deeper, higher-latency retrieval for this turn.

## Response `200`

SSE stream (text/event-stream)

## Other responses

- `400` — Invalid request body
- `401` — Unauthorized

---

[API](https://skmtc.net/pipeshub-ai/apis/pipeshub-api.md) · [All operations](https://skmtc.net/pipeshub-ai/apis/pipeshub-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pipeshub-ai/pipeshub-api/revisions/64bfe76b130e/schema)
