LobeChat
LobeChat is an open-source chat client that can use any OpenAI-compatible service as a provider. Point it at MirAPI to chat with models from the catalog, with usage billed against your prepaid MirAPI balance.
What you need
Section titled “What you need”| Element | Value |
|---|---|
| Base URL | https://api.mirapi.ai/v1 |
| API key | Your MirAPI key (sk-...) |
| Model | deepseek-chat |
LobeChat appends /chat/completions (and other OpenAI paths) to the base URL itself, so the value must end in /v1. Do not add the chat path.
Configure
Section titled “Configure”Option A — Docker / self-hosted
Section titled “Option A — Docker / self-hosted”Set the proxy URL as an environment variable when you start the server:
OPENAI_PROXY_URL="https://api.mirapi.ai/v1"LobeChat routes its OpenAI provider through this address. Then create or select an OpenAI provider in the UI and enter your MirAPI key (sk-...).
Option B — In-app
Section titled “Option B — In-app”With the hosted or desktop app, set the proxy address in the UI instead:
- Open Settings → Language Model → OpenAI.
- Set Proxy address to:
https://api.mirapi.ai/v1- Enter your MirAPI key (
sk-...) as the API key. - Enable
deepseek-chatin the model list (add it manually if the list is empty).
Verify with a message
Section titled “Verify with a message”Start a conversation with deepseek-chat and send:
Reply with exactly: connected to MirAPIThe reply should contain connected to MirAPI. If you get an error instead, see Troubleshooting.
Protocol variants
Section titled “Protocol variants”LobeChat ships an OpenAI provider plus Anthropic and Google providers. Each talks to a different MirAPI endpoint:
| Provider | MirAPI base URL | Auth accepted |
|---|---|---|
| OpenAI | https://api.mirapi.ai/v1 |
Authorization: Bearer |
| Anthropic | https://api.mirapi.ai |
x-api-key or Authorization: Bearer |
| Google (Gemini) | https://api.mirapi.ai or https://api.mirapi.ai/v1beta |
x-goog-api-key or ?key= |
The OpenAI provider is the simplest to set up and covers most models in the catalog. All three protocols accept the same MirAPI key; only the auth header that carries it differs. See OpenAI compatibility for details.
Errors and billing
Section titled “Errors and billing”- 401: the key is missing, invalid, or unknown. Check the API key in the provider settings.
- 403: the key is valid but the request was refused. The model is outside the key’s whitelist, a quota or IP allowlist applies, or the balance is empty. Top up in the Platform (
https://platform.mirapi.ai) and retry; the same key works again immediately. - 413 / 429 / 500: 413 means the payload is too large. 429 means you are rate limited; retry with exponential backoff, since responses carry no
Retry-Afterheader. 500 is a server error, and idempotent requests are safe to retry.
Chat is billed per token (input, output, cache read) at the model’s listed price, not per request; see Billing for the pricing model. Every error message ends with a request ID. Attach it to any support ticket.
Troubleshooting
Section titled “Troubleshooting”- Keep
/v1in the proxy URL. LobeChat appends/chat/completions, so adding it yourself produces a doubled path. - Use exact model IDs. Model names come verbatim from
GET /v1/models. Enable only models your key is whitelisted for. OPENAI_PROXY_URLvs. the in-app setting.OPENAI_PROXY_URLconfigures the OpenAI provider on a self-hosted (Docker) deployment, while the in-app proxy address applies to the hosted or desktop app. If requests keep going elsewhere, fix the one that matches your setup and restart.- Model list is empty. If no models appear after saving, the proxy URL or key is wrong and the
/v1/modelscall is failing. Check the request in the Platform billing log.