{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"这篇解决什么问题"}]},{"type":"text","value":"：讲清 Tare 到底记不记录你的调用内容、默认怎么设置、开启后数据存在哪、谁能看。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Call Traces 回答的是「这次调用发生了什么」：模型、token、成本、路由尝试、失败原因。\n请求正文和模型回答要不要一并存下来，由你的留存开关决定。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"先分清两样东西：用量和调用内容"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"用量记录"}]},{"type":"text","value":"：token 数、花费、实际用了哪条路由。它"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"始终记录"}]},{"type":"text","value":"，是账单的依据。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"调用内容"}]},{"type":"text","value":"：发送给模型的原文和模型的回答。它"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"默认完全不存储"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"这两者互相独立。关掉内容留存，不影响你用 Call Traces 看成本、token、路由和错误原因。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"每次尝试的上游细节（发给上游的请求和它的响应体）只对走你自己渠道的调用记录。由 "},{"type":"element","tagName":"a","properties":{"href":"mock"},"children":[{"type":"text","value":"Mock"}]},{"type":"text","value":" 应答的调用会标成模拟，不计为失败。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"节点模式不记请求内容"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"客户自建节点上的调用，内容不经过 Tare。Call Traces 只记 token 的 input / output，以及审计、对账要的字段：模型、费用、失败类型、尝试次数、DLP 告警。不记请求正文，也不记模型回答。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"上面的留存开关只管走 Tare 服务端的调用。打开开关，也不会把节点上的正文补回来。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"默认行为：不存储"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"新账号不需要做任何操作。控制台 → "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Call Traces"}]},{"type":"text","value":" 里的开关默认关闭。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"此时列表里的 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"request_content"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"response_content"}]},{"type":"text","value":" 两列为空。注意这表示"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"从未存储过"}]},{"type":"text","value":"，\n而不是「存了但不给你看」。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"note"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"如果你担心「请求体里带着客户代码和业务数据」，那么默认配置下，这些内容不会被平台存下来。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"什么时候该打开内容留存"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"你要排查模型回答的质量，或上游实际返回了什么。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"你要在一段时间内复盘失败的请求。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"如果你只想看成本、token、路由和错误原因，不需要打开。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"开启后，内容是这样被保管的"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"留存条数"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"默认保留"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"最近 1,000 次调用"}]},{"type":"text","value":"，可配置 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"1–100,000"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"加密方式"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"AES-256-GCM"}]},{"type":"text","value":"，密钥由平台保管，与渠道凭据分开存放"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"存储地域"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"新加坡"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"访问权限"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"账号所有者随时可查；"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"未经授权平台不可读取"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"过期处理"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"每天凌晨清理一次，超出留存条数之外的内容按从旧到新被抹除（用量行保留，仅内容两列置空）"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"内容密钥和渠道凭据分开保管，原因是两者的轮换节奏不同：凭据泄漏需要立即更换，而内容密钥\n一旦轮换，历史记录就得整表重新加密。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"warning"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"加密不等于平台读不到。"}]},{"type":"text","value":" 密钥保存在平台服务器上，「平台不可读」是一条"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"制度约束"}]},{"type":"text","value":"\n（靠授权和审计实现，见下），不是物理约束。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"img","properties":{"src":"diagram:content-retention-storage","alt":"打开留存之后，内容是怎么被保管的","data-block":"true"},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"平台要看内容，必须由你限时授权"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"排查问题时，平台可能需要读取某几次调用的内容。路径只有一条："},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"由账号所有者在控制台\n授予一段限时授权"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"授权必须填写理由，理由随授权一起留档。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"授权时长 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"1 小时至 30 天"}]},{"type":"text","value":"，"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"不提供「永久」选项"}]},{"type":"text","value":"。理由是无时限的授权会在排查结束后\n一直有效。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"授权期内每次读取都会记录审计，可在 Audit 页查看。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"你可以随时提前收回；到期的会自动失效，不用处理。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"未授权时，平台读到的是 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"<withheld: customer has not granted access>"}]},{"type":"text","value":"，而不是内容。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"img","properties":{"src":"diagram:content-retention-grant","alt":"平台要看内容，必须由账号所有者限时授权","data-block":"true"},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"note"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Audit 页是整个账号的通用流水账，不只是记内容授权。"}]},{"type":"text","value":" 价格改动、路由改动、计费方式改动、\n额度上限改动、凭据改动，账号上这几类变化全部记在这里，而且每一条都标着是你自己改的还是\n平台代你改的。它回答的是「我账号上的东西会不会在我不知情的情况下被改动或被查看」这个\n更大的问题，不只是上面这条内容授权。"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/audit/events"}]},{"type":"text","value":" 读回这份流水，\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/audit/events/export"}]},{"type":"text","value":" 导出同一份数据。详见 "},{"type":"element","tagName":"a","properties":{"href":"audit-trail"},"children":[{"type":"text","value":"审计日志"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"一把 key 自己的治理设置改动也走同一套记录：累计额度、来源 IP 白名单及其开关、DLP 设置、\n绑定的 Router、到期时间、名称、停用。这些恰好是攻击者拿到一把 key 之后第一件会去改的东西。\n如果改动是用一把 API key（而不是登录会话）发起的，记录里会写明是哪把 key 改的。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"给一把 key 开关演习（mock）同样会留痕。生产流量悄悄开始返回假数据这件事，之后一定会有人\n要你解释那段时间发生了什么。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/audit/events"}]},{"type":"text","value":" 也能回答比「给我看全部」更窄的问题：传 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"group=security"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"dlp"}]},{"type":"text","value":"、\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"access"}]},{"type":"text","value":"、"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"config"}]},{"type":"text","value":" 或 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"staff"}]},{"type":"text","value":"，就只看那一类；传 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"view=summary&days=30"}]},{"type":"text","value":"，则不看逐条记录，\n换成一份"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"安全报告"}]},{"type":"text","value":"：指定时间窗口内按天的汇总、命中了哪些实体类型、来自哪些 key、\n拒绝了哪些来源地址。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Audit 页那个「导出」按钮"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"只导当前这一页（50 行）"}]},{"type":"text","value":"。要导全部范围，得自己调\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /v1/audit/events/export"}]},{"type":"text","value":"，不能靠点控制台。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"关闭留存"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"可以随时关闭。关闭后，新的调用不再写入内容；"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"已经存储的内容不会立即删除"}]},{"type":"text","value":"，只按当时\n设置的留存条数，在下次清理时抹除超出的部分。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"需要立即清空时，把留存条数改成 "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"1"}]},{"type":"text","value":"，下次清理后，就只剩最近一次调用的内容。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"接口"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"控制台上的开关都有对应接口："}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"text","value":"# 当前设置 + 授权状态\ncurl https://tare.jamerly.ai/v1/content-settings \\\n  -H \"Authorization: Bearer $TARE_API_KEY\"\n\n# 打开保存，只留最近 100 次调用\ncurl -X PUT https://tare.jamerly.ai/v1/content-settings \\\n  -H \"Authorization: Bearer $TARE_API_KEY\" -H \"Content-Type: application/json\" \\\n  -d '{\"enabled\": true, \"retentionCount\": 100}'\n\n# 授权平台查看 24 小时\ncurl -X POST https://tare.jamerly.ai/v1/content-settings/grants \\\n  -H \"Authorization: Bearer $TARE_API_KEY\" -H \"Content-Type: application/json\" \\\n  -d '{\"hours\": 24, \"reason\": \"排查 502\"}'\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"warning"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"productLine"}]},{"type":"text","value":" "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"只能放在 GET 的 query 上"}]},{"type":"text","value":"，写操作一律放在请求体里：前置网关会丢弃\nPOST/PUT 的 query string，写在 query 上的参数不报错，只是不生效。"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"下一步"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"想了解账号上的改动记录和内容授权记录：读 "},{"type":"element","tagName":"a","properties":{"href":"audit-trail"},"children":[{"type":"text","value":"审计日志"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"想区分失败到底属于哪一类：读 "},{"type":"element","tagName":"a","properties":{"href":"errors"},"children":[{"type":"text","value":"错误码"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"想知道留存开关对向量化调用的影响：读 "},{"type":"element","tagName":"a","properties":{"href":"endpoints"},"children":[{"type":"text","value":"接口列表"}]},{"type":"text","value":"。"}]},{"type":"text","value":"\n"}]}]}