LobeChat is an open-source ChatGPT-style frontend with custom OpenAI-compatible endpoints. Point it at 4AICode to use team balance and supported models.
Before you start
- Prepare
sk-4ai-...from Tokens. - Use
https://relay.4aicode.com/v1orhttps://relay.4aicode.net/v1.
Setup
Environment variables (self-hosted)
OPENAI_API_KEY=sk-4ai-xxxxxxxxxxxxxxxx
OPENAI_PROXY_URL=https://relay.4aicode.com/v1
Some LobeChat versions use OPENAI_API_BASE_URL / OPENAI_BASE_URL. The rule is the same: a 4AICode key plus a /v1 base URL.
UI settings
- Open Settings → Language models / OpenAI.
- Enter the API key and base URL (including
/v1). - Enable model IDs copied from the model catalog.
- Start a chat and confirm Usage.
Sample request
POST /v1/chat/completions HTTP/1.1
Host: relay.4aicode.com
Authorization: Bearer sk-4ai-xxxxxxxxxxxxxxxx
content-type: application/json
{
"model": "gpt-5.6-luna",
"messages": [{ "role": "user", "content": "ping" }]
}