---
title: NextChat | RunAPI
description: Connect NextChat to RunAPI with a custom endpoint and model.
url: https://runapi.ai/docs/resources/application-practices/nextchat.md
canonical: https://runapi.ai/docs/resources/application-practices/nextchat
locale: en
---

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

# NextChat

Connect NextChat to RunAPI through its custom OpenAI endpoint. NextChat
composes its operation path differently from the other clients in this
group, so use the exact endpoint value below. Create a standard RunAPI
API key in the [Authentication Guide](https://runapi.ai/docs/guides/authentication.md)
before continuing.

## Install or deploy NextChat

Choose a desktop release or deployment method from the [official
NextChat repository][1], then open **Settings**.



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

## Configure the custom endpoint

1.  In the Web application, enable **Custom Endpoint** and select
    **OpenAI**. The desktop application always uses custom
    configuration.
2.  Set the endpoint address to `https://runapi.ai` without `/v1`.
3.  Enter your RunAPI API key.
4.  Under **Custom Model Name**, add an exact identifier from the [Model
    Catalog](https://runapi.ai/models), then select it for the current chat.

This setting is NextChat's endpoint root, not the OpenAI-compatible Base
URL used by an OpenAI SDK. NextChat appends `v1/chat/completions`
itself, producing `https://runapi.ai/v1/chat/completions`. Its OpenAI
client does not fetch the RunAPI model list, so add the identifier
manually instead of waiting for discovery.

## Configure a self-hosted deployment

For a self-hosted installation, set these environment variables and
redeploy or restart the application:

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

The `+` prefix adds the model without replacing the application's
existing model entries.

## Verify the connection

Start a new chat, select the custom RunAPI model, and send `Reply with
the word connected.` A normal complete or streamed response confirms the
custom endpoint is active.

## Troubleshoot

* **The request URL contains `/v1/v1/chat/completions`:** remove `/v1`
  from the endpoint address and use `https://runapi.ai`.
* **NextChat still uses a built-in model:** add the exact identifier
  under **Custom Model Name**, then reselect it in the current chat.
* **Web settings have no effect:** confirm **Custom Endpoint** is
  enabled; the desktop and Web applications handle this switch
  differently.
* **Self-hosted changes have no effect:** restart or redeploy after
  changing `BASE_URL`, `OPENAI_API_KEY`, or `CUSTOM_MODELS`.

For shared protocol behavior, use the [LLM API
Quickstart](https://runapi.ai/docs/guides/llm-api/quickstart.md). For request and response
fields, use the [Chat Completions API
Reference](https://runapi.ai/docs/api/openai/chat-completions.md).

---

## More from RunAPI

- [Home](https://runapi.ai/.md)
- [Models](https://runapi.ai/models.md)
- [AI Video API Comparison](https://runapi.ai/ai-video-api-comparison.md)
- [OpenClaw Integration](https://runapi.ai/openclaw.md)
- [Best API for OpenClaw](https://runapi.ai/best-api-for-openclaw.md)
- [OpenClaw Image Generation](https://runapi.ai/openclaw-image-generation.md)
- [Hermes Agent Integration](https://runapi.ai/hermes-agent.md)
- [Pricing](https://runapi.ai/pricing.md)
- [Claude API Pricing](https://runapi.ai/claude-api-pricing.md)
- [ChatGPT API Pricing](https://runapi.ai/chatgpt-api-pricing.md)
- [OpenAI API Pricing](https://runapi.ai/openai-api-pricing.md)
- [Gemini API Pricing](https://runapi.ai/gemini-api-pricing.md)
- [Claude Code Pricing](https://runapi.ai/claude-code-pricing.md)
- [Claude Code API](https://runapi.ai/claude-code-api.md)
- [Claude Code vs Cursor](https://runapi.ai/claude-code-vs-cursor.md)
- [Claude Max vs API](https://runapi.ai/claude-max-vs-api.md)
- [Requesty Alternative](https://runapi.ai/requesty-alternative.md)
- [Docs](https://runapi.ai/docs/guides)
- [SDK](https://runapi.ai/sdk.md)
- [Skills](https://runapi.ai/skills.md)
- [MCP Server](https://runapi.ai/mcp.md)
- [CLI](https://runapi.ai/cli.md)
- [Feedback](https://runapi.ai/)
- [Contact](mailto:support@runapi.ai)
- [Terms](https://runapi.ai/terms.md)
- [Privacy](https://runapi.ai/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/icon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "TechArticle",
    "headline": "NextChat",
    "description": "Connect NextChat to RunAPI with a custom endpoint and model.",
    "url": "https://runapi.ai/docs/resources/application-practices/nextchat",
    "mainEntityOfPage": "https://runapi.ai/docs/resources/application-practices/nextchat"
  }
]
```
