Use ApexApi in Crush

Crush is Charm's coding agent for the terminal. It speaks the OpenAI protocol and auto-discovers models, so one provider block gives you our whole catalog.

1. Get your API key

Create a key in your dashboard. It starts with ak-.

2. Export your key

export APEXAPI_API_KEY=ak-your-key-here

3. Add ApexApi to crush.json

Create a project-level crush.json or a global ~/.config/crush/crush.json:

{
  "$schema": "https://charm.land/crush.json",
  "providers": {
    "apexapi": {
      "name": "ApexApi",
      "type": "openai-compat",
      "base_url": "https://api.apexapi.dev/v1",
      "api_key": "$APEXAPI_API_KEY"
    }
  }
}

No model list needed: Crush reads our public /v1/models endpoint and lists the catalog by itself.

4. Pick a model

Start crush and choose an ApexApi model from the model picker.

Troubleshooting

  • 401 Unauthorized: the key wasn't pasted correctly or has been revoked.
  • Model not found: the model ID doesn't match a catalog ID. Copy it verbatim from the models page.
  • Connection fails: make sure the base URL is exactly https://api.apexapi.dev/v1 (no trailing slash after v1) and your balance is positive.
  • Anything else: check the error codes reference; streaming and tool calling are fully supported on /v1/chat/completions.