Docs

LobeChat

A self-hosted LobeChat needs three environment variables to speak to Kunavo: a key, a proxy URL, and the list of model ids you want in the picker.

Esta documentação está em inglês. Para um guia de início rápido em português, veja:Guia em português — Claude API no Brasil

Set OPENAI_API_KEY to your sk-kn-… key, OPENAI_PROXY_URL to https://api.kunavo.com/v1, and name the ids you want in OPENAI_MODEL_LIST. Claude, GPT and Gemini then share one picker and one balance.

.env
OPENAI_API_KEY=sk-kn-...
OPENAI_PROXY_URL=https://api.kunavo.com/v1

# LobeChat only shows models it knows about, so name the ones you want.
OPENAI_MODEL_LIST=claude-sonnet-4-6,claude-haiku-4-5,claude-opus-5,gpt-5-4
The /v1 suffix belongs in OPENAI_PROXY_URL. LobeChat forwards to the URL you give it rather than reconstructing the OpenAI path, which is why its own .env.example writes the default as https://api.openai.com/v1 — suffix included.

Step by step

  1. Create a key at /app/keys and copy it — it is shown once.
  2. Add the three variables to your deployment's environment — the .env file for a bare install, or the environment block for Docker.
  3. Restart the container so the new environment is read.
  4. Open LobeChat, start a session and pick one of the ids you listed in OPENAI_MODEL_LIST.
docker-compose.yml
services:
  lobe-chat:
    image: lobehub/lobe-chat
    ports:
      - "3210:3210"
    environment:
      OPENAI_API_KEY: sk-kn-...
      OPENAI_PROXY_URL: https://api.kunavo.com/v1
      OPENAI_MODEL_LIST: claude-sonnet-4-6,claude-haiku-4-5,gpt-5-4

LobeChat's own reference for these variables is the model-provider environment variables page.

Verify before you debug the container

One request settles whether a failure is the endpoint, the key, or LobeChat's model list. If this returns a JSON list of model ids, the same URL and key work — and an empty picker after that is OPENAI_MODEL_LIST, not the endpoint.

# Settles whether a failure is the endpoint, the key, or LobeChat.
curl -sS https://api.kunavo.com/v1/models \
  -H "Authorization: Bearer sk-kn-..."

Which ids to list

Every text model on Kunavo can go in OPENAI_MODEL_LIST — the full list is on the models page and comes back live from GET /v1/models. Rates are USD per 1M tokens, input / output.

Model idKunavo in / outWhere it fits
claude-haiku-4-5$0.40 / $2.00Cheapest Claude — long chat sessions where cost per turn matters
claude-sonnet-4-6$1.20 / $6.00The default balance of quality and price
claude-opus-5$2.00 / $10.00Highest-quality Claude tier
gpt-5-4$1.00 / $6.00Same key, different family — no second provider to configure
A chat client re-sends the whole conversation on every turn, so token spend in LobeChat grows with the length of the session rather than staying flat per message — prompt caching is the lever that matters most on that shape. Billing is per token from a prepaid balance with no monthly fee, so an idle month costs nothing; details in billing.

FAQ

How do I point LobeChat at a custom OpenAI-compatible endpoint?

Set OPENAI_PROXY_URL to the endpoint's base URL and OPENAI_API_KEY to your key in the deployment's environment — for Kunavo that is https://api.kunavo.com/v1. LobeChat's own .env.example uses https://api.openai.com/v1 as the example value for that variable, which is the reminder that the /v1 suffix belongs in the value rather than being appended for you.

Why does my custom model not appear in LobeChat's model list?

LobeChat renders the models it has been told about rather than everything the endpoint can serve, so a model id that is not in its list is invisible even when the endpoint answers for it. Name the ids in OPENAI_MODEL_LIST as a comma-separated list. LobeChat's documentation also defines a prefix syntax on that variable — a leading + adds a model, a leading - hides one, and model_name=display_name renames one in the picker.

Can LobeChat use Claude models through the OpenAI provider?

Yes, when they are served over an OpenAI-compatible endpoint. LobeChat's OpenAI provider sends the model id to whatever OPENAI_PROXY_URL names, so a Claude id is resolved at the gateway rather than inside LobeChat, and no Anthropic credentials are involved. On Kunavo the Claude, GPT and Gemini ids sit behind one key, so adding a family means adding an id to OPENAI_MODEL_LIST.

Does LobeChat's image generation work through a custom endpoint?

That depends on which routes the endpoint implements, not on LobeChat. The chat provider needs /v1/chat/completions; image generation is a separate route. Kunavo implements image and video generation on its own endpoints, documented under images and video, so the reliable pattern is to use LobeChat for chat and call the media endpoints directly rather than assuming one provider setting covers both.