Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your provider API key or Bifrost authentication token. Virtual keys (prefixed with sk-bf-) can also be passed here.

Body

application/json
model
string
required

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

input

Conversation to compact. Required unless previous_response_id is set. Compaction items (type "response.compaction") from prior responses may be included.

instructions
string

System instructions that persist across the compacted context.

previous_response_id
string

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

prompt_cache_key
string
prompt_cache_retention
string
service_tier
string
fallbacks
string[]

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

Response

Successful compaction response

id
string
object
string

Always "response.compaction"

Example:

"response.compaction"

model
string
created_at
integer
output
object[]

The compacted output — the original user messages plus a final item of type "response.compaction" whose encrypted_content holds the opaque compacted state. Pass the full output array as input to a future Responses API request.

usage
object
extra_fields
object

Additional fields included in responses