# NextChat

> Deploy NextChat (formerly ChatGPT-Next-Web) with BASE_URL and friends, or enter a custom endpoint in its settings

Source: https://qd.zsopc.com/en/docs/integrations/nextchat

> [NextChat](https://github.com/ChatGPTNextWeb/NextChat) (formerly ChatGPT-Next-Web) is a lightweight open-source web chat app with a desktop build. These steps were checked against NextChat's README and source code on 2026-11-15 (latest release: v2.16.1, published 2025-07-29).

## Get an API key

Create one at [qd.zsopc.com/dashboard/keys](https://qd.zsopc.com/dashboard/keys) (`sk-gpushare-` plus 64 hex characters; you can re-reveal it on its detail page at any time).

## Configure at deploy time (recommended)

```bash
docker run -d -p 3000:3000 \
  -e OPENAI_API_KEY=sk-gpushare-xxx \
  -e BASE_URL=https://qd.zsopc.com \
  -e CUSTOM_MODELS=-all,+claude-sonnet-4-6@OpenAI,+gpt-6.1-sol@OpenAI,+deepseek-v4.1-flash@OpenAI \
  -e CODE=your-access-password \
  yidadaa/chatgpt-next-web
```

- **No `/v1` in `BASE_URL`**: NextChat appends `/v1/chat/completions` itself, so `https://qd.zsopc.com/v1` turns into `/v1/v1/...`.
- **`CUSTOM_MODELS`**: `-all` hides the built-in models, `+model-id` adds one, comma-separated. The `@OpenAI` suffix sends that model to the OpenAI-compatible address above.
- **`CODE`**: the access password (several, comma-separated). Always set it on a public deployment, or anyone can spend your key.
- To stop users entering their own keys in the page, add `-e HIDE_USER_API_KEY=1`.

To send Claude and Gemini over their native protocols, add the lines below and give those models the `@Anthropic` / `@Google` suffix (e.g. `+claude-sonnet-4-6@Anthropic`, `+gemini-3.1-pro-low@Google`):

```bash
  -e ANTHROPIC_URL=https://qd.zsopc.com \
  -e ANTHROPIC_API_KEY=sk-gpushare-xxx \
  -e GOOGLE_URL=https://qd.zsopc.com \
  -e GOOGLE_API_KEY=sk-gpushare-xxx \
```

Neither address takes a version either. `@OpenAI` alone also reaches Claude and Gemini models — the gateway translates the protocol for you, see the [compatibility matrix](../reference/compatibility-matrix.md).

## Configure in the settings

1. **Settings** → turn on **Custom Endpoint**
2. Set **Model Provider** to **OpenAI**
3. **OpenAI Endpoint**: `https://qd.zsopc.com` (no `/v1`)
4. **OpenAI API Key**: your `sk-gpushare-...`
5. **Custom Models**: the model IDs you want, comma-separated, e.g. `claude-sonnet-4-6,gpt-6.1-sol`

> This route suits the **desktop app**. In the web build, a custom endpoint makes the browser call the API directly, and this platform's API does not allow cross-origin calls from third-party web pages, so it fails. For the web build, use the deploy-time configuration above so NextChat's server forwards the requests.

## Troubleshooting

| Symptom | What to check |
|---|---|
| 404 | An extra `/v1` in the address: both `BASE_URL` and the endpoint field take just `https://qd.zsopc.com` |
| 403 `you are not allowed to use ... model` | Once `CUSTOM_MODELS` is set, only the listed models are allowed — add the model to it |
| 401 `invalid_api_key` | Whether the key was copied in full (76 characters); re-reveal it on the [key detail page](https://qd.zsopc.com/dashboard/keys) |
| 400 `model_not_found` | Model ID spelling — it must match [Models](../reference/models.md) exactly |
| 402 `quota_exceeded` | Balance exhausted. Every key shares one account balance — top up on the [Top up page](https://qd.zsopc.com/dashboard/billing) |
| Network or CORS errors in the web build | See the note under "Configure in the settings" |

Full error reference: [Error codes](../reference/errors.md).

## Other clients

- [LobeChat](./lobechat.md) — self-hostable chat app
- [Open WebUI](./open-webui.md) — self-hosted ChatGPT-style UI
- [Chatbox](./chatbox.md) — desktop and mobile client
- [Cherry Studio](./cherry-studio.md) — desktop client
