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

# 状态码与方案 A 熔断排障

> 常见 HTTP 错误状态码字典及方案 A 404 严格熔断机制解析

## HTTP 状态码字典

| 状态码 | 错误代码 | 说明与排障建议 |
| :- | :- | :- |
| **200 OK** | - | 请求成功，正常返回推理或流式结果。 |
| **400 Bad Request** | `invalid_request_error` | 请求体格式错误，例如缺少必要的 `messages` 数组或 `content` 为空。 |
| **401 Unauthorized** | `invalid_api_key` | 密钥无效、格式错误或已被管理员在控制台撤销。请检查 Header 中的 `Bearer sk-sv-...`。 |
| **402 Payment Required** | `insufficient_quota` | 账户额度不足。请进入控制台充值兑换卡密后再试。 |
| **404 Not Found** | `model_not_found` | **【方案 A 熔断拦截】** 请求的模型不存在或已被管理员从货架下架。详见下文。 |
| **429 Too Many Requests** | `rate_limit_exceeded` | 并发请求数超过您账户当前的限制等级，建议加入重试退避机制 (Exponential Backoff)。 |
| **502 Bad Gateway** | `upstream_unavailable` | 上游特定渠道暂时抖动，网关已尝试自动切换备用链路。 |

***

## 方案 A 严格 404 熔断机制解析

### 为什么会收到 404 Model Not Found？

SocialVision 采用\*\*方案 A（严格熔断与资产防护）\*\*策略：

1. **绝对不向上游损耗**：
   当一个模型未在管理后台货架上勾选上架（`is_active = false`）时，网关在解析请求的第一毫秒立即终止，并直接响应：
   ```json theme={null}
   {
     "error": {
       "message": "Model 'xxx' not found or inactive on this gateway.",
       "type": "invalid_request_error",
       "code": "model_not_found"
     }
   }
   ```
2. **严防经济损失**：
   网关绝对不会将该请求转发给外部服务商，从而杜绝了因测试或越权调用产生的任何意外扣费。

### 如何解决？

* 前往 [模型与定价广场](https://socialvision.tisyk.xyz/pricing) 查询当前已开放对外售卖的模型列表。
* 将客户端中的模型名称更正为已上架的模型标识符（如 `claude-3-7-sonnet-20250219` 或 `gpt-4o`）。
* 如您是管理员，可在管理后台的“模型货架”中一键开启该模型的上架开关。
