# 第四章 配置体系与模型治理

在[第二章](/openclaw_guide/di-yi-bu-fen-ji-chu-ru-men/02_setup.md)中，`openclaw onboard` 向导已经帮你完成了模型与认证的最小接入——内置供应商的密钥已写入 auth-profiles，默认模型已可用。但“能用”和“能放心地长期用”之间还隔着几步。

本章的目标不是重复“接入”，而是把接入**治理化**：这意味着：

* **配置可解释**：三个月后，你能清楚地说出“为什么当前用的是这个模型”，而不是“我也忘了怎么配的”
* **认证可轮换**：API Key 泄露了，或者企业要求定期轮换，你能在 10 分钟内无缝切换到备用 Key，不中断服务
* **选型有依据**：需要在 Claude、当前 OpenAI 旗舰模型、本地模型之间选择，你有一个四维框架（成本、质量、延迟、可靠性）来评估
* **故障可回退**：主模型或主 provider 出现故障时，系统能按显式 fallback 链切换到可用备选，而不是整个服务瘫痪

读完本章后，你应能独立回答三个问题：当前配置从哪里生效、当前模型为什么被选中、当前失败时系统会如何退化。

## 本章内容导读

本章包括以下几个小节：

* [**4.1 openclaw.json 结构与配置优先级**](/openclaw_guide/di-yi-bu-fen-ji-chu-ru-men/04_config_models/4.1_config_system.md)：理解 openclaw\.json 的核心结构与配置优先级。
* [**4.2 模型供应商接入与认证方式**](/openclaw_guide/di-yi-bu-fen-ji-chu-ru-men/04_config_models/4.2_provider_access.md)：区分内置供应商默认路径与自定义供应商显式配置路径，掌握密钥注入与轮换机制。
* [**4.3 模型选择与默认策略**](/openclaw_guide/di-yi-bu-fen-ji-chu-ru-men/04_config_models/4.3_model_selection.md)：建立模型选择的质量/成本/延迟/可靠性四维决策框架。
* [**4.4 故障转移基础：回退链路与恢复策略**](/openclaw_guide/di-yi-bu-fen-ji-chu-ru-men/04_config_models/4.4_failover.md)：配置并验证基础故障转移链路。
* [**4.5 本章小结**](/openclaw_guide/di-yi-bu-fen-ji-chu-ru-men/04_config_models/summary.md)：关键结论与自测题。

## 学习目标

完成本章的阅读后，你将能够：

1. **理解配置**：快速定位配置的优先级与生效规则。
2. **治理认证**：区分内置供应商的默认路径与自定义供应商的显式配置路径，掌握密钥注入与安全轮换。
3. **做出决策**：基于质量、成本、延迟与可靠性做出合理的模型选择。
4. **规划容错**：设计基本的故障转移链路，提高系统稳定性。


---

# Agent Instructions: 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-yi-bu-fen-ji-chu-ru-men/04_config_models.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.
