Connect Crush to ModelGo: Setup & Troubleshooting

Crush is Charmbracelet's terminal AI coding agent. It connects to ModelGo through an OpenAI-compatible provider. Before you start, create an API key in the ModelGo console and pick a logical model name from the Model Catalog.

1. Install

bash
brew install charmbracelet/tap/crush
crush --version

You can also use npm install -g @charmland/crush; on Windows run winget install charmbracelet.crush.

2. Add a ModelGo provider

crushrc is a Bash script, and provider add / model add are Crush builtins written inside it, not terminal commands. First set the key in your terminal:

bash
export MODELGO_API_KEY="mgk_your_api_key"

Then add the following to the global ~/.config/crush/crushrc (Windows: %USERPROFILE%\.config\crush\crushrc; for a single project, .crushrc in the project root):

bash
provider add modelgo --type openai-compat \
  --base-url "https://api.modelgo.ai/v1" \
  --api-key "$MODELGO_API_KEY"
model add modelgo/your-model-id --name "your-model-id"

$MODELGO_API_KEY is expanded from the environment when Crush loads crushrc. Do not append /chat/completions to the Base URL.

3. Start and verify

Run crush, pick the ModelGo model in the model selector, and send a request. To check the key and the models it can call:

bash
curl https://api.modelgo.ai/v1/models \
  -H "Authorization: Bearer $MODELGO_API_KEY"

Troubleshooting

  • Provider missing: check the crushrc path and file name, then restart Crush; project configuration overrides the global one.
  • 401 / 403: make sure MODELGO_API_KEY is set and the model is a callable logical model name.
  • 404: the Base URL must be https://api.modelgo.ai/v1.

Related docs