Skip to main content
GET
JavaScript
An objective starts with one context window. When it fills past the compaction threshold, Cadenya opens a fresh one and carries a summary forward. This endpoint is the record of that: what each window cost, and what survived the handoff. It is also the only token history that outlives the objective.
Windows come back newest first, and the endpoint returns at most the last five. A long objective that compacted a dozen times has lost the early ones.

Reading a compaction

That output is a real compaction, and it tells the whole story. Window 1 grew to 8,718 prompt tokens. It crossed the threshold, so Cadenya summarized it, opened window 2, and window 2 restarted at 3,345 prompt tokens. The summary itself is on the new window, as previousWindowContinueInstructions:
The first window’s previousWindowContinueInstructions is empty, because nothing preceded it. That is how you tell the original window from a compacted one: sequence: 1 with no instructions. Read the summary when an agent seems to forget something mid-objective. Compaction is lossy by design, and this field is exactly what it chose to keep. If the thing the agent lost is missing here, tune summarization.instructions on the variation.

Use it for the post-mortem

Objective diagnostics gives a much richer breakdown, per component, but only while the objective is live. Every terminal objective reports zeros there. Context windows persist. The same STATE_TIMED_OUT objective that reports inputTokens: 0 from diagnostics still reports promptTokens: 34653 here.
totalContextWindows counts every window, including any the five-window cap has aged out of this list.

What each window carries

Sum promptTokens and completionTokens across windows and multiply by the model’s inputPricePerMillionTokens and outputPricePerMillionTokens to price a run. That is the closest thing to a per-objective invoice the API offers.
Compaction itself costs a model call: the summarizer runs on the variation’s own model, and its usage is recorded as an iteration. A window’s promptTokens is what the agent spent, not what compaction spent producing the summary that opened it.

Get objective diagnostics

The live, component-by-component breakdown of the current window.

Create a variation

triggerThreshold, summarization instructions, and tool result clearing.

Compaction

Why an objective compacts instead of failing.

List models

The per-million-token prices you need to turn tokens into dollars.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceId
string
required
Example:

"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"

objectiveId
string
required

The objective ID to return windows for

Example:

"obj_01HXKD2E5NQM3T9AYWCFQAZGFV"

Query Parameters

limit
integer<int32>

Maximum number of results to return

cursor
string

Pagination cursor from previous response

includeInfo
boolean

When set to true you may use more of your alloted API rate-limit

labels
string

Filters by metadata labels. Comma-separated key=value pairs, e.g. "env=prod,team=ai". A resource matches only if every pair matches exactly (AND semantics).

Response

OK

ListObjectiveContextWindowsResponse is the response to a ListObjectiveContextWindowsRequest

items
object[]
pagination
object

Page carries cursor-based pagination state. There is no total: the cursor walks the result set without ever counting it, and a count would cost a second query on every list.