Compacts a full Responses API input window into a shorter canonical window.
The client sends its current input (the same items that would be passed to POST /v1/responses) and receives a compacted output window. The output should be used verbatim as the input of the next /v1/responses call (appending only the new user turn).
This generalizes the compaction approach used by the coding-agent harness (generate_session_compact in xai-grok-shell):
- Strip tool-result noise from the history.
- Ask the model to produce a structured <summary> of the conversation.
- Rebuild a compact window: system message → summary → last user query.
- Return that window to the client.
Request body
Response
Success – compacted window returned.
Changes
Changed in 1 of the 9 revisions of this API.11
- ▲
added
subschema #11subschema #12to theoutput/items/oneOf[subschema #2]/allOf[ModelOutput]/response propertyoneOflist for the response status200response-property-one-of-added
- ○
added
subschema #11subschema #12to theinput/oneOf[subschema #2]/items/oneOf[subschema #2]/allOf[ModelOutput]/request propertyoneOflistrequest-property-one-of-added
- ▲