Pular para o conteúdo principal
POST
Compact response
Guia relacionado: compactação de contexto. Consulte Compactação de contexto para limites, compactação automática e o item a partir do qual continuar.

Autorizações

Authorization
string
header
obrigatório

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

Corpo

application/json
input

Input to compact: a string or an array of input items (messages, files, etc.).

instructions
string

Custom instructions for the compaction summarization.

model
string

The model to use for compaction in provider/model format (e.g. openai/gpt-4o). Required.

previous_response_id
string

The ID of a stored response whose conversation is compacted; input is appended after it.

prompt_cache_key
string

Key for prompt caching across requests.

Resposta

Compaction completed successfully.

created_at
integer<int64>
obrigatório

Unix timestamp (seconds) when the response was created.

id
string
obrigatório

The ID of the compaction response.

object
enum<string>
obrigatório

Always "response.compaction".

Opções disponíveis:
response.compaction
output
any[] | null
obrigatório

The next context window: a compaction item summarizing older items, followed by the most recent items verbatim. Pass it as the input of the next request, without previous_response_id.

usage
object
obrigatório

Token usage information for the compaction request.