---
title: "Advisory context-pressure signal"
method: POST
path: "/api/agent/sessions/{id}/context-pressure"
tags: ["Agent"]
---

# Advisory context-pressure signal

`POST /api/agent/sessions/{id}/context-pressure`

## Request

- Base URL: `http://localhost:38200`
- URL: `http://localhost:38200/api/agent/sessions/{id}/context-pressure`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `token`

Compares caller-estimated tokens (and optionally turn count) against a hardcoded threshold and recommends whether to checkpoint. Purely advisory — no server-side token accounting, no persisted state. A `should_checkpoint: true` response also fire-and-forget enqueues a scoped dream pass (T501).

## Path parameters

- `id` integer, required

## Request body

- object
  - `estimated_tokens` integer, required
  - `turn_count` integer

## Response `200`

Checkpoint recommendation.

- object
  - `should_checkpoint` boolean
  - `reason` string
  - `threshold` integer

## Other responses

- `400`: Request body/query failed Zod validation.
- `401`: Missing or invalid credentials.

---

[API](https://skmtc.dev/contextq/apis/contextq-api.md) · [All operations](https://skmtc.dev/contextq/apis/contextq-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contextq/apis/contextq-api/revisions/7afc44056a22?raw)
