Crush setup: API key, Base URL, and models
Install Crush, configure BetterToken in crushrc with an API Key and Base URL, select a model, and troubleshoot No providers configured.
Connect Crush to BetterToken with an openai-compat provider in crushrc. In macOS testing with a GPT model, Crush 0.98.2 completed three out of three cold-start text requests and a file-reading tool call through /v1/chat/completions.
Key settings
| Field | Value |
|---|---|
| API Key | BetterToken API Key, passed with --api-key |
| Base URL | https://bettertoken.ai/v1, passed with --base-url |
| Model | bettertoken/YOUR_MODEL_ID |
| Provider type | openai-compat |
| Configuration file | ~/.config/crush/crushrc |
Prerequisites
- Homebrew for the installation command below
- A BetterToken API Key: register and get one
- A Model ID and its context limit from the model plaza
Install
Use the Homebrew command from the official Crush repository:
brew install charmbracelet/tap/crushcrush --versionManual setup
Set your BetterToken API Key in the terminal that will run Crush:
export BETTERTOKEN_API_KEY="YOUR_API_KEY"Create ~/.config/crush/crushrc using the recommended Bash configuration format. Replace every YOUR_MODEL_ID and set --context-window to your selected model’s documented limit. The example’s 128000 is a client declaration, not a verified BetterToken model limit.
provider add bettertoken --type openai-compat --base-url "https://bettertoken.ai/v1" --api-key "$BETTERTOKEN_API_KEY"model add bettertoken/YOUR_MODEL_ID --name "YOUR_MODEL_ID" --context-window 128000model large bettertoken/YOUR_MODEL_IDmodel small bettertoken/YOUR_MODEL_IDpermissions allow viewSave these commands in crushrc; Crush runs them when it starts. permissions allow view permits the file-viewing tool. The older JSON configuration format is deprecated upstream but still works; its text request also passed in testing.
Verify the connection
Run from your project in the same terminal:
crush run "Reply with only: OK"Check that the final answer is OK. For file access, ask Crush to read a known file in your project and check both the view tool result and final answer.
Switch models
Add another model with model add, update the model large and model small selections in crushrc, and start a new run.
Common errors
| Symptom | What to check |
|---|---|
No providers configured | Crush reports this before sending a request when no usable provider is loaded. Check the location and contents of crushrc, including project configuration that may override it. |
401 | Export BETTERTOKEN_API_KEY before starting Crush and check its value. |
| No explicit models in the config | With only a provider configured, Crush discovered models through /v1/models in testing. Explicit model add entries let you name the model used by this example. |
| File access needs approval | Check permissions allow view in the loaded configuration. |
Related
Technical details
The tested openai-compat provider sent generation requests to /v1/chat/completions. Model discovery used /v1/models when explicit model entries were omitted.

