Crush
Use aicentos in Crush — add a custom provider through crush.json
Last updated:
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
- Create a key: https://aicentos.com/keys
- Top up when the balance runs out: https://aicentos.com/wallet
Confirm Crush is installed:
crush --versionConfiguration 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
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:
{
"$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.
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:
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
typetoopenai.openaiis for proxies that actually go through OpenAI (or Azure OpenAI); when pointing at a third-party compatible endpoint you must useopenai-compat, otherwise you get model recognition errors or API errors. - Enter
base_urlup to/v1, with no trailing slash. api_keysupports$VARand$(command)expansion; keep the key in an environment variable or a secrets file rather than hard-coding plain text.- For an Anthropic-protocol endpoint (
typeset toanthropic),base_urlshould stop at/api— Crush appends/v1/messagesitself, and you additionally need to declareanthropic-versioninextra_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": truetogether with"reasoning_effort"for OpenAI-style models, and"think": truefor Anthropic-style models.
Related links
- Custom Provider documentation: https://github.com/charmbracelet/crush