显式缓存 复用缓存(第二轮) 系统提示、合同全文与断点位置保持不变,只替换末尾的提问: plaintext curl X POST H "xapikey: ${YOURAPPKEY}" H "ContentType: application/json" d '{ "model": "qwen3.7max", "maxtokens": 1024, "system": [ { "type": "text", "text": "你是一名严谨的合同审阅助手,需要逐条指出风险条款并给出修改建议。", "cachecontrol": { "type": "ephemeral", "ttl": "5m" } } ], "messages": [ { "role": "user", "content": [ { "type": "text", "text": " ", "cachecontrol": { "type": "ephemeral", "ttl": "5m" } }, { "type": "text", "text": "如果对方要求预付 60%,应如何调整条款?" } ] } ] }' plaintext "usage": { "inputtokens": 24, "outputtokens": 301, "cachecreationinputtokens": 0, "cachereadinputtokens": 9860 } cachereadinputtokens 大于 0、cachecreationinputtokens 为 0,说明缓存命中且本次没有重复写入。 多断点:工具定义 + 系统提示 + 长文档 plaintext { "model": "qwen3.7max", "maxtokens": 1024, "tools": [ { "name": "queryorder", "description": "按订单号查询物流状态", "inputschema": { "type": "object", "properties": { "orderno": { "type": "string" } }, "required": ["orderno"] }, "cachecontrol": { "type": "ephemeral" } } ], "system": [ { "type": "text", "text": " ", "cachecontrol": { "type": "ephemeral" } } ], "messages": [ { "role": "user", "content": [ { "type": "text", "text": " ", "cachecontrol": { "type": "ephemeral" } }, { "type": "text", "text": "退款到账一般需要多久?" } ] } ] } 此处断点可分层命中:工具定义极少变动时始终命中;话术规范按天更新时仅重写系统层;手册若按版本替换,只影响文档层之后的内容。
来自: