---
title: "Send Message"
method: POST
path: "/api/v1/ollie/projects/{project_id}/messages"
tags: ["ollie"]
---

# Send Message

`POST /api/v1/ollie/projects/{project_id}/messages`

Send one turn; stream ``StreamChunk`` events back via SSE.

The response body is a ``text/event-stream`` matching the agent's
canonical event sequence: ``ollie_thinking_start`` → ``ollie_message_chunk``
(repeated) → ``ollie_thinking_end`` → ``ollie_message_complete`` (or
``ollie_error``).

Cancellation: when the client disconnects, ``request.is_disconnected()``
flips to ``True`` inside the generator and we break out of the loop.
The agent's Phase 1D cancellation path persists a partial ``[truncated]``
turn via a background task spawned on the running loop.

## Path parameters

- `project_id` string, uuid, required

## Request body

- OllieTurnRequest — POST body for starting one Ollie turn. Empty ``message`` ("") is allowed — the agent handles it as an empty turn per the golden-set fixture (gq-016). A hard 10k-char cap protects the Anthropic call and the DB column.
  - `message` string, required
  - `active_part_id` string, uuid, nullable
  - `active_feature_id` string, nullable
  - `client_context` OllieTurnClientContext — Trace-safe client context for one Ollie turn. This is observability and grounding metadata, not prompt content. Keep it to ids, scope/category labels, and surface names so Ollie turns can be evaluated without storing raw CAD geometry or drawing text.
    - `selected_candidate_id` string, nullable
    - `selected_candidate_scope` 'project' | 'part' | 'feature', nullable
    - `selected_candidate_category` 'quote_readiness' | 'dfm' | 'drawing' | 'feature_uncertainty' | 'pricing' | 'lead_time' | 'intent', nullable
    - `active_part_id` string, uuid, nullable
    - `active_feature_id` string, nullable
    - `surface` 'project_overview' | 'part_viewer' | 'admin' | 'unknown'

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

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