AI Chat

Submit a user message and start a server-owned turn. The command returns as soon as the turn is durable; subscribe to the conversation WebSocket for real-time output.

Changed on
post/projects/{project_id}/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)
  • Auth
    HTTP bearer

Path parameters

project_idinteger required
public_idstring required

Request body

ai_modelstring nullable

Optional next-turn model, one advertised by the conversation's provider (or by ai_provider when that is set).

ai_permission_modestring nullable

Optional next-turn permission mode for the pinned provider harness.

ai_providerstring 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_levelstring nullable

Optional next-turn thinking level.

contentstring required
page_contextstring 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_idstring nullable

Client-generated opaque idempotency key for this turn. Retries with the same id never create a second user message or harness execution.

Response

Turn accepted; output follows on the conversation WebSocket

statusstring required
turn_idstring required
turn_started_atstring required

Server timestamp used by every observer to render one continuous elapsed-time counter across refreshes and reconnects.

Changes