---
title: "Submit a turn to a user-owned conversation. The authenticated user's current role and permissions are captured for this turn's tool executor; no project id from the browser is trusted or required."
method: POST
path: "/ai/conversations/{public_id}/messages"
tags: ["AI Chat"]
---

# Submit a turn to a user-owned conversation. The authenticated user's current role and permissions are captured for this turn's tool executor; no project id from the browser is trusted or required.

`POST /ai/conversations/{public_id}/messages`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ai/conversations/{public_id}/messages`
- Auth: HTTP bearer

## Path parameters

- `public_id` string, required

## Request body

- SendMessageRequest
  - `ai_model` string, nullable: Optional next-turn model, one advertised by the conversation's provider (or by `ai_provider` when that is set).
  - `ai_permission_mode` string, nullable: Optional next-turn permission mode for the pinned provider harness.
  - `ai_provider` string, nullable: Optional AI gateway provider (`gateway_key:<id>`) for this and later turns. A chat on an AI gateway provider may move to another one; a provider harness chat stays on the provider it was created with.
  - `ai_thinking_level` string, nullable: Optional next-turn thinking level.
  - `attachments` ChatAttachmentReference[]: Opaque references returned by the conversation attachment endpoint.
    - `id` string, required
    - `name` string, required
  - `content` string, required
  - `page_context` string, nullable: Optional, client-supplied description of the page/entity the user is currently viewing (e.g. a trace in a project). Injected into the model's view of this turn only — never stored or shown in history. Capped server side; oversized values are ignored rather than rejected.
  - `turn_id` string, nullable: Client-generated opaque idempotency key for this turn. Retries with the same id never create a second user message or harness execution.

## Response `202`

- SendMessageAcceptedResponse: Acknowledgement that a durable, server-owned turn has started. Live token, tool, permission, error, and completion events are delivered exclusively by the conversation WebSocket.
  - `status` string, required
  - `turn_id` string, required
  - `turn_started_at` string, required: Server timestamp used by every observer to render one continuous elapsed-time counter across refreshes and reconnects.

## Other responses

- `401`
- `403`
- `404`
- `409`

## Changes

- **2026-10-23** `7d41b820a372`: 1 info
  - added the new optional request property `ai_provider`
- **2026-10-23** `24af93ff5379`: 1 warning
  - removed the request property `ai_provider`
- **2026-10-22** `842d42ed4659`: 1 info
  - added the new optional request property `ai_provider`
- **2026-10-22** `1a12a50b75ee`: 1 warning
  - removed the request property `ai_provider`
- **2026-10-21** `e7e860416364`: 1 info
  - added the new optional request property `ai_provider`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ai/conversations/:public_id/messages/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
