> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hitheo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 记录一次路由纠正

> 提交 playground 中的“重新路由（Reroute）”操作，帮助 Theo 了解全局分类器在哪里出错。

记录一次路由纠正——即开发者对已解析的模式表示不认同，并提供了他们期望的模式的一次对话轮次。Theo 会为每个调用方保留最近 30 天的纠正记录，并按 `expected_mode` 对其进行聚类；一旦某个聚类超过阈值，playground 就会显示一条“我发现了一个规律”的提示，开发者可以据此让 Theo [建议一条规则](/api-reference/routing-preferences/suggest-rule)，该规则由该聚类推导而来。

纠正记录的作用域为个人或团队级别（与调用方当前激活的组织上下文一致），因此个人的纠正记录不会触发团队级别的建议提示条。

## 身份验证

需要携带具备 `billing` API 密钥作用域的 Bearer 令牌。该接口是幂等的：相同的 `Idempotency-Key` 请求头会重放相同的响应。

## 请求体

<ParamField body="prompt" type="string" required>
  产生了非预期模式的提示词。长度为 1–4096 个字符。会在服务层做供应商名称脱敏处理。
</ParamField>

<ParamField body="expected_mode" type="string" required>
  开发者期望的 Theo 模式（例如 `"think"`、`"image"`、`"insurance_quote"`）。
</ParamField>

<ParamField body="source_message_id" type="string">
  可选参数，指该纠正所关联对话轮次的消息 id。长度不超过 128 个字符。
</ParamField>

## 请求示例

```bash curl theme={null}
curl -X POST https://www.hitheo.ai/api/v1/routing-preferences/corrections \
  -H "Authorization: Bearer $THEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Look at this indemnity clause",
    "expected_mode": "think"
  }'
```

## 响应

```json theme={null}
{
  "id": "corr_abc123",
  "ok": true,
  "cluster_threshold": 3,
  "pattern_suggestion_available": true,
  "pattern_expected_mode": "think",
  "pattern_count": 3
}
```

当 `pattern_suggestion_available` 为 `true` 时，可调用 [POST /api/v1/routing-preferences/suggest-rule](/api-reference/routing-preferences/suggest-rule)，并传入匹配的 `expected_mode`，即可获得一条由该聚类推导出的确定性正则表达式。

## 错误

* `400 routing_correction_invalid` —— 通用的请求结构校验失败。
* `400 routing_correction_vendor_name` —— 提示词中提及了上游供应商名称（如 Claude、OpenAI 等）。
* `400 routing_correction_invalid_mode` —— `expected_mode` 不是已知的 Theo 模式。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.