Using 知数云 in LobeChat

LobeChat is an open-source AI client that supports plugins, knowledge bases, and self-hosting, and can be used online or deployed with Docker. It supports custom OpenAI-compatible endpoints, so it can connect to 知数云. This article introduces the configuration process.

Application Process

To connect 知数云 in LobeChat, first go to the 知数云 Console, obtain your API Token, and keep it for later use.

Get 知数云 API Key

If you have not yet logged in or registered, you will be automatically redirected to the login page to register and log in. After logging in or registering, you will automatically return to the current page.

A free quota is provided upon the first application, allowing you to experience 知数云's model services for free.

Configure 知数云

Go to App Settings → Language Models in LobeChat, find and enable the OpenAI card, then fill in:

Field Value Description
API Key Your 知数云 Token The Token copied from the console
API Proxy URL https://xapi.zhishuyun.com/v1 Must end with /v1
Client Request Mode Enable Browser direct connection; the Key does not pass through the LobeChat server

LobeChat OpenAI Provider Configuration Interface

When using the Chat Completions API, please keep the Responses API Specification disabled.

LobeChat does not automatically append /v1 to the Base URL. The request path is directly {API Proxy URL}/chat/completions:

API Proxy URL Actual Request Result
https://xapi.zhishuyun.com/v1 https://xapi.zhishuyun.com/v1/chat/completions Correct
https://xapi.zhishuyun.com/openai https://xapi.zhishuyun.com/openai/chat/completions Also works
https://xapi.zhishuyun.com/openai/v1 https://xapi.zhishuyun.com/openai/v1/chat/completions 404 (there is no /v1 under /openai)
https://xapi.zhishuyun.com https://xapi.zhishuyun.com/chat/completions 404 (/v1 is missing)

LobeChat calls /v1/models by default to automatically fetch models. When 知数云 returns many models, the interface can become very long. It is recommended to manually enter an allow list in “Model List → Custom Model Names”, separated by English commas. If you need a custom display name, you can use =, in the format MODEL_ID=Display Name.

Select Models

The model catalog is continuously updated. Prioritize using the model list automatically loaded by the client; when manual entry is needed, first request GET https://xapi.zhishuyun.com/v1/models to obtain the current model IDs, then select according to the context, image, and tool-calling capabilities supported by the client.

Verify the Integration

If you are unsure whether the issue is in LobeChat or the network, you can first use curl to directly verify the endpoint (replace {token} with your Token):

curl -X POST 'https://xapi.zhishuyun.com/v1/chat/completions' \
  -H 'Authorization: Bearer {token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "MODEL_ID",
    "messages": [{"role": "user", "content": "ping"}]
  }'

Returning an OpenAI-compatible chat.completion object indicates that both the Token and endpoint are ready; if HTTP 403 used_up is returned, it means the Token is valid but the balance is insufficient. Simply top up in the console.

Advanced: Docker Self-Hosting

If you want to deploy a private version for team use, you can start it with a one-line Docker command (replace {token} with your Token):

docker run -d \
  --name lobe-chat \
  -p 3210:3210 \
  -e OPENAI_API_KEY={token} \
  -e OPENAI_PROXY_URL=https://xapi.zhishuyun.com/v1 \
  -e ACCESS_CODE=your-secret-password \
  -e OPENAI_MODEL_LIST="MODEL_ID" \
  lobehub/lobe-chat:latest

Open http://your-server-IP:3210, enter ACCESS_CODE, and you can use it. Team members do not need to enter their own Keys. For complete descriptions of environment variables used above, such as OPENAI_API_KEY, OPENAI_PROXY_URL, and OPENAI_MODEL_LIST, see the LobeChat Model Provider Environment Variables Documentation. If using an nginx reverse proxy with HTTPS, be sure to add proxy_buffering off;, otherwise streaming responses will be buffered. For more deployment options, refer to LobeChat Self-Hosting Getting Started and Docker Compose Deployment.

Frequently Asked Questions

404 Not Found

Usually, the API Proxy URL was written as .../openai/v1 or /v1 was omitted. Change it to https://xapi.zhishuyun.com/v1.

The Model List Is Empty

Enable the “Client Request Mode” toggle; or manually enter a model allow list in “Custom Model Names”.

401 Unauthorized

Please confirm that the API Key contains the 知数云 Token (without the Bearer prefix and without extra spaces), and that the balance of the associated application is sufficient.

Learn More