Coding agents

Crush

Connect Charm Crush to RealRelay.ai as an OpenAI-compatible provider: install it, add the provider and models in crushrc, check the connection and switch models.

Protocol
OpenAI Chat Completions
Base URL
https://www.realrelay.ai/v1
Official docs
github.com
Checked against the tool’s docs
2026-10

Overview

Crush is a coding agent for the terminal from Charm. It works in your project, edits files and runs commands with your permission. You add RealRelay.ai to it as an openai-compat provider, and it sends requests to the Chat Completions endpoint, /v1/chat/completions.

  • An API key from the API keys page of the console.

  • The base URL with /v1 at the end. Crush appends /chat/completions to it.

  • A model ID exactly as GET /v1/models lists it, for example z-ai/glm-5.2. The model needs tool calling.

This guide uses crushrc, the configuration format Crush has used since v0.88. The older crush.json still loads but is deprecated and gets no new options. If Crush does not recognise the provider command, update it first.

Install

Use a package manager listed in Crush's README.

Homebrew (macOS · Linux)
brew install charmbracelet/tap/crush
npm
npm install -g @charmland/crush
Windows PowerShell
1winget install charmbracelet.crush2# or3scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git4scoop install crush
Arch Linux · Nix · FreeBSD
yay -S crush-binnix run github:numtide/nix-ai-tools#crushpkg install crush

If crush --version prints a version number, the install worked.

Configure

  1. 1

    Save your key in an environment variable

    The config reads the key from REALRELAY_API_KEY, so the file itself holds no secret.

    ~/.zshrc · ~/.bashrc
    export REALRELAY_API_KEY="sk-***"

    Run source ~/.zshrc, or open a new terminal.

    Windows PowerShell
    [Environment]::SetEnvironmentVariable("REALRELAY_API_KEY", "sk-***", "User")

    Close and reopen the terminal so it sees the new variable.

  2. 2

    Add the provider and a model to crushrc

    Create the file if it does not exist. On Windows the global file is %USERPROFILE%.config\crush\crushrc. For one project only, put the same lines in .crushrc at the project root; project files take priority over the global one.

    ~/.config/crush/crushrc
    1provider add realrelay \2  --name "RealRelay.ai" \3  --type openai-compat \4  --base-url "https://www.realrelay.ai/v1" \5  --api-key "${REALRELAY_API_KEY:?set REALRELAY_API_KEY}"67model add realrelay/z-ai/glm-5.2 \8  --name "z-ai/glm-5.2" \9  --context-window 200000 \10  --default-max-tokens 320001112model large realrelay/z-ai/glm-5.213model small realrelay/z-ai/glm-5.2
  • A crushrc is a Bash script with Crush commands. Crush runs it with its own built-in shell, so the same file works on Windows.

  • --type openai-compat is the type Crush documents for OpenAI-compatible services that are not OpenAI itself. Do not use openai.

  • ${REALRELAY_API_KEY:?…} stops with a clear message if the variable is not set, instead of sending an empty key.

  • model add registers the model with its context window and default output limit. RealRelay.ai's model list does not include these numbers, so Crush cannot work them out itself.

  • model large is the model Crush starts with. model small handles light background tasks; pointing it at RealRelay.ai keeps every request on the same key.

Verify

  1. 1

    Call the endpoint directly

    Run this with your key. A JSON reply with a choices array means the address, key and model work.

    Terminal
    1curl -sS "https://www.realrelay.ai/v1/chat/completions" \2  -H "Authorization: Bearer sk-***" \3  -H "content-type: application/json" \4  -d '{"model": "z-ai/glm-5.2", "max_tokens": 16, "messages": [{"role": "user", "content": "Reply with OK"}]}'
  2. 2

    Check that Crush sees the model

    The first command should list the model under realrelay. The second sends one message and prints the reply.

    Terminal
    crush models realrelaycrush run -m "realrelay/z-ai/glm-5.2" "Reply with OK"
  3. 3

    Start Crush in a project

    Run crush in your project folder and send a short message. The request appears in the console's usage logs.

Models

Press ctrl+l in Crush to open the model picker and switch between the models you registered. To add a model, add another model add line with its ID and limits, then restart Crush.

~/.config/crush/crushrc
1model add realrelay/<another-model-id> \2  --name "<another-model-id>" \3  --context-window 128000 \4  --default-max-tokens 16000

The numbers in these examples are safe starting values. Set --context-window and --default-max-tokens to the real limits from the model's catalog page. To change the models Crush starts with, edit the two slot lines:

~/.config/crush/crushrc
model large realrelay/<model-id>model small realrelay/<faster-model-id>

If you register no models, Crush fills the list from GET /v1/models on its own. That list has no limits, so registering the models you use is the better choice. See Choosing a model for models that suit an agent.

Troubleshooting

  • Crush stops with "set REALRELAY_API_KEY". The variable is not set in the terminal that started Crush. Export it, or open a new terminal after setting it.

  • 401. The key is wrong or was revoked. Create a new one on the API keys page and update the variable.

  • 404. The base URL is missing /v1, or it already ends in /chat/completions. Use the address ending in /v1.

  • Model not found. The part after realrelay/ must match the ID from GET /v1/models exactly, including its own prefix such as z-ai/.

  • Changes to crushrc have no effect. A project .crushrc or crushrc overrides the global file, and a leftover crush.json in the same folder is merged in. Restart Crush after editing. Run it with debug logging to see what loaded:

    Terminal
    crush --debugcrush logs --tail 200
  • Context errors in long sessions. --context-window is larger than the model's real window. Lower it to the value on the catalog page.

  • The agent describes changes but does not make them. The model is not calling tools. Pick a model that supports tool calling.