---
title: NextChat | RunAPI
description: 通过自定义接口和模型将 NextChat 接入 RunAPI。
url: https://runapi.ai/zh-CN/docs/resources/application-practices/nextchat.md
canonical: https://runapi.ai/zh-CN/docs/resources/application-practices/nextchat
locale: zh-CN
---

> HTML version: https://runapi.ai/zh-CN/docs/resources/application-practices/nextchat
> Site index for agents: https://runapi.ai/llms.txt

# NextChat

通过自定义 OpenAI 接口将 NextChat 接入 RunAPI。NextChat 拼接 operation path
的方式与本组其他客户端不同，因此请使用下方准确的接口地址。继续前，请先按照[身份验证指南](https://runapi.ai/zh-CN/docs/guides/authentication)创建标准
RunAPI API Key。

## 安装或部署 NextChat

从 [NextChat 官方仓库][1]选择桌面 release 或部署方式，然后打开**设置**。



[1]: https://github.com/ChatGPTNextWeb/NextChat

## 配置自定义接口

1.  Web 应用中先启用 **Custom Endpoint**，并选择 **OpenAI**；桌面应用始终使用自定义配置。
2.  接口地址填写 `https://runapi.ai`，不要附加 `/v1`。
3.  填写 RunAPI API Key。
4.  在 **Custom Model Name** 中添加[模型目录](https://runapi.ai/zh-CN/models)里的准确
    identifier，然后为当前对话选择它。

该字段是 NextChat 的接口根地址，不是 OpenAI SDK 使用的 OpenAI-compatible Base
URL。NextChat 会自行追加 `v1/chat/completions`，最终得到
`https://runapi.ai/v1/chat/completions`。它的 OpenAI client 不会获取 RunAPI
模型列表，因此应手工添加 identifier，而不是等待自动发现。

## 配置自托管部署

自托管安装可设置以下环境变量，然后重新部署或重启应用：

```shell
BASE_URL=https://runapi.ai
OPENAI_API_KEY=YOUR_RUNAPI_API_TOKEN
CUSTOM_MODELS=+YOUR_RUNAPI_MODEL_ID
```

`+` 前缀会添加模型，而不替换应用已有的模型项。

## 验证连接

新建对话，选择自定义 RunAPI 模型，然后发送`只回复 connected。`。收到正常的完整或流式响应，即表示自定义接口已生效。

## 排障

* **请求 URL 出现 `/v1/v1/chat/completions`：** 从接口地址移除 `/v1`，使用
  `https://runapi.ai`。
* **NextChat 仍在使用内置模型：** 在 **Custom Model Name** 添加准确
  identifier，然后在当前对话中重新选择。
* **Web 设置没有生效：** 确认已启用 **Custom Endpoint**；桌面应用和 Web 应用对此开关的处理不同。
* **自托管修改没有生效：** 修改 `BASE_URL`、`OPENAI_API_KEY` 或 `CUSTOM_MODELS`
  后重启或重新部署。

通用协议行为请查阅 [LLM API
快速开始](https://runapi.ai/zh-CN/docs/guides/llm-api/quickstart)，请求和响应字段请查阅 [Chat
Completions API 参考](https://runapi.ai/zh-CN/docs/api/openai/chat-completions)。

---

## More from RunAPI

- [Home](https://runapi.ai/.md)
- [模型](https://runapi.ai/zh-CN/models.md)
- [AI 视频 API 对比](https://runapi.ai/zh-CN/ai-video-api-comparison.md)
- [OpenClaw 集成](https://runapi.ai/zh-CN/openclaw.md)
- [OpenClaw 最佳 API](https://runapi.ai/zh-CN/best-api-for-openclaw.md)
- [OpenClaw 图片生成](https://runapi.ai/zh-CN/openclaw-image-generation.md)
- [Hermes 智能体集成](https://runapi.ai/zh-CN/hermes-agent.md)
- [定价](https://runapi.ai/zh-CN/pricing.md)
- [Claude API 定价](https://runapi.ai/zh-CN/claude-api-pricing.md)
- [ChatGPT API 定价](https://runapi.ai/zh-CN/chatgpt-api-pricing.md)
- [OpenAI API 定价](https://runapi.ai/zh-CN/openai-api-pricing.md)
- [Gemini API 定价](https://runapi.ai/zh-CN/gemini-api-pricing.md)
- [Claude Code 定价](https://runapi.ai/zh-CN/claude-code-pricing.md)
- [Claude Code API](https://runapi.ai/zh-CN/claude-code-api.md)
- [Claude Code 对比 Cursor](https://runapi.ai/zh-CN/claude-code-vs-cursor.md)
- [Claude Max 对比 API](https://runapi.ai/zh-CN/claude-max-vs-api.md)
- [Requesty 替代方案](https://runapi.ai/zh-CN/requesty-alternative.md)
- [文档](https://runapi.ai/zh-CN/docs/guides)
- [SDK](https://runapi.ai/zh-CN/sdk.md)
- [Skills](https://runapi.ai/zh-CN/skills.md)
- [MCP Server](https://runapi.ai/zh-CN/mcp.md)
- [CLI](https://runapi.ai/zh-CN/cli.md)
- [反馈](https://runapi.ai/)
- [联系](mailto:support@runapi.ai)
- [服务条款](https://runapi.ai/zh-CN/terms.md)
- [隐私政策](https://runapi.ai/zh-CN/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-CN",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/zh-CN/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-CN",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/zh-CNicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-CN",
    "@type": "TechArticle",
    "headline": "NextChat",
    "description": "通过自定义接口和模型将 NextChat 接入 RunAPI。",
    "url": "https://runapi.ai/zh-CN/docs/resources/application-practices/nextchat",
    "mainEntityOfPage": "https://runapi.ai/zh-CN/docs/resources/application-practices/nextchat"
  }
]
```
