This endpoint streams its response. It is not part of the OpenAPI playground
— use the examples below to integrate it.
Endpoint
This replaces
POST /v1/api/project-agents/{agentId}/chat, which has been
removed along with project agents. Requests now name the project and the
workspace in the path.Authentication
Authenticate with a project user token obtained from Get Project User Token:Request body
Response stream
The response is atext/event-stream of newline-separated events, each on a
data: {json} line. Every event has a type; the ones you need are:
Other event types may appear (workflow steps, finish markers); ignore any
type you don’t handle.
The chart result
When the agent builds a chart, atool-result event arrives with
payload.toolName === "visualizeData" ("renderChart" from an agent deployed
before that tool was renamed, and "generateChart" for an organization still on
the legacy agent). Its payload.result contains:
visualizeData call that drew no chart answers "status": "failed" with an
"error" explaining why, or "status": "skipped" with "notes"; in both,
chartConfig is null and generatedChartRef is null, so check for a
chartConfig before treating a result as a chart.