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

# NextChat

> 了解如何通过环境变量覆盖 NextChat 的 OpenAI base URL，接入 siflow endpoint，并在 ChatGPT-style 客户端中使用算秩模型。

[NextChat](https://github.com/ChatGPTNextWeb/NextChat) 是一个轻量级、跨平台的 ChatGPT-style web/desktop 客户端。它通过环境变量覆盖 OpenAI base URL，因此可以指向 siflow endpoint 并使用算秩模型。

支持的模型包括 `glm-5.2` 和 `DeepSeek-V4-Flash`。完整模型列表和价格请参考 [模型广场](https://console.siflow.cn/model-inference/models)。

## 配置

在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建 API Key。NextChat 通过环境变量读取 OpenAI 连接信息，请在启动前设置：

```bash theme={null}
export OPENAI_API_KEY="<Your API Key>"
export BASE_URL="https://api.siflow.cn/model-api"
export CUSTOM_MODELS="-all,+glm-5.2,+DeepSeek-V4-Flash"
```

| 变量               | 说明                                                                                                    |
| ---------------- | ----------------------------------------------------------------------------------------------------- |
| `OPENAI_API_KEY` | 您在 [API 密钥](https://console.siflow.cn/model-inference/api_keys) 页面创建的 API Key。                        |
| `BASE_URL`       | 不带 `/v1` 后缀的 siflow endpoint：`https://api.siflow.cn/model-api`。NextChat 会自行追加 `/v1/chat/completions`。 |
| `CUSTOM_MODELS`  | `-all` 隐藏默认模型；`+glm-5.2,+DeepSeek-V4-Flash` 将算秩模型添加到选择器。                                              |

<Warning>
  `BASE_URL` 不能包含 `/v1`，否则 NextChat 内部追加 `/v1/chat/completions` 后会导致路径重复。
</Warning>

如果使用 plugin 或 tool 功能，请选择原生支持 tool calling 的模型。

部署到 Vercel 时也使用这三个变量，请在项目的 Environment Variables 中设置。Docker 部署时，可通过 `-e OPENAI_API_KEY=... -e BASE_URL=... -e CUSTOM_MODELS=...` 传入。

## 验证

打开 NextChat，在选择器中选择算秩模型，然后发送消息。如果正常回复，即表示连接成功。

<img src="https://mintcdn.com/siflow/MnqDOrFLyFtwF7sA/model-inference/media/nextchat-chat-reply.png?fit=max&auto=format&n=MnqDOrFLyFtwF7sA&q=85&s=e858effbd16fd5c70b691e626b32c4b8" alt="NextChat 使用算秩模型进行对话" width="2880" height="1800" data-path="model-inference/media/nextchat-chat-reply.png" />

## 常见问题

* **模型选择器为空或仍显示默认模型**：检查 `CUSTOM_MODELS`。`-all` 会清空内置列表，随后 `+<model>` 添加每个算秩模型。
