Sessions

Compact a session's context

Changed on

Requires run. Summarizes the conversation so far to free context for the turns after it. The response's outcome says whether it was queued, applied, or not needed.

<sub>Scope: run</sub>

post/v3/organizations/{orgId}/sessions/{sessionId}/compact

Request

  • Base URL
    https://api.reasonmachines.com
  • URL
    https://api.reasonmachines.com/v3/organizations/{orgId}/sessions/{sessionId}/compact
  • Auth
    HTTP bearer

Response

What the request did.

oktrue required

Always true on success.

outcome'requested' | 'queued' | 'started' | 'already_compacted' | 'credit_exhausted' required

What the request did: requested (the running turn compacts at its next step), queued (the queued turn compacts when it starts), started (a compaction now runs for the finished Session, or one already was), already_compacted (nothing new to compact, or the next turn starts compact), credit_exhausted (no usage left to compact).

status'requested'

Present when a running or queued turn was asked to compact (outcome requested or queued).

detailstring

Why, when the outcome is not plain: in_progress for a compaction already running, a reason for already_compacted (for example byok_no_model_call) or for credit_exhausted.

Changes