---
title: "Respond to chat message (streaming)"
method: POST
path: "/agent/v2/chat/{id}/respond"
tags: ["Agents"]
---

# Respond to chat message (streaming)

`POST /agent/v2/chat/{id}/respond`

Streams a single assistant turn from a Daytona-backed chat runtime as normalized SSE events with stable turn, message, and part IDs. Emits events: `turn.started`, `turn.status`, `message.created`, `message.part.updated`, `message.completed`, `session.usage`, `turn.completed`.

**When to use this endpoint:** Recommended for building custom chat UIs that need real-time streaming progress. This is the primary streaming endpoint for new integrations.

**Alternatives:**
- `POST /chat/:id/message` — synchronous, returns complete response as JSON (best for server-to-server)

## Path parameters

- `id` string, required

## Request body

- object — Message payload following the AI SDK UIMessage format. The body is passed through 1:1 to the underlying OpenCode session. Currently only text parts are supported.
  - `model` string, nullable — Optional model override. When provided, the runtime bootstrap config is updated so subsequent turns use this model. Conversation history is preserved.
  - `parts` object[] — Message content parts. Currently only "text" type is supported. Additional types (e.g. file, image) may be added in future versions.
    - `type` 'text', required — Part type. Currently only "text" is supported.
    - `text` string, required — The message text content

## Response `200`

Turn-scoped normalized SSE stream

## Other responses

- `400` — Invalid payload
- `401` — Invalid API key
- `403` — No agent access or non-API-key auth
- `404` — Chat not found
- `409` — Another turn is already in progress for this chat

## Changes

- **2026-04-03** `2c666c1fdec5` — 1 info
  - added the new optional request property `model`
- **2026-03-27** `220d723a75ba` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/casemark/apis/case-dev-api/changes/agent/v2/chat/:id/respond/post.md)

---

[API](https://skmtc.dev/casemark/apis/case-dev-api.md) · [All operations](https://skmtc.dev/casemark/apis/case-dev-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/casemark/case-dev-api/revisions/2a016c5bb11e/schema)
