Models Hub
Agent Tools

Use NextChat with Models Hub: Custom Endpoint Setup

Turn on the custom endpoint in NextChat (ChatGPT-Next-Web), on the official site or a self-hosted instance, and point it at Models Hub, with verification and error troubleshooting.

Edit this page

NextChat (also known as ChatGPT-Next-Web) is an open-source cross-platform AI chat client available as a web app, desktop app, or self-hosted deployment. Point its custom endpoint at Models Hub and your chats use your Models Hub balance for whichever model you choose. This page covers two setups — using the official hosted site for a quick try, or a self-hosted instance for long-term use — and nothing else about NextChat.

Three things you need

A Models Hub API key, the base URL https://modelsok.com (see the note below if it errors), and a model name.

Prerequisites

  • A Models Hub API key, created on the Tokens page. The token's group must have access to the models you plan to use.
  • For a quick try: just open the official NextChat site, no install needed. For long-term self-hosting: a Docker or Vercel-capable environment — see the official deployment docs.
Use caseModelPricingLive status
Everyday chatclaude-sonnet-4-6PriceAvailability and latency
Harder questions and long conversationsgpt-5.5PriceAvailability and latency
Cheap and fast for everyday questionsgpt-5.4-miniPriceAvailability and latency

Model names are authoritative on the pricing page.

Option 1: use the official hosted site

  1. Open app.nextchat.dev and click the settings icon in the bottom left.

  2. In the Model section, find Custom Endpoint and turn it on. Two fields appear: OpenAI Endpoint and API Key.

  3. Enter the following in OpenAI Endpoint first:

    https://modelsok.com

    If sending a message errors out (commonly a 404), switch to the versioned path:

    https://modelsok.com/v1
  4. Enter your Models Hub API key in API Key.

  5. Back in the chat view, pick a model from the table above in the model dropdown. If it's not listed, try typing the model ID directly into the model field — subject to your current version's UI.

Settings on the hosted site are stored only in your browser; clearing your cache or switching devices means filling them in again.

Option 2: self-hosted instance

Self-hosting lets you set the connection via environment variables, which is more convenient for teams. Example with Docker:

docker run -d -p 3000:3000 \
  -e BASE_URL="https://modelsok.com" \
  -e OPENAI_API_KEY="your-models-hub-api-key" \
  -e CUSTOM_MODELS="+claude-sonnet-4-6,+gpt-5.5,+gpt-5.4-mini" \
  yidadaa/chatgpt-next-web
Environment variablePurpose
BASE_URLThe base URL. The source only requires an http(s):// prefix, not a mandatory /v1 — use the same try-then-fix approach as in Option 1
OPENAI_API_KEYYour Models Hub API key; comma-separate multiple keys to round-robin
CUSTOM_MODELSControls the model list: + adds, - hides, name=displayName renames, comma-separated. ⚠️ Using -all to clear the default list before re-adding (e.g. -all,+claude-sonnet-4-6) hasn't been verified against the current version in this rewrite — check the actual behavior on your deployment

Restart the container after changing environment variables for them to take effect.

Verify

Select your configured model in the chat box and ask "describe this project in one sentence". A normal reply means you're connected. Then check Usage logs in the Models Hub console for a request under that model name within seconds.

Common errors

SymptomCauseFix
Sending a message returns 404The endpoint is missing or has an extra /v1Try both and keep whichever works
401 / incorrect API keyKey copied incompletely, or the token is disabledRe-copy from the Tokens page
The model you want isn't in the dropdownYou didn't type the model ID manually on the hosted site, or didn't add +model to CUSTOM_MODELS when self-hostingFollow step 5 of Option 1, or the env var table in Option 2
Slow replies or 429Rate limited, usually too much concurrencyRetry shortly; contact support for a higher limit if it persists
Changed env vars on a self-hosted instance don't take effectThe container wasn't restartedRun docker restart or redeploy

More in Troubleshooting.

FAQ

How is it billed? Per input and output token actually consumed, at the price on each model's pricing page; usage logs itemize every request.

How is this different from calling the vendor's API directly? Same request format; only the endpoint changes. One key works across multiple vendors' models without separate accounts.

How do I switch models? Pick a different one from the model dropdown at the top of the chat box; on self-hosted instances, add the model to CUSTOM_MODELS first or it won't appear in the list.

On this page