Home / Servers / OpenAI API / beta_compactconversation

Compact conversation

An MCP tool from the OpenAI API server, hosted on mcp.hjlabs.in.

Compact conversation Compact a conversation. Returns a compacted response object. Learn when and how to compact long-running conversations in the conversation state guide. For ZDR-compatible compaction details, see… [POST /responses/compact?beta=true]

Name on the gateway: openai_api__beta_compactconversation · may change things.

Parameters

NameTypeDescription
model requiredstringModel ID used to generate the response, like gpt-6-astra. OpenAI offers a wide…
inputstringText, image, or file inputs to the model, used to generate a response
previous_response_idstringThe unique ID of the previous response to the model. Use this to create…
instructionsstringA system (or developer) message inserted into the model's context. When used…
imageobjectRequest level image options.
prompt_cache_keystringA key to use when reading from or writing to the prompt cache.
prompt_cache_retentionin_memory | 24hHow long to retain a prompt cache entry created by this request.
prompt_cache_optionsobjectOptions for prompt caching. Supported for gpt-5.6 and later models. By…
service_tierauto | default | fast | flex | prioritySpecifies the processing type used for serving the request. - If set to…

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "openai_api__beta_compactconversation",
  "arguments": {
    "model": "…"
  }
}

Or connect the OpenAI API server directly, which lists 371 tools including this one:

Run in your terminal
claude mcp add --transport http hj-openai-api https://mcp.hjlabs.in/mcp/openai-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the compact conversation tool with model set to ….

More from OpenAI API