# LobeHub

LobeHub is a workspace for teams of AI agents. It has no Liquid Inference provider yet. Use its OpenAI provider with the exchange as the proxy URL.

## Before you start

- A workspace with a balance and a `spend` key. See [API keys](https://inference.ai.exchange/docs/keys.md).
- A LobeHub workspace where you can change **App Settings**.

## 1. Enable the OpenAI provider

Open **App Settings → AI Providers** and choose **OpenAI**.

```
OpenAI
```

## 2. Add the key and the proxy URL

```
sk-liquid-...
```

```
https://router.inference.ai.exchange/v1
```

The URL ends in `/v1`. Select **Check** to test the connection.

## 3. Add the model

Add the model by name. To get the current names, use `GET /v1/models`. See [Market data](https://inference.ai.exchange/docs/market.md).

```
liquid.auto
```

Choose the model in the settings of an agent.

### Self-hosted LobeHub

A server that you host can set the same values in its environment:

- `OPENAI_PROXY_URL` is the endpoint.
- `OPENAI_API_KEY` is the key.
- `OPENAI_MODEL_LIST` sets the models that the picker shows.

## Notes

- LobeHub sends the OpenAI SDK's user agent. The receipts name the client `openai-sdk`, not LobeHub.
- The exchange sets a cap on each request. It is in the `x-liquid-cap-usd` response header. To limit total spend, set a spending limit on the key. See [API keys](https://inference.ai.exchange/docs/keys.md).
- Scheduled agents can make many requests while you are away. Set a spending limit on the key for them.
- Use a preset for other purchasing rules. See [Purchasing rules](https://inference.ai.exchange/docs/rules.md).

## Troubleshooting

| Symptom                                 | Cause and fix                                                                  |
| --------------------------------------- | ------------------------------------------------------------------------------ |
| `401`                                   | The key is wrong, revoked or expired. Paste it again.                          |
| `404` or an empty answer                | Keep `/v1` at the end of the proxy URL.                                        |
| `model_not_found`                       | The model is not on the book. Use an exact name from `GET /v1/models`.         |
| A request is refused for lack of funds. | The workspace balance cannot cover the cap. Add funds on the **Credits** page. |

See [Errors](https://inference.ai.exchange/docs/errors.md) for the error codes.

## Next steps

- [Open WebUI](https://inference.ai.exchange/docs/connect-open-webui.md): a self-hosted chat front end with the same setup.
- [Purchasing rules](https://inference.ai.exchange/docs/rules.md): models, strategy and limits, and presets.
- [Errors](https://inference.ai.exchange/docs/errors.md): the error format and what each code means.
