On this page
Sommatic Docs
Open portal

Conversations Beta

Execute conversations, with or without streaming.

View as Markdown
Open in

Execute a conversation turn against a selected LLM provider.

POST /chat/conversation/execute

Executes a single conversation turn by persisting the inbound user message as an immutable ConversationRecord, invoking a concrete CognitiveInfrastructureLLMProvider (referenced by llm_provider_id), persisting the outbound assistant message as another immutable ConversationRecord, and returning the assistant output plus usage metadata. This endpoint is the runtime entry point for multi-provider chat orchestration. Governance can be enforced through the ConversationManagement container (organization boundary, allowed providers, memory strategy, etc.).

Authentication: Bearer token

Request body

Conversation execution request payload.

Responses

  • 200 OK.
  • 400 Bad request (missing required fields or invalid identifiers).
  • 403 Forbidden (provider not allowed by conversation governance or cross-organization access).
  • 500 Something went wrong while performing this action.
curl -X POST https://api.sommatic.ai/chat/conversation/execute \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response
{
  "status": 200,
  "success": true,
  "message": "Operation completed successfully",
  "result": {
    "conversation_id": "c-4c3f0f2b7a1a4f7a9a1b2c3d4e5f6a7b",
    "conversation_slug": "convo.ops.support.001",
    "llm_provider_id": "llmprov-8f3c1a2b4d5e6f",
    "llm_provider_slug": "llm.openai.gpt4_1",
    "record_user_id": "rec-usr-001",
    "record_assistant_id": "rec-asst-002",
    "output": {
      "text": "Here is a summary of the anomalies..."
    },
    "usage": {
      "input_tokens": 123,
      "output_tokens": 456,
      "total_tokens": 579,
      "latency_ms": 832
    }
  }
}

Execute a conversation turn against a selected LLM provider with SSE streaming.

POST /chat/conversation/execute/stream

Streaming variant of POST /chat/conversation/execute. Opens a persistent SSE connection and emits token chunks as they arrive from the LLM provider. The connection lifecycle:

  1. event: open — emitted immediately after context validation, before the first token. 2. event: chunk — emitted per token delta { text, index }. 3. event: done — emitted once after full response is persisted; payload is identical to the JSON response returned by the synchronous /execute endpoint.
  2. event: error — emitted on any failure; stream is then closed. The existing POST /chat/conversation/execute endpoint is unchanged. Both endpoints share the same business logic and produce the same persisted output.

Authentication: Bearer token

Request body

Conversation execution request payload (same shape as /execute).

Responses

  • 200 SSE stream (text/event-stream).
curl -X POST https://api.sommatic.ai/chat/conversation/execute/stream \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}' \
  -N
Response 200
{
  "status": 200,
  "success": true,
  "message": "Operation completed successfully",
  "result": {}
}

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs