# Crush

Source: https://docs.aicentos.com/en/clients/crush

Language: en

> Use aicentos in Crush — add a custom provider through crush.json

Crush is a terminal coding agent from Charmbracelet, written in Go, that lets you declare any OpenAI-compatible custom provider in `crush.json`. Point base\_url at aicentos and the models aicentos offers become usable right in the TUI.

## Prerequisites

First create a dedicated key for Crush on the console's "API Keys" page (naming it `crush` makes usage easier to track):

* Console: [https://aicentos.com](https://aicentos.com)
* Create a key: [https://aicentos.com/keys](https://aicentos.com/keys)
* Top up when the balance runs out: [https://aicentos.com/wallet](https://aicentos.com/wallet)

Confirm Crush is installed:

```bash
crush --version
```

## Configuration to fill in

| Field       | Value                                              |
| ----------- | -------------------------------------------------- |
| Config file | `~/.config/crush/crush.json`                       |
| type        | `openai-compat`                                    |
| base\_url   | `https://aicentos.com/v1`                          |
| api\_key    | `$AICENTOS_API_KEY`                                |
| Model       | A model name from the Model Gallery in the console |

## Setup steps

### 1. Set the API Key environment variable

```bash
export AICENTOS_API_KEY="sk-your-API-Key"
```

To persist it, add the line to `~/.zshrc` or `~/.bashrc`, then `source` the file.

### 2. Edit crush.json

The global configuration file lives at `~/.config/crush/crush.json` (`%USERPROFILE%\AppData\Local\crush\crush.json` on Windows); a `.crush.json` or `crush.json` in the project root overrides the global configuration.

Write:

```json
{
  "$schema": "https://charm.land/crush.json",
  "providers": {
    "aicentos": {
      "type": "openai-compat",
      "base_url": "https://aicentos.com/v1",
      "api_key": "$AICENTOS_API_KEY",
      "models": [
        {
          "id": "gpt-4o",
          "name": "GPT-4o",
          "context_window": 128000,
          "default_max_tokens": 8192,
          "can_reason": true
        }
      ]
    }
  }
}
```

`models[].id` must exactly match the model ID on the endpoint side — follow the Model Gallery in the console; see [Supported models](https://docs.aicentos.com/en/billing/models-list).

### 3. Select the model

After starting `crush`, press `Ctrl+L` in the TUI (or type `/model`) and confirm you can see `aicentos` and its models.

## Test

Do a quick check in non-interactive mode:

```bash
crush run "Answer in one sentence: what is 1+1?"
```

Add `--debug` when you need request logs. If you get a 404, check that `base_url` includes `/v1`.

## Notes

* **Do not set `type` to `openai`**. `openai` is for proxies that actually go through OpenAI (or Azure OpenAI); when pointing at a third-party compatible endpoint you must use `openai-compat`, otherwise you get model recognition errors or API errors.
* Enter `base_url` up to `/v1`, with no trailing slash.
* `api_key` supports `$VAR` and `$(command)` expansion; keep the key in an environment variable or a secrets file rather than hard-coding plain text.
* For an Anthropic-protocol endpoint (`type` set to `anthropic`), `base_url` should stop at `/api` — Crush appends `/v1/messages` itself, and you additionally need to declare `anthropic-version` in `extra_headers`.
* Known issue: with a custom provider, the token counter and cost statistics in the TUI may show 0; this does not affect actual requests or billing.
* To enable reasoning output, use `"can_reason": true` together with `"reasoning_effort"` for OpenAI-style models, and `"think": true` for Anthropic-style models.

## Related links

* Custom Provider documentation: [https://github.com/charmbracelet/crush](https://github.com/charmbracelet/crush)