{"id":257,"date":"2026-03-21T22:47:24","date_gmt":"2026-03-21T14:47:24","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/reference-token-use\/"},"modified":"2026-03-21T23:08:51","modified_gmt":"2026-03-21T15:08:51","slug":"reference-token-use","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/reference-token-use\/","title":{"rendered":"Token \u4f7f\u7528\u4e0e\u6210\u672c"},"content":{"rendered":"<h1>Token \u4f7f\u7528\u4e0e\u6210\u672c<\/h1>\n<p>OpenClaw \u8ddf\u8e2a\u7684\u662f <strong>token<\/strong>\uff0c\u800c\u4e0d\u662f\u5b57\u7b26\u3002Token \u662f\u6a21\u578b\u7279\u5b9a\u7684\uff0c\u4f46\u5927\u591a\u6570<br \/>\nOpenAI \u98ce\u683c\u7684\u6a21\u578b\u5bf9\u4e8e\u82f1\u6587\u6587\u672c\u5e73\u5747\u7ea6 4 \u4e2a\u5b57\u7b26\u4e3a\u4e00\u4e2a token\u3002<\/p>\n<h2>\u7cfb\u7edf\u63d0\u793a\u8bcd\u5982\u4f55\u6784\u5efa<\/h2>\n<p>OpenClaw \u5728\u6bcf\u6b21\u8fd0\u884c\u65f6\u7ec4\u88c5\u81ea\u5df1\u7684\u7cfb\u7edf\u63d0\u793a\u8bcd\u3002\u5b83\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u5de5\u5177\u5217\u8868 + \u7b80\u77ed\u63cf\u8ff0<\/li>\n<li>Skills \u5217\u8868\uff08\u4ec5\u5143\u6570\u636e\uff1b\u6307\u4ee4\u901a\u8fc7 <code>read<\/code> \u6309\u9700\u52a0\u8f7d\uff09<\/li>\n<li>\u81ea\u6211\u66f4\u65b0\u6307\u4ee4<\/li>\n<li>\u5de5\u4f5c\u533a + \u5f15\u5bfc\u6587\u4ef6\uff08<code>AGENTS.md<\/code>\u3001<code>SOUL.md<\/code>\u3001<code>TOOLS.md<\/code>\u3001<code>IDENTITY.md<\/code>\u3001<code>USER.md<\/code>\u3001<code>HEARTBEAT.md<\/code>\u3001<code>BOOTSTRAP.md<\/code>\uff08\u65b0\u5efa\u65f6\uff09\uff09\u3002\u5927\u6587\u4ef6\u4f1a\u88ab <code>agents.defaults.bootstrapMaxChars<\/code>\uff08\u9ed8\u8ba4\uff1a20000\uff09\u622a\u65ad\u3002<\/li>\n<li>\u65f6\u95f4\uff08UTC + \u7528\u6237\u65f6\u533a\uff09<\/li>\n<li>\u56de\u590d\u6807\u7b7e + \u5fc3\u8df3\u884c\u4e3a<\/li>\n<li>\u8fd0\u884c\u65f6\u5143\u6570\u636e\uff08\u4e3b\u673a\/\u64cd\u4f5c\u7cfb\u7edf\/\u6a21\u578b\/\u601d\u8003\uff09<\/li>\n<\/ul>\n<p>\u5b8c\u6574\u5206\u89e3\u53c2\u89c1<a href=\"\/concepts\/system-prompt\">\u7cfb\u7edf\u63d0\u793a\u8bcd<\/a>\u3002<\/p>\n<h2>\u4ec0\u4e48\u7b97\u5165\u4e0a\u4e0b\u6587\u7a97\u53e3<\/h2>\n<p>\u6a21\u578b\u63a5\u6536\u7684\u6240\u6709\u5185\u5bb9\u90fd\u8ba1\u5165\u4e0a\u4e0b\u6587\u9650\u5236\uff1a<\/p>\n<ul>\n<li>\u7cfb\u7edf\u63d0\u793a\u8bcd\uff08\u4e0a\u9762\u5217\u51fa\u7684\u6240\u6709\u90e8\u5206\uff09<\/li>\n<li>\u5bf9\u8bdd\u5386\u53f2\uff08\u7528\u6237 + \u52a9\u624b\u6d88\u606f\uff09<\/li>\n<li>\u5de5\u5177\u8c03\u7528\u548c\u5de5\u5177\u7ed3\u679c<\/li>\n<li>\u9644\u4ef6\/\u8f6c\u5f55\uff08\u56fe\u7247\u3001\u97f3\u9891\u3001\u6587\u4ef6\uff09<\/li>\n<li>\u538b\u7f29\u6458\u8981\u548c\u4fee\u526a\u4ea7\u7269<\/li>\n<li>\u63d0\u4f9b\u5546\u5305\u88c5\u6216\u5b89\u5168\u5934\uff08\u4e0d\u53ef\u89c1\uff0c\u4f46\u4ecd\u8ba1\u6570\uff09<\/li>\n<\/ul>\n<p>\u6709\u5173\u5b9e\u9645\u5206\u89e3\uff08\u6bcf\u4e2a\u6ce8\u5165\u6587\u4ef6\u3001\u5de5\u5177\u3001Skills \u548c\u7cfb\u7edf\u63d0\u793a\u8bcd\u5927\u5c0f\uff09\uff0c\u4f7f\u7528 <code>\/context list<\/code> \u6216 <code>\/context detail<\/code>\u3002\u53c2\u89c1<a href=\"\/concepts\/context\">\u4e0a\u4e0b\u6587<\/a>\u3002<\/p>\n<h2>\u5982\u4f55\u67e5\u770b\u5f53\u524d token \u4f7f\u7528\u91cf<\/h2>\n<p>\u5728\u804a\u5929\u4e2d\u4f7f\u7528\uff1a<\/p>\n<ul>\n<li><code>\/status<\/code> \u2192 \u5e26\u6709\u4f1a\u8bdd\u6a21\u578b\u3001\u4e0a\u4e0b\u6587\u4f7f\u7528\u91cf\u3001<br \/>\n  \u6700\u540e\u54cd\u5e94\u8f93\u5165\/\u8f93\u51fa token \u548c<strong>\u9884\u4f30\u6210\u672c<\/strong>\uff08\u4ec5 API \u5bc6\u94a5\uff09\u7684 <strong>emoji \u4e30\u5bcc\u7684\u72b6\u6001\u5361\u7247<\/strong>\u3002<\/li>\n<li><code>\/usage off|tokens|full<\/code> \u2192 \u5728\u6bcf\u4e2a\u56de\u590d\u540e\u9644\u52a0<strong>\u6bcf\u54cd\u5e94\u4f7f\u7528\u91cf\u9875\u811a<\/strong>\u3002<\/li>\n<li>\u6bcf\u4f1a\u8bdd\u6301\u4e45\u5316\uff08\u5b58\u50a8\u4e3a <code>responseUsage<\/code>\uff09\u3002<\/li>\n<li>OAuth \u8ba4\u8bc1<strong>\u9690\u85cf\u6210\u672c<\/strong>\uff08\u4ec5 token\uff09\u3002<\/li>\n<li><code>\/usage cost<\/code> \u2192 \u4ece OpenClaw \u4f1a\u8bdd\u65e5\u5fd7\u663e\u793a\u672c\u5730\u6210\u672c\u6458\u8981\u3002<\/li>\n<\/ul>\n<p>\u5176\u4ed6\u754c\u9762\uff1a<\/p>\n<ul>\n<li><strong>TUI\/Web TUI\uff1a<\/strong> \u652f\u6301 <code>\/status<\/code> + <code>\/usage<\/code>\u3002<\/li>\n<li><strong>CLI\uff1a<\/strong> <code>openclaw status --usage<\/code> \u548c <code>openclaw channels list<\/code> \u663e\u793a<br \/>\n  \u63d0\u4f9b\u5546\u914d\u989d\u7a97\u53e3\uff08\u4e0d\u662f\u6bcf\u54cd\u5e94\u6210\u672c\uff09\u3002<\/li>\n<\/ul>\n<h2>\u6210\u672c\u4f30\u7b97\uff08\u663e\u793a\u65f6\uff09<\/h2>\n<p>\u6210\u672c\u4ece\u4f60\u7684\u6a21\u578b\u5b9a\u4ef7\u914d\u7f6e\u4f30\u7b97\uff1a<\/p>\n<pre><code>models.providers.&lt;provider&gt;.models[].cost\n<\/code><\/pre>\n<p>\u8fd9\u4e9b\u662f <code>input<\/code>\u3001<code>output<\/code>\u3001<code>cacheRead<\/code> \u548c<br \/>\n<code>cacheWrite<\/code> \u7684<strong>\u6bcf 1M token \u7f8e\u5143<\/strong>\u3002\u5982\u679c\u7f3a\u5c11\u5b9a\u4ef7\uff0cOpenClaw \u4ec5\u663e\u793a token\u3002OAuth \u4ee4\u724c<br \/>\n\u6c38\u8fdc\u4e0d\u663e\u793a\u7f8e\u5143\u6210\u672c\u3002<\/p>\n<h2>\u7f13\u5b58 TTL \u548c\u4fee\u526a\u5f71\u54cd<\/h2>\n<p>\u63d0\u4f9b\u5546\u63d0\u793a\u7f13\u5b58\u4ec5\u5728\u7f13\u5b58 TTL \u7a97\u53e3\u5185\u9002\u7528\u3002OpenClaw \u53ef\u4ee5<br \/>\n\u9009\u62e9\u6027\u5730\u8fd0\u884c<strong>\u7f13\u5b58 TTL \u4fee\u526a<\/strong>\uff1a\u5b83\u5728\u7f13\u5b58 TTL<br \/>\n\u8fc7\u671f\u540e\u4fee\u526a\u4f1a\u8bdd\uff0c\u7136\u540e\u91cd\u7f6e\u7f13\u5b58\u7a97\u53e3\uff0c\u4ee5\u4fbf\u540e\u7eed\u8bf7\u6c42\u53ef\u4ee5\u91cd\u7528<br \/>\n\u65b0\u7f13\u5b58\u7684\u4e0a\u4e0b\u6587\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u7f13\u5b58\u5b8c\u6574\u5386\u53f2\u3002\u8fd9\u5728\u4f1a\u8bdd\u7a7a\u95f2\u8d85\u8fc7 TTL \u65f6<br \/>\n\u53ef\u4ee5\u964d\u4f4e\u7f13\u5b58\u5199\u5165\u6210\u672c\u3002<\/p>\n<p>\u5728 <a href=\"\/gateway\/configuration\">Gateway \u7f51\u5173\u914d\u7f6e<\/a> \u4e2d\u914d\u7f6e\u5b83\uff0c\u5e76\u5728<br \/>\n<a href=\"\/concepts\/session-pruning\">\u4f1a\u8bdd\u4fee\u526a<\/a> \u4e2d\u67e5\u770b\u884c\u4e3a\u8be6\u60c5\u3002<\/p>\n<p>\u5fc3\u8df3\u53ef\u4ee5\u5728\u7a7a\u95f2\u95f4\u9699\u4e2d\u4fdd\u6301\u7f13\u5b58<strong>\u70ed<\/strong>\u3002\u5982\u679c\u4f60\u7684\u6a21\u578b\u7f13\u5b58 TTL<br \/>\n\u662f <code>1h<\/code>\uff0c\u5c06\u5fc3\u8df3\u95f4\u9694\u8bbe\u7f6e\u4e3a\u7565\u4f4e\u4e8e\u6b64\uff08\u4f8b\u5982 <code>55m<\/code>\uff09\u53ef\u4ee5\u907f\u514d<br \/>\n\u91cd\u65b0\u7f13\u5b58\u5b8c\u6574\u63d0\u793a\uff0c\u4ece\u800c\u964d\u4f4e\u7f13\u5b58\u5199\u5165\u6210\u672c\u3002<\/p>\n<p>\u6709\u5173 Anthropic API \u5b9a\u4ef7\uff0c\u7f13\u5b58\u8bfb\u53d6\u6bd4\u8f93\u5165<br \/>\ntoken \u4fbf\u5b9c\u5f97\u591a\uff0c\u800c\u7f13\u5b58\u5199\u5165\u4ee5\u66f4\u9ad8\u7684\u500d\u7387\u8ba1\u8d39\u3002\u53c2\u89c1 Anthropic \u7684<br \/>\n\u63d0\u793a\u7f13\u5b58\u5b9a\u4ef7\u4e86\u89e3\u6700\u65b0\u8d39\u7387\u548c TTL \u500d\u7387\uff1a<br \/>\n<a href=\"https:\/\/docs.anthropic.com\/docs\/build-with-claude\/prompt-caching\">https:\/\/docs.anthropic.com\/docs\/build-with-claude\/prompt-caching<\/a><\/p>\n<h3>\u793a\u4f8b\uff1a\u7528\u5fc3\u8df3\u4fdd\u6301 1 \u5c0f\u65f6\u7f13\u5b58\u70ed<\/h3>\n<p><code>yaml  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\nagents:<br \/>\n  defaults:<br \/>\n    model:<br \/>\n      primary: \"anthropic\/claude-opus-4-5\"<br \/>\n    models:<br \/>\n      \"anthropic\/claude-opus-4-5\":<br \/>\n        params:<br \/>\n          cacheRetention: \"long\"<br \/>\n    heartbeat:<br \/>\n      every: \"55m\"<\/code><\/p>\n<h2>\u51cf\u5c11 token \u538b\u529b\u7684\u6280\u5de7<\/h2>\n<ul>\n<li>\u4f7f\u7528 <code>\/compact<\/code> \u6765\u603b\u7ed3\u957f\u4f1a\u8bdd\u3002<\/li>\n<li>\u5728\u4f60\u7684\u5de5\u4f5c\u6d41\u4e2d\u4fee\u526a\u5927\u7684\u5de5\u5177\u8f93\u51fa\u3002<\/li>\n<li>\u4fdd\u6301 skill \u63cf\u8ff0\u7b80\u77ed\uff08skill \u5217\u8868\u4f1a\u6ce8\u5165\u5230\u63d0\u793a\u4e2d\uff09\u3002<\/li>\n<li>\u5bf9\u4e8e\u5197\u957f\u7684\u63a2\u7d22\u6027\u5de5\u4f5c\uff0c\u4f18\u5148\u4f7f\u7528\u8f83\u5c0f\u7684\u6a21\u578b\u3002<\/li>\n<\/ul>\n<p>\u7cbe\u786e\u7684 skill \u5217\u8868\u5f00\u9500\u516c\u5f0f\u53c2\u89c1 <a href=\"\/tools\/skills\">Skills<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Token \u4f7f\u7528\u4e0e\u6210\u672c OpenClaw \u8ddf\u8e2a\u7684\u662f token\uff0c\u800c\u4e0d\u662f\u5b57\u7b26\u3002Token \u662f\u6a21\u578b\u7279\u5b9a\u7684\uff0c\u4f46\u5927\u591a\u6570 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-257","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":552,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/257\/revisions\/552"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}