# 参数与路径参考

查询本地地址、配置文件和单位约定。

适用范围：依据当前 Windows 客户端源码编写；安装包与第三方客户端版本的端到端兼容性待复核。

最后更新：2026-12-02

网页原文：https://www.modelkey.net/help/reference/

## 前提与路径

默认网关 `http://127.0.0.1:8787/v1`，PORT可覆盖，连接信息以当前运行为准。本地租户凭据与上游密钥不同；示例仅用 `INVALID_EXAMPLE_KEY_DO_NOT_USE`。

数据目录优先 MODELKEY_DATA_DIR，再兼容 KHD_DATA_DIR；Windows通常 `%APPDATA%\ModelKey`，macOS为 `~/Library/Application Support/ModelKey`，Linux为 `~/.modelkey`。数据库 db.json 的机器绑定保护不保证跨机解密。

## 配置字段唯一解释索引

每行的完整字段名只映射到一个解释章节；下列链接是字段含义、默认、单位、范围和依赖的规范入口。

| 完整字段名 | 唯一解释章节 |
| --- | --- |
| gateway.autoRoute.streamIdleTimeoutMs | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.requestHardTimeoutMs | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.requestTimeoutMs | [连续性兼容说明](https://www.modelkey.net/help/routing/continuity/#验证与恢复) |
| gateway.autoRoute.firstByteTimeoutMs | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.fallbackMaxRetry | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.retryBudgetMaxPerWindow | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.circuitWindowMs | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.circuitFailureThreshold | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.circuitOpenSleepMs | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.rateLimitSkipMs | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.idempotentCacheMs | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.idempotentCacheMaxBytes | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.autoRoute.retryBackoffMs | [连续性字段表](https://www.modelkey.net/help/routing/continuity/#前提与字段表) |
| gateway.allowProtocolConversion | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.toolsMinTier | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.contextUpgradeThreshold | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.sessionSticky | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.stickyIdleTtlMs | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.stickyMaxTtlMs | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.crossTierDegrade | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.sceneLexicon | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.maxTier | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.mediaLooseMode | [模型字段表](https://www.modelkey.net/help/routing/models/#前提与字段表) |
| gateway.autoRoute.sameModelOptimize | [账号参数](https://www.modelkey.net/help/routing/accounts/#前提与参数) |
| gateway.autoRoute.stickySwitchMinGain | [账号参数](https://www.modelkey.net/help/routing/accounts/#前提与参数) |
| gateway.autoRoute.weightCost | [账号参数](https://www.modelkey.net/help/routing/accounts/#前提与参数) |
| gateway.autoRoute.weightLatency | [账号参数](https://www.modelkey.net/help/routing/accounts/#前提与参数) |
| gateway.autoRoute.weightHealth | [账号参数](https://www.modelkey.net/help/routing/accounts/#前提与参数) |
| gateway.autoRoute.weightTtft | [账号参数](https://www.modelkey.net/help/routing/accounts/#前提与参数) |
| gateway.autoRoute.weightErrorRate | [账号参数](https://www.modelkey.net/help/routing/accounts/#前提与参数) |
| gateway.autoRoute.weightQuality | [账号参数](https://www.modelkey.net/help/routing/accounts/#前提与参数) |
| gateway.autoRoute.probeInterval | [探活字段](https://www.modelkey.net/help/routing/health/#前提与字段) |
| gateway.autoRoute.probeTimeoutMs | [探活字段](https://www.modelkey.net/help/routing/health/#前提与字段) |
| gateway.autoRoute.idleSuspendEnable | [探活字段](https://www.modelkey.net/help/routing/health/#前提与字段) |
| gateway.autoRoute.idleSuspendDuration | [探活字段](https://www.modelkey.net/help/routing/health/#前提与字段) |
| gateway.autoRoute.circuitBreakWindowMs | [探活字段](https://www.modelkey.net/help/routing/health/#前提与字段) |
| gateway.autoRoute.slowThresholdMs | [探活字段](https://www.modelkey.net/help/routing/health/#前提与字段) |
| gateway.search.enable | [搜索字段](https://www.modelkey.net/help/routing/search/#前提与配置字段) |
| gateway.search.webSearchEndpoint | [搜索字段](https://www.modelkey.net/help/routing/search/#前提与配置字段) |
| gateway.search.internalSearchEndpoint | [搜索字段](https://www.modelkey.net/help/routing/search/#前提与配置字段) |
| gateway.search.topK | [搜索字段](https://www.modelkey.net/help/routing/search/#前提与配置字段) |
| gateway.search.timeoutMs | [搜索字段](https://www.modelkey.net/help/routing/search/#前提与配置字段) |
| gateway.search.webSearchTimeoutMs | [搜索字段](https://www.modelkey.net/help/routing/search/#前提与配置字段) |
| gateway.search.internalSearchTimeoutMs | [搜索字段](https://www.modelkey.net/help/routing/search/#前提与配置字段) |
| gateway.search.webProbeTimeoutMs | [搜索字段](https://www.modelkey.net/help/routing/search/#前提与配置字段) |
| gateway.search.webSearchApiKey | [搜索字段](https://www.modelkey.net/help/routing/search/#前提与配置字段) |
| gateway.billing.enable | [成本字段](https://www.modelkey.net/help/routing/cost-controls/#前提与字段) |
| gateway.billing.enableTokenEstimate | [成本字段](https://www.modelkey.net/help/routing/cost-controls/#前提与字段) |
| gateway.billing.usdCny | [成本字段](https://www.modelkey.net/help/routing/cost-controls/#前提与字段) |
| gateway.billing.costBasis | [成本字段](https://www.modelkey.net/help/routing/cost-controls/#前提与字段) |
| gateway.billing.accountDailyCap | [成本字段](https://www.modelkey.net/help/routing/cost-controls/#前提与字段) |
| gateway.billing.blockNoPrice | [成本字段](https://www.modelkey.net/help/routing/cost-controls/#前提与字段) |
| gateway.billing.priceWarnPct | [成本字段](https://www.modelkey.net/help/routing/cost-controls/#前提与字段) |
| gateway.billing.retentionMaxRecords | [成本字段](https://www.modelkey.net/help/routing/cost-controls/#前提与字段) |

## 使用和验证步骤

1. 按完整字段名查表进入唯一解释章节。
2. 核对存储单位与界面换算，记录旧值再修改。
3. 保存重载并执行短请求验证；出现400按字段范围恢复。

## 边界与恢复

未知键通过保存不代表有功能。后端专用默认值不应视为可见控件。本文依据源码，安装包与端到端验证待完成；无法解密的换机数据库应重新添加凭据，不承诺云端恢复。

## 相关文档

- [智能路由总览](https://www.modelkey.net/help/routing/)
- [API Key 安全与管理](https://www.modelkey.net/help/api-keys/)
