NextChat
NextChat (ChatGPT-Next-Web) is an open-source ChatGPT web client. It speaks the OpenAI protocol, so connecting it to MirAPI works like any other OpenAI-compatible tool: one base URL and one key.
What you need
Section titled “What you need”| Element | Value |
|---|---|
| Base URL | https://api.mirapi.ai/v1 |
| API key | Your MirAPI key (sk-...) |
| Model | deepseek-chat |
NextChat appends /chat/completions to the base URL and authenticates with Authorization: Bearer. Its custom endpoint expects an OpenAI-compatible API, so only the OpenAI base URL applies here — the Anthropic and Gemini base URLs are not used.
Configure
Section titled “Configure”Option A — Deploy variables
Section titled “Option A — Deploy variables”Set these in your deployment environment:
BASE_URL="https://api.mirapi.ai/v1"OPENAI_API_KEY="sk-..."NextChat reads the key from OPENAI_API_KEY and the endpoint from BASE_URL. Restart the app after changing them.
Option B — Settings page
Section titled “Option B — Settings page”- Open Settings → Custom Endpoint (OpenAI) (newer versions: Model Provider).
- Set the interface address to
https://api.mirapi.ai/v1. - Enter your MirAPI key (
sk-...) and set the default model todeepseek-chat.
Verify with a message
Section titled “Verify with a message”Send:
Reply with exactly: connected to MirAPIExpect the exact phrase in the reply.
Tool-specific pitfalls
Section titled “Tool-specific pitfalls”- Keep
/v1in the endpoint — NextChat appends/chat/completions, sohttps://api.mirapi.ai/v1becomeshttps://api.mirapi.ai/v1/chat/completions. - The model selector is not fetched from the API. NextChat shows its built-in list plus
CUSTOM_MODELS; adddeepseek-chatwithCUSTOM_MODELS=-all,+deepseek-chat(or type the exact name) instead of waiting for it to appear. - Model names are verbatim — use the exact id from
GET /v1/models; thevendor/prefix is for browsing and filtering in the console, never in a request. - 403 with a valid key means the model is not on the whitelist or the balance is exhausted — top up and retry.
401means the key is missing, invalid, or unknown. - The in-app endpoint wins over
BASE_URL— a custom endpoint saved in the browser takes precedence over the deploy variable, so if requests keep going elsewhere, clear or fix it on the settings page first.