responses

Compact a context window via the provider's standalone compact endpoint.

Stateless passthrough: forwards model + input (and any other fields the provider accepts) to the upstream /responses/compact endpoint and streams the compacted window back. Only OpenAI and Azure OpenAI implement this; routing to any other provider returns 501 with error_code = "not_supported".

post/api/v1/responses/compact

Request

  • Base URL: / (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/v1/responses/compact
  • Auth: HTTP bearer

Request body

inputobject

Conversation history to compact. Accepts a plain string or the typed item array used by POST /responses.

instructionsstring nullable

System instructions threaded into the compaction prompt.

modelstring required

Model to compact with. Required by OpenAI; Hadrian also accepts it as the routing key when the gateway picks an upstream provider.

modelsstring[] nullable

Hadrian Extension: alternate model list for multi-model routing. The first entry the gateway resolves successfully wins.

previous_response_idstring nullable

Continue compacting from a previously persisted response. Spec: CompactResponseMethodPublicBody.previous_response_id.

prompt_cache_keystring nullable

OpenAI prompt-cache key passthrough.

streamboolean

Hadrian Extension: stream the compacted response as SSE. Forwarded verbatim to the upstream provider when supported.

Response

Compacted context window

Changes

No recorded changes to this operation across all 1 revision of this API.