# Configure LobeHub with Router One as a Custom AI Provider

> Markdown mirror of https://router.one/integrations/lobehub for AI assistants and crawlers. Router One is a unified, OpenAI-compatible LLM API gateway.
> Last updated: 2026-12-06

To connect LobeHub (formerly LobeChat) to Router One, open Settings → Provider (App Settings → AI Providers in LobeHub's docs), click Add Custom Provider (+), pick Request Format OpenAI, enter https://api.router.one/v1 as Proxy URL, and paste your key. Keep Use Responses API Specification off for Chat Completions, add a second OpenAI provider with it on for GPT-6 tool calling on POST /v1/responses, or add an Anthropic provider on https://api.router.one for POST /v1/messages. Each request the gateway forwards to a model appears in Dashboard → Logs with model, tokens, wallet charge or plan quota used, latency and status; a billed request uses plan quota when your plan covers that model and has quota left, and the wallet otherwise. Checked 2026-12-06 against LobeHub v2.3.7 (lobehub/lobehub, 2026-12-03).

## Add a Custom AI Provider in LobeHub (or set Docker env vars)

Open Settings → Provider, click + (Add Custom Provider), enter a lowercase Provider ID (fixed after creation, e.g. router-one), Request Format OpenAI, Proxy URL https://api.router.one/v1, and your API Key, then click Create (enabled by default). Next, click Fetch models or Add Model to add catalog IDs from /models, pick one under Connectivity Check, and click Check. Check sends a live "hello" chat call to the model you pick: a custom provider has no default check model, while the built-in OpenAI and Anthropic providers default to gpt-5.2 and claude-opus-4-5-20251101, which are not in the catalog, so switch those to a catalog ID. Self-hosted Docker env vars (built-in providers only; API_KEY and PROXY_URL require a blank UI Proxy URL):

`lobehub-custom-provider`

```text
# UI: Settings -> Provider -> + Add Custom Provider
Provider ID:                    router-one
Request Format:                 OpenAI
Proxy URL:                      https://api.router.one/v1
API Key:                        sk-your-router-one-key
Use Responses API Specification: off (Chat Completions) | on (2nd provider for GPT-6 tools)
Use Client Request Mode:        off (server-side default)

# Self-hosted Docker .env (built-in providers, when UI Proxy URL is blank)
OPENAI_API_KEY=sk-your-router-one-key
OPENAI_PROXY_URL=https://api.router.one/v1
OPENAI_MODEL_LIST=-all,+openai/gpt-6.2-sol,+openai/gpt-6.2-astra,+deepseek-v4.1-flash,+grok-4.7
ANTHROPIC_API_KEY=sk-your-router-one-key
ANTHROPIC_PROXY_URL=https://api.router.one
ANTHROPIC_MODEL_LIST=-all,+anthropic/claude-sonnet-5,+anthropic/claude-haiku-4.5
```

## Request Format, Responses API switch, and GPT-6 tool calling

In v2.3.7 (providerSettings.ts, selectors.ts), OpenAI and New API formats expose Use Responses API Specification (config.enableResponseApi), off by default on custom providers and on by default on built-in OpenAI. Pick OpenAI over New API (router), which routes Gemini IDs that exactly match its built-in model list to Google's native format and queries /api/pricing. GPT-6-family models allow tool calls on Chat Completions only in limited cases (per OpenAI's docs, checked 2026-12-06), so send GPT-6 tool use to POST /v1/responses (/facts/api-compatibility.md). With the switch off, use non-GPT-6 tool-calling IDs (deepseek-v4.1-flash, grok-4.7, google/gemini-4-neon). For GPT-6 tools, add a second OpenAI provider with the switch on and enable only GPT chat, DeepSeek, or Grok IDs: every model on it hits POST /v1/responses, where Claude IDs fail with HTTP 400 "must be called via" and Gemini IDs are not served. In v2.3.7 (openai/modelId.ts), bare gpt-6* IDs force /v1/responses regardless of the switch, whereas openai/-prefixed IDs obey it. Request Format Anthropic takes https://api.router.one (v2.3.7 strips trailing /v1) for Claude and DeepSeek V4 IDs only. The table shows default routes: in v2.3.7 (openai/index.ts), a request with audio input stays on Chat Completions even with the switch on, and a request that uses the model's built-in web search goes to /v1/responses even with it off.

