Using 华烁云 in LobeChat

LobeChat is an open-source AI client that supports plugins, knowledge bases, and self-deployment, which can be used in the online version or deployed via Docker. It supports custom OpenAI-compatible endpoints, allowing integration with 华烁云. This article describes the configuration process.

Application Process

To integrate 华烁云 into LobeChat, first go to the 华烁云 Console to obtain your API Token for future use.

Get 华烁云 API Key

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

During the first application, there will be a free quota provided, allowing you to experience 华烁云's model services for free.

Configuring 华烁云

Go to LobeChat's Application Settings → Language Model, find the OpenAI card and enable it, then fill in:

Field Value Description
API Key Your 华烁云 Token Token copied from the console
API Proxy URL https://hsyunapi.hszl-bd.cn/v1 Must end with /v1
Client Request Mode Enabled Direct browser connection, Key does not pass through LobeChat server

LobeChat will 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://hsyunapi.hszl-bd.cn/v1 https://hsyunapi.hszl-bd.cn/v1/chat/completions Correct
https://hsyunapi.hszl-bd.cn/openai https://hsyunapi.hszl-bd.cn/openai/chat/completions Also usable
https://hsyunapi.hszl-bd.cn/openai/v1 https://hsyunapi.hszl-bd.cn/openai/v1/chat/completions 404 (/openai does not have /v1)
https://hsyunapi.hszl-bd.cn https://hsyunapi.hszl-bd.cn/chat/completions 404 (missing /v1)

LobeChat will automatically call /v1/models to fetch models. If 华烁云 returns many models, the interface may be lengthy, so it is recommended to manually fill in an allow list in "Model List → Custom Model Name," separated by commas. If you need to customize the display name, you can use =, formatted as MODEL_ID=Display Name.

Selecting Models

The model directory will continue to be updated. Prefer using the model list automatically loaded by the client; if manual entry is required, first request GET https://hsyunapi.hszl-bd.cn/v1/models to get the current model ID, then choose based on the context, image, and tool invocation capabilities supported by the client.

Verifying Integration

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

curl -X POST 'https://hsyunapi.hszl-bd.cn/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 it returns HTTP 403 used_up, it means the Token is valid but the balance is insufficient, and you can recharge at the console.

Advanced: Docker Self-Deployment

If you wish to deploy a private version for team use, you can start it with a single 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://hsyunapi.hszl-bd.cn/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 to use it, and team members do not need to fill in their own Keys. The complete explanation of the environment variables used above, such as OPENAI_API_KEY, OPENAI_PROXY_URL, OPENAI_MODEL_LIST, can be found in the LobeChat Model Provider Environment Variables Documentation. If using nginx for reverse proxy with HTTPS, be sure to add proxy_buffering off;, otherwise, streaming responses will be buffered. For more deployment forms, please refer to LobeChat Self-Deployment Guide and Docker Compose Deployment.

Frequently Asked Questions

Prompt 404 Not Found

This is usually due to the API proxy URL being written as .../openai/v1 or missing /v1. Change it to https://hsyunapi.hszl-bd.cn/v1.

Model List is Empty

Turn on the "Client Request Mode" switch; or manually fill in the model allow list in "Custom Model Name."

Prompt 401 Unauthorized

Please confirm that the API Key pasted is the 华烁云 Token (without the Bearer prefix and no extra spaces), and that the balance of the associated application is sufficient.

Learn More