---
title: "Run one Personal-Agent chat turn with deterministic L0-L4 context stacking"
method: POST
path: "/api/personal-agent/chat"
tags: ["Personal Agent"]
---

# Run one Personal-Agent chat turn with deterministic L0-L4 context stacking

`POST /api/personal-agent/chat`

## Request

- Base URL: `https://api.cernion.de`
- URL: `https://api.cernion.de/api/personal-agent/chat`
- Auth: none declared

Builds a deterministic context stack (L0-L4), binds the capability-broker routing layer, supports auto-execution or HITL plan return, and guarantees Layer 4 purge after synthesis. Layer-4 raw tool JSON is never persisted.

## Query parameters

- `token` string

## Request body

- object
  - `message` string, required
  - `sessionId` string
  - `executionMode` 'auto' | 'hitl'
  - `chatMode` 'execution' | 'consultation': Optional explicit chat mode. If set, it overrides auto detection for this turn.
  - `forceReceipt` string: Optional receipt id to force. Invalid or policy-forbidden ids fail with 422.
  - `preferredReceipts` string[]: Optional ordered list of preferred runtime receipt ids.
  - `allowDraftReceipts` boolean: When true, draft receipts can be selected in controlled testing.
  - `explainReceiptSelection` boolean: When true, includes receipt-selection diagnostics in metadata.receiptSelection.
  - `disableReceiptSelection` boolean: When true, bypasses runtime receipt selection and enforces legacy routing behavior.
  - `toolContext` object
  - `knownContext` object
  - `fileAttachments` object[]
    - `attachmentId` string
    - `fileName` string
    - `mimeType` string
    - `sizeBytes` number
    - `tempPath` string
  - `token` string: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.

## Response `200`

Chat turn completed (internal Moleculer calls only; REST gateway calls receive 202 Accepted)

## Other responses

- `202`: Accepted - Chat turn submitted as async job. Poll /api/jobs/:jobId/status for progress. (REST gateway only; internal Moleculer calls receive 200.)
- `400`: Bad request - invalid parameters or validation error
- `404`: Service or action not found
- `500`: Internal server error

---

[API](https://skmtc.dev/cernion/apis/cernion-energy-tools-api.md) · [All operations](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/revisions/cdb94473b538?raw)
