---
title: "Stream Turn"
method: POST
path: "/sessions/{session_id}/turn"
tags: ["turns"]
---

# Stream Turn

`POST /sessions/{session_id}/turn`

## Request

- The document declares no server URL.
- Auth: none declared

Run one Turn and stream its activity as Server-Sent Events.

The stream ends with one outcome event followed by the terminal `done` envelope when `run_turn`
reached it; a worker that stops earlier still closes the stream with one terminal event.
A client disconnect cancels a Turn without an observed outcome; after an outcome it preserves
the completed Turn's warm root. The Session stays locked until sandbox work has drained.

## Path parameters

- `session_id` string, required

## Request body

- TurnRequest: User prompt sent to one Session's Fleet engine.
  - `task` string, required
  - `idempotency_key` string, nullable
  - `record_replay` boolean: Persist a bounded immutable snapshot of this Turn's inputs for explicitly reviewed GEPA data.
  - `timeout_seconds` integer, nullable: Fleet deadline for this Turn in seconds. Omitted or null inherits the configured value; 0 disables the Fleet deadline; otherwise the value must be 10..3600.

## Response `200`

Server-Sent Events for Turn status, activity, completion, or failure.

## Other responses

- `409`: A Turn or workspace change holds the Session lock; retry when it completes
- `422`: Validation Error

## Changes

- **2026-10-23** `6397e588ee17`: 1 info
  - added the new optional request property `timeout_seconds`
- **2026-10-20** `3623d819a7fe`: 1 info
  - added the non-success response with the status `409`
- **2026-10-17** `fdcd88c2c807`: 1 info
  - added the new optional request property `record_replay`
- **2026-10-15** `f94854aad429`: 1 info
  - api tag `turns` added
- **2026-10-15** `49da87181f52`: 1 info
  - added the new optional request property `idempotency_key`

[Operation history](https://skmtc.dev/qredence/apis/fleet-rlm/changes/sessions/:session_id/turn/post.md)

---

[API](https://skmtc.dev/qredence/apis/fleet-rlm.md) - [All operations](https://skmtc.dev/qredence/apis/fleet-rlm/llms.txt) - [OpenAPI document](https://skmtc.dev/qredence/apis/fleet-rlm/revisions/87de8fd61161?raw)
