{"article":{"title":"Call Traces","breadcrumb":["Operations","Call Traces"],"body":"**What this solves**: Explain exactly whether Tare records your call content, how it's set by default, where data lives once it's on, and who can see it.\n\nCall Traces answers \"what happened in this call\": model, tokens, cost, routing attempts, failure reason.\nWhether the request body and the model's response are stored too is up to your retention switch.\n\n### First, separate two things: usage and call content\n\n- **Usage records**: token counts, spend, which route was actually used. They are **always recorded** and are the basis for your statement.\n- **Call content**: the text sent to the model and the model's response. It is **not stored at all by default**.\n\nThe two are independent. Turning off content retention doesn't affect using Call Traces to see cost, tokens, routing, and error reasons.\n\nPer-attempt upstream detail (the request sent to the upstream and its response body) is recorded only for calls that go through your own channels. Calls answered by a [Mock](mock) are marked as simulated and are not counted as failures.\n\n### Node mode does not record request content\n\nCalls on a customer Local Node never pass through Tare, so the content is not there to store. Call Traces record token input and output, plus the fields audit and reconciliation need: model, cost, failure kind, attempts, and DLP alerts. They do not record the request body or the model's answer.\n\nThe retention switch above applies only to calls on the Tare server path. Turning it on does not backfill bodies from the node.\n\n### Default behavior: no storage\n\nA new account doesn't need to do anything. The switch in the console under **Call Traces** is off by default.\n\nIn that state, the `request_content` / `response_content` columns in the list are empty. Note this means **never stored**,\nnot \"stored but hidden from you\".\n\n> [!NOTE]\n> If you're worried about \"request bodies carrying customer code and business data\", then under the default configuration, that content is not stored by the platform.\n\n### When to turn on content retention\n\n- You want to troubleshoot the quality of a model's answers, or what upstream actually returned.\n- You want to review failed requests over a period of time.\n\nIf you only want to see cost, tokens, routing, and error reasons, you don't need to turn it on.\n\n### Once on, this is how content is kept\n\n| | |\n|---|---|\n| Retention count | Keeps the **most recent 1,000 calls** by default, configurable **1–100,000** |\n| Encryption | **AES-256-GCM**, with keys held by the platform, stored separately from channel credentials |\n| Storage region | **Singapore** |\n| Access | The account owner can view at any time; **the platform cannot read it without authorization** |\n| Expiry handling | Cleaned once every day in the early morning; content beyond the retention count is erased oldest-first (usage rows are kept, only the two content columns are cleared) |\n\nContent keys and channel credentials are kept separately because the two rotate on different schedules: a leaked credential needs an immediate\nchange, whereas once a content key rotates, the historical records all have to be re-encrypted.\n\n> [!WARNING]\n> **Encryption doesn't mean the platform can't read it.** The keys are kept on platform servers, so \"the platform can't read it\" is a **policy\n> constraint** (enforced through authorization and audit, see below), not a physical one.\n\n![Once retention is on, how content is kept](diagram:en-content-retention-storage)\n\n### For the platform to see content, you must grant time-limited authorization\n\nWhen troubleshooting, the platform may need to read the content of certain calls. There's only one path: **the account owner grants\na time-limited authorization in the console**.\n\n- A grant requires a reason, which stays on record with it.\n- Authorization duration is **1 hour to 30 days**, and **there's no \"permanent\" option**. The reason is that an authorization with no time limit would stay\n  valid long after the troubleshooting is done.\n- Every read during the authorization period is audited and can be viewed on the Audit page.\n- You can revoke it early at any time; expired ones lapse automatically and need no handling.\n- Without authorization, what the platform reads is `<withheld: customer has not granted access>`, not the content.\n\n![For the platform to see content, the account owner must grant time-limited authorization](diagram:en-content-retention-grant)\n\n> [!NOTE]\n> **The Audit page is a general ledger for the whole account, not just content authorizations.** Price changes, routing changes, billing-method changes,\n> key limit changes, and credential changes — all these kinds of changes on the account are recorded here, and each one is marked as either made by you or\n> made by the platform on your behalf. It answers the bigger question \"can things on my account be changed or viewed without my knowledge\", not just\n> the content authorization above. `GET /v1/audit/events` reads this ledger back, and\n> `GET /v1/audit/events/export` exports the same data. See [Audit Trail](audit-trail) for details.\n\nChanges to a key's own governance settings go through the same record: cumulative limit, source IP allowlist and its switch, DLP settings,\nthe bound Router, expiry time, name, and disabling. These are exactly the things an attacker would change first after getting hold of a key.\nIf the change was made with an API key (rather than a login session), the record states which key made it.\n\nTurning a drill (mock) on or off for a key also leaves traces. If production traffic quietly starts returning fake data, someone\nwill eventually ask you to explain what happened during that period.\n\n`GET /v1/audit/events` can also answer narrower questions than \"show me everything\": pass `group=security`, `dlp`,\n`access`, `config`, or `staff` to see only that category; pass `view=summary&days=30` to skip the individual records and\nget a **security report** instead: a day-by-day summary within the given window, showing which entity types were hit, which keys they came from,\nand which source addresses were rejected.\n\nThe \"Export\" button on the Audit page **only exports the current page (50 rows)**. To export the full range, you have to call\n`GET /v1/audit/events/export` yourself; you can't rely on clicking in the console.\n\n### Turning retention off\n\nYou can turn it off at any time. After that, new calls no longer write content; **content already stored is not deleted immediately**, only\nerased on the next cleanup, down to the retention count that was set at the time.\n\nTo clear immediately, change the retention count to **1**; after the next cleanup, only the most recent call's content remains.\n\n### API\n\nThe switches in the console all have corresponding APIs:\n\n```bash\n# Current settings + authorization status\ncurl https://tare.jamerly.ai/v1/content-settings \\\n  -H \"Authorization: Bearer $TARE_API_KEY\"\n\n# Turn on saving, keeping only the most recent 100 calls\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# Authorize the platform to view for 24 hours\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\": \"troubleshooting 502\"}'\n```\n\n> [!WARNING]\n> `productLine` **can only go on the GET query**, and write operations always go in the request body: the front gateway drops\n> the query string on POST/PUT, and parameters written in the query don't error, they just don't take effect.\n\n### Next steps\n\n- To learn about change records and content authorization records on the account: read [Audit Trail](audit-trail).\n- To tell which category a failure falls into: read [Error codes](errors).\n- To learn how the retention switch affects embedding calls: read [Endpoints](endpoints).\n"},"diagrams":{"en-content-retention-storage":"<svg viewBox=\"0 0 700 430\" width=\"700\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>Once retention is on, how content is kept</title>\n  <desc>Once retention is on, content is stored with the call, encrypted with AES-256-GCM, kept in Singapore, defaulting to the latest 1,000 calls. A daily cleanup clears the oldest content columns and keeps the usage row.</desc>\n  <style>\n    text { font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }\n  </style>\n  <defs>\n    <marker id=\"arrow\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#64748b\"/>\n    </marker>\n  </defs>\n\n  <!-- 浅色画布 -->\n  <rect x=\"0\" y=\"0\" width=\"700\" height=\"430\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术：\n       四段时间全宽横条，22..678（宽 656），高 54（12px + 10px），\n       顶边 60 / 142 / 224 / 306，底边 114 / 196 / 278 / 360，段间 28。\n       三段连线全竖直落在内容中心 350，起点 = 上条底边 + 5，终点 = 下条顶边 - 11。\n       时间轴竖着走：这四段上不可互换（写入 → 加密 → 留存窗口 → 清理）。\n       内容左右边界 22..678，中心 350；viewBox 宽 = 656 + 两侧各 22 = 700。\n       高度 = 脚注末行基线 405 + 下伸 2.5 + 22px 边距 = 429.5，取整 430。 -->\n\n  <text x=\"350\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">Once retention is on, how content is kept</text>\n\n  <path d=\"M350,119 L 350,131\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow)\"/>\n  <path d=\"M350,201 L 350,213\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow)\"/>\n  <path d=\"M350,283 L 350,295\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow)\"/>\n\n  <rect x=\"22\" y=\"60\" width=\"656\" height=\"54\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"350\" y=\"82\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">1. Retention on: content is encrypted and stored</text>\n  <text x=\"350\" y=\"100\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">Usage rows always exist. Content is stored only after you turn the switch on.</text>\n\n  <rect x=\"22\" y=\"142\" width=\"656\" height=\"54\" rx=\"6\" fill=\"#fef3c7\" stroke=\"#f59e0b\"/>\n  <text x=\"350\" y=\"164\" font-size=\"12\" fill=\"#b45309\" text-anchor=\"middle\">2. AES-256-GCM. The platform holds the content key</text>\n  <text x=\"350\" y=\"182\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">Stored apart from channel credentials. Rotate a leaked credential. A new content key re-encrypts the table.</text>\n\n  <rect x=\"22\" y=\"224\" width=\"656\" height=\"54\" rx=\"6\" fill=\"#d1fae5\" stroke=\"#22c55e\"/>\n  <text x=\"350\" y=\"246\" font-size=\"12\" fill=\"#166534\" text-anchor=\"middle\">3. Latest 1,000 calls by default, range 1 to 100,000</text>\n  <text x=\"350\" y=\"264\" font-size=\"10\" fill=\"#166534\" text-anchor=\"middle\">Stored in Singapore. The owner can read it. The platform cannot, without a grant.</text>\n\n  <rect x=\"22\" y=\"306\" width=\"656\" height=\"54\" rx=\"6\" fill=\"#fce7f3\" stroke=\"#ec4899\"/>\n  <text x=\"350\" y=\"328\" font-size=\"12\" fill=\"#9d174d\" text-anchor=\"middle\">4. Cleaned once a day, early morning</text>\n  <text x=\"350\" y=\"346\" font-size=\"10\" fill=\"#9d174d\" text-anchor=\"middle\">Past the cap, oldest content is cleared. The usage row stays.</text>\n\n  <!-- 脚注 -->\n  <text x=\"350\" y=\"390\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Platform cannot read is a policy, grant plus audit, not a physical limit. The key is on the platform.</text>\n  <text x=\"350\" y=\"405\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Turning it off does not delete old content now. Cap 1 waits for the next cleanup. The latest content stays.</text>\n</svg>\n","en-content-retention-grant":"<svg viewBox=\"0 0 712 268\" width=\"712\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>Platform reads content only under a timed grant</title>\n  <desc>The platform reads withheld until the account owner grants access for 1 hour to 30 days. There is no permanent option. Every read is audited. Expiry or revoke returns to not granted, and the grant can be given again.</desc>\n  <style>\n    text { font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }\n  </style>\n  <defs>\n    <marker id=\"arrow\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#64748b\"/>\n    </marker>\n  </defs>\n\n  <!-- 浅色画布 -->\n  <rect x=\"0\" y=\"0\" width=\"712\" height=\"268\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术：\n       只有两个权限状态并排一行——同一行里的两个框必须挨着 25–30px，所以两框等宽 320、间距 28，\n       于是 22..342 / 370..690，框高一律 72（12px + 两行 10px），顶边 60、底边 132。\n       去程边落在 28px 的通道里：起点 = 左框右边 + 5，终点 = 右框左边 - 11，留 12px 可见线。\n       回程边走下方：从右框底边 + 5 出发，一条 C 曲线兜到左框底下，终点 = 左框底边 + 11，\n       箭头朝上落回左框底边。曲线最低点约 177.5，与框底 132 之间有 45px 净空。\n       内容左右边界 22..690，中心 356；viewBox 宽 = 668 + 两侧各 22 = 712。\n       高度 = 脚注末行基线 243 + 下伸 2.5 + 22px 边距 = 267.5，取整 268。 -->\n\n  <text x=\"356\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">Platform reads content only under a timed grant</text>\n\n  <!-- 第 1 层：连线 -->\n  <path d=\"M347,96 L 359,96\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow)\"/>\n  <path d=\"M530,137 C 530,190 182,190 182,143\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" stroke-dasharray=\"6,4\" marker-end=\"url(#arrow)\"/>\n\n  <!-- 边上的标签压在两框之间的空档上方，避让所有方框（上方留白 22px，两侧不压框）。 -->\n  <text x=\"356\" y=\"52\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Grant: 1 hour to 30 days</text>\n  <text x=\"356\" y=\"200\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Expires on its own, or you revoke it</text>\n\n  <!-- 第 2 层：两个权限状态。蓝＝平台读不到内容，橙＝平台读得到（全图唯一的强调色）。 -->\n  <rect x=\"22\" y=\"60\" width=\"320\" height=\"72\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"182\" y=\"83\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">Not granted</text>\n  <text x=\"182\" y=\"101\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">Platform reads &lt;withheld&gt;</text>\n  <text x=\"182\" y=\"116\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">Not the content itself</text>\n\n  <rect x=\"370\" y=\"60\" width=\"320\" height=\"72\" rx=\"6\" fill=\"#fef3c7\" stroke=\"#f59e0b\"/>\n  <text x=\"530\" y=\"83\" font-size=\"12\" fill=\"#b45309\" text-anchor=\"middle\">Grant active</text>\n  <text x=\"530\" y=\"101\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">1 hour to 30 days</text>\n  <text x=\"530\" y=\"116\" font-size=\"10\" fill=\"#b45309\" text-anchor=\"middle\">Every read is audited</text>\n\n  <!-- 脚注 -->\n  <text x=\"356\" y=\"228\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">The owner grants it in the console, for 1 hour to 30 days. No permanent option.</text>\n  <text x=\"356\" y=\"243\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Each read is on the Audit page. Revoke or expiry returns to not granted. You can grant again.</text>\n</svg>\n"}}