Skip to content

Crush ​

Crush connects to OpenAI-compatible providers through a provider entry in its config. MUSCLE Flex by Adhibita serves the Chat Completions shape at /v1/chat/completions. Crush keeps running its tools in your terminal; Flex routes the model requests.

Before you start ​

You need:

  • an accepted MUSCLE Flex invitation and a funded service balance;
  • a Flex API key, created on the API keys page of the portal;
  • the Flex base URL from your invitation. This page writes it as <FLEX_BASE_URL>: the scheme and host only, without a trailing /v1.

The key check below reads both values from your shell:

bash
export FLEX_BASE_URL="<FLEX_BASE_URL>"
export MUSCLE_FLEX_API_KEY="<FLEX_API_KEY>"

Configure muscle/auto as the model id; auto is accepted as a short form of it. Flex chooses the route for each request, so the model field does not select a model. The model names that compatible clients send on their own are routed the same way. See The model id.

Check that Crush is installed with crush --version.

Configure ​

Create crush.json in the project, or ~/.config/crush/crush.json for every project, and merge in this provider:

json
{
  "$schema": "https://charm.land/crush.json",
  "providers": {
    "muscle-flex": {
      "name": "MUSCLE Flex",
      "type": "openai-compat",
      "base_url": "<FLEX_BASE_URL>/v1",
      "api_key": "$MUSCLE_FLEX_API_KEY",
      "models": [
        {
          "id": "muscle/auto",
          "name": "Flex auto"
        }
      ]
    }
  }
}
  • base_url ends in /v1.
  • $MUSCLE_FLEX_API_KEY makes Crush read the key from your shell, so the file holds no secret.
  • Crush may also list models from GET /v1/models. Flex lists only muscle/auto.

If your Crush version asks for context details, add context_window to the model entry with the context_length that Flex reports:

bash
curl -s "$FLEX_BASE_URL/v1/models" \
  -H "Authorization: Bearer $MUSCLE_FLEX_API_KEY"

Verify ​

1. Check the key ​

This read-only call confirms the base URL and the key before you change the agent:

bash
curl -i "$FLEX_BASE_URL/v1/account" \
  -H "Authorization: Bearer $MUSCLE_FLEX_API_KEY"

A 200 response returns your account summary, including available credits. A 401 means the key is missing, mistyped or revoked.

Every Flex response carries an X-Request-Id header. Keep it when you contact support: it is how a single request is found.

2. Run one tool call ​

Start crush in a small project, choose MUSCLE Flex and Flex auto, and ask:

text
List the files in this folder, then read the README and summarize it in one sentence.

Crush should read the files and answer from the README.

Troubleshooting ​

  • 401. Export MUSCLE_FLEX_API_KEY in the shell that launches Crush.
  • 404. Check that base_url does not double the path (…/v1/v1). It is <FLEX_BASE_URL> with a single /v1 added.
  • The provider does not appear. Crush reads its config at startup. Restart it after editing the file.

Responses you may see ​

StatusMeaningWhat to do
401The key is missing, mistyped or revoked.Check where the agent reads the key from. Create a new key in the portal if needed.
402Your balance or spend cap does not cover the request.Add credits, then retry.
403The account is suspended, or the request is not allowed.Contact support with the X-Request-Id.
404 model_not_foundThe agent sent a model id that Flex does not accept.Set the agent's model to muscle/auto. Retrying unchanged fails again.
429A rate limit was reached.Wait for the number of seconds in Retry-After (a few seconds when it is absent), then retry.
400 unsupported_fieldThe agent sent a field or tool that Flex does not offer yet.Find the field in the compatibility matrix and turn that option off.
400 unsupported_contentThe conversation carries an image or audio part, which Flex does not support yet.Start a new conversation without the image, and turn off the agent's image input.
502, 503 or 504No eligible route could serve the request at that moment, or it timed out.Retry later. If it persists, contact support with the X-Request-Id.
503 feature_unavailableNo route offers what the request needs, or the conversation is too long for every route.Start a new conversation or lower the agent's output limit. Retrying unchanged fails again.

The API reference describes each error code and what to do about it.

Agents rarely show response headers. When a request fails inside an agent, note the time, the agent version and the error text for support.

The model frontier, through one adaptive API.