# Open WebUI

Open WebUI is a self-hosted chat front end. Add the exchange as an OpenAI API connection. Each model on the book then shows in the model picker. The exchange auctions each request, sets a cap before the first token and charges for the measured use.

## Before you start

- A workspace with a balance and a `spend` key. See [API keys](https://inference.ai.exchange/docs/keys.md).
- An Open WebUI server that you can configure.

## 1. Add a connection

Open **Settings → Connections → OpenAI API**. Add a connection and enter:

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

The URL ends in `/v1`.

## 2. Paste the key

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

Save the connection. Open WebUI reads `GET /v1/models` from the exchange and lists every model name in the picker.

## Notes

- 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).
- `liquid.auto` has a cap of its own. For other purchasing rules, use a preset. 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.                          |
| The model picker is empty.              | Check the base URL and the key. Open WebUI reads the list with the same key.   |
| `404`                                   | Keep `/v1` at the end of the base URL.                                         |
| 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

- [Cherry Studio](https://inference.ai.exchange/docs/connect-cherry-studio.md): a desktop chat client with the same provider type.
- [Market data](https://inference.ai.exchange/docs/market.md): models and live offers.
- [Purchasing rules](https://inference.ai.exchange/docs/rules.md): models, strategy and limits, and presets.
