Skip to main content

gpt 上下文压缩

POST /v1/responses/compact 压缩 GPT 对话上下文,减少后续请求的 token 占用。

请求体参数 (Body)

array
required
需要压缩的历史消息列表
string
required
模型名称,例如 gpt-5-codex

请求示例 (JSON)

请求示例 (cURL)

响应示例 (200 OK)


创建函数调用 Copy

POST /v1/responses https://platform.openai.com/docs/api-reference/responses/create 部分OpenAI模型仅支持Response格式,例如o3-pro,codex-mini-latest

请求参数 (Query / Path)

string
required
请求体 Content-Type,一般为 application/json
string
required
期望的响应 Content-Type
string
Bearer API Key

请求体参数 (Body)

array
输入内容
string
要使用的模型的 ID。有关哪些模型可与聊天 API 一起使用的详细信息,请参阅模型端点兼容性表。

请求示例 (JSON)

请求示例 (cURL)

响应示例 (200 OK)