Skip to content

Crush

Add Vidai to Crush as a provider and every call it makes is governed: checked against your policies, charged to your team and recorded in Request logs. Crush can speak the OpenAI or the Anthropic format to the gateway, and the gateway translates either one to every provider, so Crush can work with Claude, Gemini or GPT models whichever you choose.

What it is

Crush is an open-source coding agent for the terminal, from Charm. It reads and edits the files in your project and runs commands, asking a model what to do next at each step. Beyond its built-in providers, it takes custom ones that speak an OpenAI-compatible or Anthropic-compatible API. It calls the gateway from your machine.

The settings

Crush reads its configuration from crushrc (a short script of commands) or, the older way, crush.json: in the project (.crushrc, crush.json), or in ~/.config/crush/ for every project.

provider add vidai --type completions \
  --name "Vidai" \
  --base-url "https://<your-gateway>/v1" \
  --api-key "${VIDAI_API_KEY:?set VIDAI_API_KEY}"

model add vidai/gpt-4.1 --name "GPT-4.1" \
  --context-window 1047576 --default-max-tokens 32768
model add vidai/claude-sonnet-4.5 --name "Claude Sonnet 4.5" \
  --context-window 200000 --default-max-tokens 64000 --supports-images true

model large vidai/claude-sonnet-4.5
model small vidai/gpt-4.1
{
  "$schema": "https://charm.land/crush.json",
  "providers": {
    "vidai": {
      "name": "Vidai",
      "type": "openai-compat",
      "base_url": "https://<your-gateway>/v1",
      "api_key": "$VIDAI_API_KEY",
      "models": [
        {
          "id": "gpt-4.1", "name": "GPT-4.1",
          "context_window": 1047576, "default_max_tokens": 32768,
          "cost_per_1m_in": 0, "cost_per_1m_out": 0,
          "cost_per_1m_in_cached": 0, "cost_per_1m_out_cached": 0,
          "can_reason": false, "supports_attachments": false
        }
      ]
    }
  },
  "models": {
    "large": { "provider": "vidai", "model": "gpt-4.1" },
    "small": { "provider": "vidai", "model": "gpt-4.1" }
  }
}

Then set the key in your shell:

export VIDAI_API_KEY="vk_…"

The provider's type decides the format Crush speaks. Both take the gateway's address with /v1:

Type (crushrc) In crush.json Format the gateway receives Base URL
completions (start here) openai-compat OpenAI Chat Completions, /v1/chat/completions https://<your-gateway>/v1
messages anthropic Anthropic Messages, /v1/messages https://<your-gateway>/v1

Both reach every provider the gateway serves; the gateway translates the request and the answer. For the Anthropic format, add --extra-header anthropic-version 2023-06-01 to the provider.

The gateway's address is under Connect your app on the Keys page and in System › Settings › Gateway; the key comes from Keys › Issue a key (its secret is shown once). The key starts vk_; never use a provider's key.

A minimal call

crush run "Reply with exactly: ok"

Crush uses the large model for the task and the small one for lighter work such as titles; pick either in the terminal interface too.

Streaming

Crush streams every step. A stream from another provider arrives in the format the provider's type names; Vidai records tokens and cost either way.

Tool calls

Crush's steps (view, edit, run a command, MCP tools) are tool calls. They work across providers: a tool call in the format Crush speaks reaches Claude, Gemini or GPT, and the answer comes back in the shape Crush expects. Use a model that is good at tool use; small models tend to stall on long tasks.

Reading what the gateway did

Crush doesn't show response headers. Look the calls up in Request logs: filter on Key, Model or Path. One task usually shows as many calls, one per step.

Errors

Crush shows the gateway's error message; crush logs has the detail. Common ones while setting up: 401 invalid_api_key (the key is wrong, unset, or a provider's key), 403 model_not_allowed (your key may not call that model), 404 model_not_found (check the model's id), 403 content_guardrail_blocked (a guardrail stopped the content), 429 (a limit on the key or team). The full list is in Headers and errors.

Model names

A model's id (after vidai/ in crushrc) is the name the gateway sees: use the names your organisation approved under Models in the Control room. GET https://<your-gateway>/v1/models with your key lists exactly the models it may call. Give each model its context window and output limit, so Crush knows when to summarise a long session.

What goes through the gateway

Crush feature Through the gateway
Every step of a session or a crush run, with the large and the small model Yes, when both are Vidai models
MCP servers you add to Crush The model calls that use their tools, yes; the MCP servers themselves are reached directly by Crush

Check it works in a minute

Run the minimal call above, then open Request logs a few seconds later and filter on your key: the call is there, with its model, its team and its cost.

Good to know

  • The cost Crush shows comes from the prices you give a model (zero above); Vidai prices every call itself, in Request logs.
  • Autonomous tasks are chatty: set a limit on the key (or the team's budget) so a runaway task stops at a known cost.
  • Issue one key per developer, so Request logs and cost reports show whose Crush made each call.
  • Crush's docs: README, configuration.