> For the complete documentation index, see [llms.txt](https://yeasy.gitbook.io/openclaw_guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yeasy.gitbook.io/openclaw_guide/di-si-bu-fen-shi-zhan-yu-you-hua-shen-du-zhi-nan/14_performance_cost/summary.md).

# 14.5 本章小结

> **注**：本章定价数据基于各供应商官方 API 定价。AI 模型定价变化频繁，请以各供应商官方定价页面为准：
>
> * [Anthropic 官方定价](https://platform.claude.com/docs/en/about-claude/pricing)
> * [OpenAI 官方定价](https://openai.com/api/pricing/)

本章从 Token 消耗、推理延迟、用量观测和部署预算四个维度，提供了基于 OpenClaw 内置观测能力、provider 限额与外部治理机制的性能优化与成本控制方案。

## 要点回顾

* **Token 与上下文成本**（14.1）：通过系统提示精简、按 Agent 分配工具定义、`compaction` 与 `contextPruning` 配置实现上下文压缩，配合 `agents.defaults.model.primary` / `agents.defaults.model.fallbacks`，或 `agents.list[].model.primary` / `fallbacks` 进行模型分级。
* **延迟与吞吐优化**（14.2）：延迟由 LLM 推理、工具 I/O、沙箱执行、编排器开销四段构成；通过模型回退链、工具并行化、`/trace on` 与 `openclaw logs --follow --json` 回放来定位瓶颈。
* **用量观测与预算控制**（14.3）：使用 `/status`、`/usage cost`、`openclaw gateway usage-cost`、`/compact` 等交互/CLI 命令与 Dashboard Usage 页面监控 Token 与成本；硬预算和告警应结合 provider 控制台、外部监控或插件治理。
* **部署预算模板**（14.4）：个人场景月均 $60–90、团队场景 $600–900、企业场景 $10K–50K，核心变量是模型选择和日均会话量。

## 优化检查清单

1. 是否已通过 `/usage cost`、`openclaw gateway usage-cost` 或 Dashboard Usage 建立 Token / 成本基线，并用 `openclaw status --usage` 补充 provider 配额窗口证据？
2. 系统提示是否已精简到必要最小集？
3. 是否为不同 Agent 配置了差异化的工具集和模型？
4. `compaction` 和 `contextPruning` 策略是否已启用并调优？
5. 模型回退链是否已配置，避免单点故障？
6. 是否有定期的成本审计流程？

## 下一步

第十五章将提供常见故障的诊断决策树，第十六章介绍与 Claude 生态的深度集成。

***

> **发现错误或有改进建议？** 欢迎提交 [Issue](https://github.com/yeasy/openclaw_guide/issues) 或 [PR](https://github.com/yeasy/openclaw_guide/pulls)。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yeasy.gitbook.io/openclaw_guide/di-si-bu-fen-shi-zhan-yu-you-hua-shen-du-zhi-nan/14_performance_cost/summary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
