# NextChat

## 常见配置参数 <a href="#chang-jian-pei-zhi-can-shu" id="chang-jian-pei-zhi-can-shu"></a>

要将应用连接到 AI 网关，请复制以下 URL，将其中的 `{APPLICATION_URL}` 和 `sk-xxxxxxxxxxxxxx` 替换为实际值，然后**在浏览器中打开**该链接。

```perl
https://{APPLICATION_URL}/#/?settings={
  "key":"sk-xxxxxxxxxxxxxx",
  "url":"https://gateway.theturbo.ai"
}
```

<table><thead><tr><th width="194.70703125">参数</th><th>说明</th></tr></thead><tbody><tr><td><code>{APPLICATION_URL}</code></td><td>你已部署的 AI 应用访问地址（例如聊天 UI 或桌面 Web 应用）</td></tr><tr><td><code>key</code></td><td>创建 AI 网关实例后生成的 API 密钥，用于对所有请求进行身份认证</td></tr><tr><td><code>url</code></td><td>AI 网关服务的基础访问地址，即 <code>https://gateway.theturbo.ai</code></td></tr></tbody></table>

{% hint style="info" %} <mark style="color:blue;">**注意**</mark>

<mark style="color:blue;">你可以访问</mark> [<mark style="color:blue;">**Github**</mark>](https://github.com/ChatGPTNextWeb/NextChat) <mark style="color:blue;">查看更详细的配置说明。</mark>
{% endhint %}

## 在 NextChat 中使用非 OpenAI 模型

NextChat 原生支持 OpenAI API 格式。

若要通过 AI 网关使用其他提供方的模型（例如 Claude 或 Gemini），需要将这些模型以 **自定义模型（Custom Models）** 的形式添加，并使用 **OpenAI 兼容配置**。

在 **Settings > Custom Models** 中，按以下格式添加模型：

```
+<model_name>@OpenAI
```

**示例**

```
+claude-3-opus-20240229@OpenAI
```

**说明**

`<model_name>`\
AI 网关所支持的实际模型名称。

`@OpenAI`\
表示 NextChat 应以 OpenAI 兼容的 API 格式来调用该模型，即使底层模型来自其他厂商。

AI 网关会将 OpenAI 兼容格式的请求，自动转换为对应模型提供方的 API 调用。

通过这种方式，NextChat 可以通过 AI 网关提供的统一 OpenAI 兼容接口，使用来自多个 AI 提供方的模型。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/cn/ai-gateway/ai-gateway-integration/nextchat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
