# Kilo Code

Kilo Code is a VS Code agent. It has an **OpenAI Compatible** provider. Set that provider to the exchange, and Kilo Code sends its requests there.

## Before you start

- A workspace with a balance and a `spend` key. See [API keys](https://inference.ai.exchange/docs/keys.md).
- VS Code with Kilo Code installed.

## 1. Choose the provider

Open the provider settings of Kilo Code. Choose the **OpenAI Compatible** provider.

## 2. Set the base URL

The URL ends in `/v1`, because Kilo Code adds `/chat/completions` to it.

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

## 3. Paste the key

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

## 4. Set the model

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

```
liquid.auto
```

## 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).
- 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`                                   | Keep `/v1` at the end of the base 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

- [Roo Code](https://inference.ai.exchange/docs/connect-roo-code.md): a VS Code agent with the same provider type.
- [Cline](https://inference.ai.exchange/docs/connect-cline.md): another VS Code agent that uses the OpenAI format.
- [Purchasing rules](https://inference.ai.exchange/docs/rules.md): cost caps and service floors.
