---
title: "Chat with the playground assistant"
method: POST
path: "/api/v1/playground/chat"
tags: ["Playground"]
---

# Chat with the playground assistant

`POST /api/v1/playground/chat`

Drives a single turn of the playground chat that builds a workflow
graph incrementally. The server is stateless: each request includes
the full current draft, and the response streams text deltas plus a
single `write_workflow_file` tool call carrying the full new contents
of `workflow.fabro` for the client to parse, diff against its local
draft, and animate into the canvas.

Responses are always SSE. Frames use `event: stream_event` with a
JSON-serialized StreamEvent payload — see /api/v1/completions for the
StreamEvent shape. The tool call arrives on a `tool_call_end` event
with the tool name and parsed JSON arguments.

## Request body

- CreatePlaygroundChatRequest — Body of POST /api/v1/playground/chat. The server is stateless across turns: the browser owns the draft and submits it as the literal `workflow.fabro` contents with every turn. The server embeds the file in the model's system prompt and exposes a single `write_workflow_file` tool that emits the full new contents of `workflow.fabro`; the browser parses, diffs, and animates the result.
  - `messages` CompletionMessage[], required — assistant-ui-style message history for the turn.
    - `role` 'system' | 'user' | 'assistant' | 'tool' | 'developer', required — The role of the message author.
    - `content` CompletionContentPart[], required — Content parts of the message.
      - `kind` string, required — Content part type: text, image, tool_call, tool_result, thinking, etc.
      - `data` unknown
    - `name` string — Optional name for the message author.
    - `tool_call_id` string — Tool call ID for tool result messages.
  - `workflow_fabro` string, required — Full current `workflow.fabro` (Graphviz DOT) contents as rendered by the client — a complete `digraph <name> { ... }` block including the `start` / `exit` terminals. This is the same format the model writes back via `write_workflow_file`.
  - `model` string — Model ID or alias. Server picks a ready-provider default if omitted.
  - `provider` string — LLM provider identifier.

## Response `200`

SSE stream of text deltas and tool calls.

## Other responses

- `400` — Invalid request

---

[API](https://skmtc.net/fabro-sh/apis/fabro-run-api.md) · [All operations](https://skmtc.net/fabro-sh/apis/fabro-run-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fabro-sh/fabro-run-api/revisions/52f1d8aaf083/schema)