| LobeHub provider | Proxy URL | Responses switch | Default endpoint & models |
| --- | --- | --- | --- |
| Custom (OpenAI) | https://api.router.one/v1 | Off (default) | POST /v1/chat/completions |
| Custom (OpenAI) | https://api.router.one/v1 | On | POST /v1/responses (GPT, DeepSeek, Grok) |
| Custom (Anthropic) | https://api.router.one | N/A | POST /v1/messages (Claude, DeepSeek V4) |
| Built-in OpenAI | OPENAI_PROXY_URL (/v1) | On (default) | POST /v1/responses (GPT, DeepSeek, Grok) |

## Fetch models, capabilities, and embeddings

Use Add Model to enter exact IDs and set Support for Tool Calling, Support Vision, Support Deep Thinking, and Maximum Context Window from each model's page — or click Fetch models on Request Format OpenAI, which calls GET https://api.router.one/v1/models with your Bearer key. Without a key model allowlist, it lists the full catalog including image IDs (gpt-image-2, grok-imagine-image) and channel IDs (azure/, aws/, aistudio/, openai-platform/), so keep non-chat IDs disabled. Router One has no /v1/embeddings or rerank endpoint, so keep embeddings on another provider or local runtime.

## Client Request Mode and Docker environment variables

In v2.3.7 (modelProviders/index.ts), once Proxy URL and API Key are set, Use Client Request Mode (fetchOnClient) defaults off (server-side). Turning it on calls Router One from the browser (dangerouslyAllowBrowser: true); /v1/* endpoints allow CORS preflights (Access-Control-Allow-Origin: *, observed 2026-11-05, /facts/api-compatibility.md). Keep it off on shared deployments: in client mode every user's browser holds the key, while in server mode the LobeHub server makes the call and can read response headers such as a 429's Retry-After; for personal use, set maxSpend or a period budget. Docker env vars (packages/env/src/llm.ts, genServerAiProviderConfig.ts, ModelRuntime/index.ts) — ENABLED_OPENAI and ENABLED_ANTHROPIC, plus the OPENAI_ and ANTHROPIC_ prefixed MODEL_LIST, API_KEY and PROXY_URL — apply only to built-in providers (not custom providers), and API_KEY / PROXY_URL take effect only when the UI Proxy URL is blank.

## Which model ID should LobeHub send?

Copy the exact model ID from /models, preserving case, hyphens, and version suffixes; do not substitute a display name. Open its detail page and match the supported API endpoints, context window, and capabilities such as tool calling to the provider and features selected in LobeHub. A catalog listing does not mean the client can use every feature of that model. Give each client or application a dedicated API key with a maxSpend cap. A key's spend cap (maxSpend) limits what that key can charge to your wallet: once its cumulative wallet charges reach the cap, its wallet-billed requests return HTTP 402. Requests covered by your plan's quota draw from the account's shared plan quota and do not count toward any key's cap.

## Which API protocol is LobeHub using?

OpenAI-compatible describes an interface format; it does not make Chat Completions (/v1/chat/completions), Responses (/v1/responses), and Anthropic Messages (/v1/messages) interchangeable. Check the installed client version, provider configuration, and actual request path against the model detail page and API compatibility fact sheet. A successful plain-text chat does not establish support for hosted tools, conversation state, or file-editing features.

## Verify the LobeHub call in your request trace

Send a simple text request from LobeHub, then match its trace in Dashboard → Logs by time, model, and request_id: tokens, the wallet charge or plan quota it used, latency, and status. Next, test streaming, tool calls, and multi-turn history separately. For failures, retain the actual request path, full error message, and request_id. If there is no matching log, either the request never reached the gateway (client configuration or connectivity) or the gateway refused it before calling a model — a 401 for the key, a 402 for funds, a 429 from your key's or account's limits, or a 400 or 404 for the model ID or endpoint; a streamed request that failed before any output may have no log either. The status and error message the client received tell which, so check them before attributing the error to the gateway or upstream.

## FAQ

### Should LobeHub's Proxy URL end with /v1?

Yes for OpenAI format: https://api.router.one/v1 (SDK appends /chat/completions, /responses, /models). For Anthropic format, use https://api.router.one (v2.3.7 strips trailing /v1 or /v1/messages).

### Why does Connectivity Check or a chat call fail in LobeHub?

Check sends a live "hello" call to the model you pick, so choose an added catalog ID (on built-in providers, not the defaults gpt-5.2 or claude-opus-4-5-20251101). Also check if Responses is on for Claude (HTTP 400 "must be called via") or Gemini (not served), or if Proxy URL lacks /v1 (404).

### Can I use GPT-6 tool calling in LobeHub?

Yes: add a second OpenAI provider on https://api.router.one/v1 with Use Responses API Specification on and enable only /v1/responses IDs (openai/gpt-6.2-sol, openai/gpt-6.2-astra, deepseek-v4.1-flash, grok-4.7). With it off, GPT-6 models allow tool calls only in limited cases (/facts/api-compatibility.md); use deepseek-v4.1-flash or google/gemini-4-neon there.

### Should I turn on Use Client Request Mode?

Keep it off (server-side default) on shared deployments, so model requests go out from the LobeHub server rather than from each user's browser. Personal browser setups work via CORS-enabled /v1/* with a maxSpend cap.

### How do Docker env vars work in self-hosted LobeHub?

Set OPENAI_API_KEY, OPENAI_PROXY_URL, OPENAI_MODEL_LIST (only /v1/responses IDs since built-in OpenAI defaults Responses on), and ANTHROPIC_* for Claude. They apply only to built-in providers (not custom providers), and API_KEY / PROXY_URL require a blank UI Proxy URL.

### Which models can LobeHub use through the gateway?

Choose a current catalog model that supports both the endpoint and the features LobeHub uses. Check /models and the model detail page for the exact ID, current rates, and capabilities; a family name such as GPT or Claude is not a compatibility guarantee. A client that lists a model has only read the ID, from its own configuration or from GET /v1/models; verify an actual request too.

### Models are listed, but requests fail with 400 or 404. What should I check?

Record the actual request path and error message, then check the exact model ID. A 400 can indicate invalid parameters, unsupported tools, or a model/endpoint mismatch; a 404 can indicate an incorrect path or missing resource, so it does not by itself establish that a model was retired. If the error says must be called via, use the named endpoint or select a model supported on the current endpoint. Do not add or remove /v1 or /chat/completions across all clients indiscriminately.

### Does this work from Mainland China?

Yes. The gateway is reachable from Mainland China without a VPN, and the configuration is identical to the global setup.

### How do I debug a 401/402/403/429?

Start from what your client received: the status, the error body and the X-Request-ID header. A 401 (missing, unknown, revoked or expired key), a 402 (wallet balance, or the key's maxSpend cap) and a 429 from your key's or account's rate limits are refused before any model is called, so they never appear in Dashboard → Logs — nor does a 400 or 404 for a wrong model ID or endpoint. For 401, check that the full key is sent and still active in Dashboard → API Keys; for 402, top up or raise the key's maxSpend; for a 403, keep the full error body. For 429, back off and retry later; a 429 that does show up in Logs came back from upstream after the gateway's retries. Keep the request_id and follow the error-codes reference.

## See also

- All integration guides: https://router.one/integrations
- Debug API errors in LobeHub: https://router.one/llm-api-error-codes
- API compatibility: endpoints and supported features: https://router.one/facts/api-compatibility.md
- Responses API setup and limits: https://router.one/codex-responses-api
- Cline setup: https://router.one/integrations/cline
- Aider setup: https://router.one/integrations/aider
- Open WebUI setup: https://router.one/integrations/open-webui
- LibreChat setup: https://router.one/integrations/librechat
- NextChat setup: https://router.one/integrations/nextchat
- Responses API vs Chat Completions vs Messages: https://router.one/responses-api-vs-chat-completions
- Tool-calling API requirements: https://router.one/llm-tool-calling
- API key budgets and model allowlists: https://router.one/llm-api-key-budgets
- LobeHub docs: Using Multiple Model Providers: https://lobehub.com/docs/usage/providers
- LobeHub docs: Model Provider Environment Variables: https://lobehub.com/docs/self-hosting/environment-variables/model-provider
- LobeHub v2.3.7 release: https://github.com/lobehub/lobehub/releases/tag/v2.3.7
- Model reliability and rolling error rates: https://router.one/benchmarks/model-reliability
- API connection and Invalid URL troubleshooting: https://router.one/api-connection-troubleshooting
- LLM API gateway overview: https://router.one/llm-api-gateway
- OpenAI-compatible API: https://router.one/openai-compatible-api
- API docs: https://router.one/docs
- Canonical page: https://router.one/integrations/lobehub
- Models and per-model token rates: https://router.one/models (markdown: https://router.one/models.md)
- Pricing: https://router.one/pricing
- API docs (markdown): https://router.one/docs.md
- Company facts: https://router.one/facts/company.md
