Crush
Last updated
Crush (Charm's terminal coding agent) supports custom OpenAI- and Anthropic-compatible providers through its config file, crushrc. Define Tempr once and list every model on your allowlist under it (Claude, GPT, Gemini) instead of adding one provider block per vendor.
-
Create a virtual key
In the Portal, create a Gateway virtual key. Keys are prefixed
tvk_and shown once at creation. -
Add a provider key
Gateway is BYOK: add a key for at least one provider from the supported list.
-
Add Tempr as a custom provider
Create or edit
crushrcin your project root, or~/.config/crush/crushrcfor every project (%USERPROFILE%\.config\crush\crushrcon Windows):
provider add tempr --type openai-compat \
--base-url "https://api.temprhq.io/v1" \
--api-key "$TEMPR_API_KEY"
model add tempr/anthropic/claude-sonnet-4-5 \
--name "Claude Sonnet 4.5 (via Tempr)" \
--context-window 200000 \
--default-max-tokens 8192
crushrc is a Bash script that Crush runs when it starts, so $TEMPR_API_KEY comes from your shell environment. Set it before launching:
export TEMPR_API_KEY="tvk_..."
crush
Model ids
Add one model add line per model you want available: tempr/ followed by the fully-qualified provider/model id (e.g. tempr/anthropic/claude-sonnet-4-5, tempr/openai/gpt-5). Crush takes everything after the first slash as the model id, so these are the same ids GET /v1/models returns. To start on one, add model large tempr/anthropic/claude-sonnet-4-5.
The example's Anthropic model needs an Anthropic key in the Portal; with another provider's key, use one of its models, or any model from GET /v1/models.
Crush still reads an older crush.json, but has deprecated it and adds new settings only to crushrc. If you have one, Crush can convert it for you: ask it to.
On a coding plan
To run Crush on a coding plan, such as the Z.AI GLM Coding Plan or Kimi Code, use one of the plan's models, named by the plan: zai-coding/glm-5.3. Tempr can get the plan's key two ways:
- Stored in Tempr. Add the plan's key under Provider keys in the Portal, and keep Crush's settings as they are, with your virtual key.
- Sent with each request. Set the provider's
--api-keyto the plan's key and send your virtual key with--extra-header: Tempr sends the plan's key only to that plan, and never stores it. An organization's keys take a key sent this way once an owner or admin turns on Plan logins.
provider add tempr --type openai-compat \
--base-url "https://api.temprhq.io/v1" \
--api-key "$PLAN_KEY" \
--extra-header x-tempr-key "$TEMPR_API_KEY"
model add tempr/zai-coding/glm-5.3 \
--name "GLM 5.3" \
--context-window 200000 \
--default-max-tokens 8192
Several plans are sold only for the coding tools they support, and some refuse other tools, telling them apart by the identity each tool sends. Tempr passes Crush's own along and never sends another, so check which tools each plan supports before you subscribe.
Ask Crush about your Gateway
Crush can also read your Gateway through the Gateway's own MCP server: usage and cost, request logs and one request's routing, keys, plan, and providers cooling down. Ask it "why did my last few requests fail?" or "which key spent the most this week?" while you work. It comes with the Gateway Pro, Scale and Enterprise plans.
The quickest way is to sign in. Add the server to crushrc, and Crush opens Tempr's sign-in in the browser when it connects:
mcp add tempr-gateway --type http \
--url "https://api.temprhq.io/mcp/admin" \
--oauth true
Signed in this way, Crush reads your own Gateway, or your organization's if you're an owner or admin. To let it make changes too, tick Also let it make changes on Tempr's consent page.
To give it a management key instead:
-
Create a management key
In the Portal, under Gateway → Keys → Management keys (or Organization → Org keys for an organization's Gateway). A management key reads and manages the Gateway but can't call models, so it's separate from the
tvk_virtual key Crush uses for its model. Tick what Crush may do: Read usage, Read request logs and List keys to read; Create, change and revoke keys as well if it may change keys. -
Send the key from an environment variable
Put the key in
TEMPR_MANAGEMENT_KEY, leave out--oauth, and send it as a bearer token. It comes from your environment, like$TEMPR_API_KEY:
mcp add tempr-gateway --type http \
--url "https://api.temprhq.io/mcp/admin" \
--header Authorization "Bearer $TEMPR_MANAGEMENT_KEY"
- The key's permissions decide the tools. Without Read request logs, Crush gets the usage, plan and key tools but not the logs.
- Changes also need the account to allow them: turn on Changes by AI agents on the Portal's MCP connectors page. Crush can then make changes that only tighten, such as creating a key that expires within 90 days or revoking one, and propose any that would loosen, such as a higher budget, for you to approve in the Portal, and asks you first unless you've allowed the tool with
permissions allowor run Crush with--yolo. A new key's secret never reaches it: it gets a one-time Portal link for you to copy the key from.
What's next
- The Gateway's MCP server: every tool, what it returns, and how text from your apps is marked.
- Authentication & virtual keys: scoping keys with model allowlists, budgets, and rate limits.
- Models, limits & logs: request logs and analytics for everything you send through the gateway.