> For the complete documentation index, see [llms.txt](https://docs.tensorx.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorx.ai/chat-interfaces/lobechat.md).

# LobeChat

[LobeChat](https://lobehub.com/) is an open-source, modern-design ChatGPT/LLM UI. Connect it to TensorX using the OpenAI-compatible configuration.

## Prerequisites

* LobeChat installed (self-hosted or local)
* TensorX API key from [app.tensorx.ai](https://app.tensorx.ai)

## Configuration Options

### Option 1: Environment Variables (Recommended for Self-Hosted)

Set these environment variables when deploying LobeChat:

```bash
# Required
OPENAI_API_KEY=your-tensorx-api-key
OPENAI_PROXY_URL=https://api.tensorx.ai/v1

# Optional: Customize available models
OPENAI_MODEL_LIST=-all,+z-ai/glm-5.3,+z-ai/glm-5.3-flash,+qwen/qwen3.8-flash-next
```

### Option 2: UI Configuration

1. Open LobeChat Settings (gear icon)
2. Navigate to **AI Service Provider** > **OpenAI**
3. Configure:
   * **API Key**: Your TensorX API key
   * **API Proxy URL**: `https://api.tensorx.ai/v1`
4. Save settings

## Docker Deployment

Deploy LobeChat with TensorX configuration:

```yaml
# docker-compose.yml
version: '3.8'
services:
  lobe-chat:
    image: lobehub/lobe-chat
    ports:
      - "3210:3210"
    environment:
      - OPENAI_API_KEY=your-tensorx-api-key
      - OPENAI_PROXY_URL=https://api.tensorx.ai/v1
      - OPENAI_MODEL_LIST=-all,+z-ai/glm-5.3,+z-ai/glm-5.2,+z-ai/glm-5.3-flash,+qwen/qwen3.8-flash-next
```

Run with:

```bash
docker-compose up -d
```

## Vercel Deployment

When deploying to Vercel, set these environment variables in your project settings:

| Variable            | Value                                                             |
| ------------------- | ----------------------------------------------------------------- |
| `OPENAI_API_KEY`    | Your TensorX API key                                              |
| `OPENAI_PROXY_URL`  | `https://api.tensorx.ai/v1`                                       |
| `OPENAI_MODEL_LIST` | `-all,+z-ai/glm-5.3,+z-ai/glm-5.3-flash,+qwen/qwen3.8-flash-next` |

## Model List Configuration

The `OPENAI_MODEL_LIST` environment variable controls available models:

* Use `+model-name` to add a model
* Use `-model-name` to hide a model
* Use `-all` to disable all default models first
* Use `model_name=Display Name` to customize display names

Example configurations:

```bash
# Only TensorX models
OPENAI_MODEL_LIST=-all,+z-ai/glm-5.3,+z-ai/glm-5.2,+z-ai/glm-5.3-flash,+qwen/qwen3.8-flash-next

# With custom display names
OPENAI_MODEL_LIST=-all,+z-ai/glm-5.3=GLM 5.3,+z-ai/glm-5.3-flash=z-ai/glm-5.3-flash
```

## Model selection

Call `GET /v1/models` with your TensorX API key and use one of the returned IDs. If the integration depends on a capability or token limit, query `GET /v1/model/info` before selecting the model. See [Models](/api-reference/models.md) for examples.

***

## Troubleshooting

### Empty responses

Check that `OPENAI_PROXY_URL` includes `/v1` at the end.

### Models not appearing

Verify `OPENAI_MODEL_LIST` syntax:

* Each model should be prefixed with `+`
* Use commas without spaces to separate models

### Authentication errors

Ensure your TensorX API key is valid and has available credits.

## Resources

* [LobeChat Documentation](https://lobehub.com/docs)
* [LobeChat GitHub](https://github.com/lobehub/lobe-chat)
* [TensorX API Reference](/api-reference/overview.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tensorx.ai/chat-interfaces/lobechat.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
