Connect LobeChat to the private Morse API: set it up, pick a model, and check it works. Updated November 30, 2026.

Page: https://trymorse.ai/inference/docs/tools/lobechat

# Use LobeChat with a private API

Give [LobeChat](https://lobehub.com) the base URL `https://inference.trymorse.ai/v1` and a Morse API key. It calls the OpenAI API.

## Before you start

Make a key for LobeChat alone, with a spend limit, under **API keys** in the [console](https://console.trymorse.ai). Then one tool can't spend all your credits. See [Limit a key](https://trymorse.ai/inference/docs/authentication#limits).

You'll paste the key into LobeChat's provider settings.

## Set up LobeChat

1. Add Morse as a custom providerLobeChat is now named LobeHub. Open **Settings > Provider** and choose **Add Custom Provider**. Then:Set **Provider ID** to `morse`, and **Provider Name** to Morse.Set **Request Format** to **OpenAI**.Set **Proxy URL** to `https://inference.trymorse.ai/v1`, with `/v1`.Paste your key in **API Key**, and choose **Create**.Leave **Use Client Request Mode** off. It sends requests from your browser, which Morse's API refuses.
2. Add modelsChoose **Fetch models**, or **Add Model** and type `qwen/qwen3-coder` in **Model ID**. Set **Maximum Context Window** to 262,144, and turn **Support for Tool Calling** on, so LobeChat sends the model its tools.
3. Or set it on your own serverA self-hosted LobeChat reads Morse's details from its environment. These put Morse's models in place of OpenAI's:.env`OPENAI_API_KEY=sk_morse_... OPENAI_PROXY_URL=https://inference.trymorse.ai/v1 OPENAI_MODEL_LIST="-all,+qwen/qwen3-coder=Qwen3 Coder 480B A35B<262144:fc>,+moonshotai/kimi-k3.1-pro=Kimi K3.1 Pro<1048576:fc:vision>,+z-ai/glm-5.3=GLM 5.3<1048576:fc>,+deepseek/deepseek-v4-pro-0813=DeepSeek V4 Pro<1048576:fc>,+z-ai/glm-5.3-flash=GLM 5.3 Flash<1048576:fc:vision>"`In the model list, `fc` turns tool calls on, and the number is the model's context.

## Which model to pick

| Model | Context | Input / output | Why |
| --- | --- | --- | --- |
| `qwen/qwen3-coder` | 262.1K | $0.375 / $1.25 | Qwen's coding model. It doesn't reason, so it starts writing sooner. |
| `moonshotai/kimi-k3.1-pro` | 1M | $2 / $10 | Reasons, and reads images. |
| `z-ai/glm-5.3` | 1M | $1.40 / $4.40 | Reasons, and takes tools at TEE too. |
| `deepseek/deepseek-v4-pro-0813` | 1M | $1.32 / $3.96 | Reasons, at a lower price. |
| `z-ai/glm-5.3-flash` | 1M | $0.15 / $0.50 | Cheap and fast for small edits, and takes tools at TEE too. |

Prices are in dollars per million tokens, on each model's default endpoint. Every model is on the [models page](https://trymorse.ai/inference/models).

## Check it works

Under the provider, choose **Check** beside **Connectivity Check**. Then start a chat, pick `qwen/qwen3-coder` under Morse, and send a message. The response streams in from Morse.

## Keep it private

Set a privacy floor on LobeChat's key to hold it to a tier, such as TEE. Without a floor, a request runs on its model's default privacy tier. The floor only decides which endpoints serve the requests. See [Privacy tiers](https://trymorse.ai/inference/docs/privacy-tiers) and [Provider routing](https://trymorse.ai/inference/docs/provider-routing).

On a plain API call, TLS ends inside Morse's door, an attested enclave, which seals the request before the relay receives it. A plain client checks the door's certificate, not its attestation. To check the attestation yourself, see [Sealed API keys](https://trymorse.ai/inference/docs/sealed-api-keys).

## If something goes wrong

| What you see | What to do |
| --- | --- |
| The check fails with a network error | Turn **Use Client Request Mode** off, and check that the key is pasted in full. Without a key, LobeChat calls from your browser. |
| `401 invalid_api_key` | Check the key you gave LobeChat in full, and that it isn't revoked. |
| `402 insufficient_balance` or `key_spend_limit_reached` | Add credits, or raise the key's spend limit. A request holds credit for its output limit before it starts: see [Holds](https://trymorse.ai/inference/docs/pricing#holds). |
| `404 model_not_found` | Use a model's id exactly as the table above writes it, with the part before the slash. |

Every code is in [Error codes](https://trymorse.ai/inference/docs/api/errors). For other tools, see [Tools and coding agents](https://trymorse.ai/inference/docs/tools).
