v1

latestOpenAPI 3.1.0Apache 2.02026-07-264001921002.3 KB
OpenAI Integration

Compact context (OpenAI)

Compresses a conversation into an opaque compaction item using the OpenAI-compatible /v1/responses/compact endpoint. Drop-in compatible with the OpenAI SDK.

The response output contains the user messages plus a final item with type: "response.compaction" and encrypted_content. Pass this output as input to future Responses API calls to continue the conversation using the compacted context.

Note: This endpoint also works without the /v1 prefix (e.g., /openai/responses/compact).

post/openai/v1/responses/compact

Request body

modelstring required

Model identifier (e.g., "gpt-4o"). When routing through Bifrost's provider-prefixed path, use "provider/model" format.

instructionsstring

System instructions that persist across the compacted context.

previous_response_idstring

ID of a previous response to extend rather than sending full input.

prompt_cache_keystring
prompt_cache_retentionstring
service_tierstring
fallbacksstring[]

Bifrost-specific — fallback model list in provider/model format.

Response

Successful compaction response

idstring
objectstring

Always "response.compaction"

modelstring
created_atinteger

Example response

{
  "object": "response.compaction"
}